stalls
Templates, sketch, and copy layout
TL;DR
Templates place every stall into a barn shape (single aisle, double aisle, U courtyard, or grid). Copy layout copies positions from another property by stall name. Sketch only changes the background in this browser.
- map
- templates
- sketch
- copy layout
- aisle
- courtyard
For: Staff. Route: /app/stalls?view=map toolbar: Sketch, Templates, Copy layout.
These tools set or decorate the stall grid. They do not assign horses.
How to apply a template
- Add all stalls and pastures for the property first (templates need existing units).
- Open Map → Templates.
- Pick Single aisle, Double aisle, U courtyard, or Simple grid.
- Apply template. This overwrites saved map positions (
map_x/map_y) for every unit on this property and switches the sketch to match. - Click Edit Layout and nudge tiles that do not match the real barn.
If there are no units, Templates shows “Add units before applying a template.”
How to copy a layout
- Arrange (or template) the source property first.
- Open Map on the target property.
- Copy layout → choose the source barn → Copy onto this property.
- Units with the same name take the source coordinates first; leftover units fill remaining slots by name order.
- Fine-tune with Edit Layout.
Copy is disabled when the org has only one property (“Need another property to copy from”). Source and target must differ. Target must already have units.
Example
You open a second barn with stalls also named 1–24. Willow is already arranged as a double aisle. On the new property Map, Copy layout from Willow, then drag the wash stall two cells because this barn’s wash rack sits further down. Sketch Aisle floor is already on from the double-aisle template — leave it, or switch to Dots if you prefer a plain grid.
▶Show details for AI/advancedexhaustive reference & AI context
Map Layout Tools — Barnflow
For: Staff. Route: /app/stalls?view=map toolbar: Sketch, Templates, Copy layout.
These tools set or decorate the stall grid. They do not assign horses.
How to apply a template
- Add all stalls and pastures for the property first (templates need existing units).
- Open Map → Templates.
- Pick Single aisle, Double aisle, U courtyard, or Simple grid.
- Apply template. This overwrites saved map positions (
map_x/map_y) for every unit on this property and switches the sketch to match. - Click Edit Layout and nudge tiles that do not match the real barn.
If there are no units, Templates shows “Add units before applying a template.”
How to copy a layout
- Arrange (or template) the source property first.
- Open Map on the target property.
- Copy layout → choose the source barn → Copy onto this property.
- Units with the same name take the source coordinates first; leftover units fill remaining slots by name order.
- Fine-tune with Edit Layout.
Copy is disabled when the org has only one property (“Need another property to copy from”). Source and target must differ. Target must already have units.
Example
You open a second barn with stalls also named 1–24. Willow is already arranged as a double aisle. On the new property Map, Copy layout from Willow, then drag the wash stall two cells because this barn’s wash rack sits further down. Sketch Aisle floor is already on from the double-aisle template — leave it, or switch to Dots if you prefer a plain grid.
Sketch background
Sketch is a decorative canvas behind tiles (not saved to the database):
| Option | Typical pairing |
|---|---|
| Dots | Simple grid / default |
| Aisle floor | Single or double aisle templates |
| Barn courtyard | U courtyard template |
Stored per property in this browser: localStorage key stablesync-map-sketch:<propertyId>. Other staff do not see your sketch choice. Print includes the current sketch because it lives on the canvas.
Templates (detail)
| Id | Label | Description | Sketch switched to |
|---|---|---|---|
single_aisle | Single aisle | Stalls in one row; multi-horse units to the right | Aisle floor |
double_aisle | Double aisle | Two rows with a walk aisle between | Aisle floor |
u_courtyard | U courtyard | Stalls on three sides around an open center | Barn courtyard |
grid | Simple grid | Compact auto-packed grid by name | Dots |
Templates are pure layout in @stablesync/shared (applyLayoutTemplate). Multi-horse units (pasture / paddock / run-in, or capacity > 1) are placed with a larger footprint. Applying writes bulkUpdateUnitMapPositionsAction with reason template:<id> (audit).
Copy matching (AI)
matchCopyLayout:
- Case-insensitive name match source → target when both have a unique name.
- Remaining target units receive remaining source positions in name order.
- Does not create, rename, or delete units. Occupancy (
horses.unit_id) is unchanged.
Same organization only. Never copy across tenants.
Related
AI retrieval keywords: Templates, Copy layout, Sketch, single_aisle, double_aisle, u_courtyard, grid, applyLayoutTemplate, matchCopyLayout, localStorage sketch, bulkUpdateUnitMapPositionsAction
Barn staff: Open a support ticket
Horse owners: Message your barn