stalls
Draw aisles and zones
TL;DR
Managers can draw an aisle or a colored zone anywhere on the map — empty floor, not only stall tiles. Click points, then Done. Staff and trainers can see the shapes but cannot edit them.
- map
- overlays
- aisle
- zone
- drawing
- quarantine
For: Managers and above to edit; all staff can view. Route: /app/stalls?view=map → left panel Aisles & zones.
Permission: canEditMapOverlays → owner / admin / manager. Roles staff and trainer cannot draw or remove.
How to draw
- Open Stalls → Map for one property.
- In Aisles & zones, click Draw aisle (a walk path) or Draw zone (a shaded area).
- Click anywhere on the map — empty floor, between stalls, or on the canvas around tiles. You do not need to click a stall.
- Each click drops a vertex (snaps to half-cells). Dots mark the points; a dashed line or fill shows the draft.
- Aisle: at least 2 points. Zone: at least 3 points. For a zone, pick type (Quarantine / Show / Lessons / Custom) and an optional label.
- Finish with Done on the dark HUD, Save shape in the panel, double-click, or Enter. Cancel with Cancel or Esc. Undo point / Backspace removes the last vertex.
- To delete, use Remove on that overlay in the list.
While drawing, stall tiles ignore clicks so the whole canvas is the target. The cursor is a crosshair.
Example
You want a quarantine pad behind stalls 20–24. Draw zone → type Quarantine → click four corners on the empty floor behind those tiles (not on the tiles themselves) → label “Q-pad” → Done. The orange-tinted polygon stays on the map for everyone at this property. An aisle down the center is Draw aisle, two or more clicks along the walk, label “Main aisle”.
▶Show details for AI/advancedexhaustive reference & AI context
Aisles and Zones — Barnflow Property Map
For: Managers and above to edit; all staff can view. Route: /app/stalls?view=map → left panel Aisles & zones.
Permission: canEditMapOverlays → owner / admin / manager. Roles staff and trainer cannot draw or remove.
How to draw
- Open Stalls → Map for one property.
- In Aisles & zones, click Draw aisle (a walk path) or Draw zone (a shaded area).
- Click anywhere on the map — empty floor, between stalls, or on the canvas around tiles. You do not need to click a stall.
- Each click drops a vertex (snaps to half-cells). Dots mark the points; a dashed line or fill shows the draft.
- Aisle: at least 2 points. Zone: at least 3 points. For a zone, pick type (Quarantine / Show / Lessons / Custom) and an optional label.
- Finish with Done on the dark HUD, Save shape in the panel, double-click, or Enter. Cancel with Cancel or Esc. Undo point / Backspace removes the last vertex.
- To delete, use Remove on that overlay in the list.
While drawing, stall tiles ignore clicks so the whole canvas is the target. The cursor is a crosshair.
Example
You want a quarantine pad behind stalls 20–24. Draw zone → type Quarantine → click four corners on the empty floor behind those tiles (not on the tiles themselves) → label “Q-pad” → Done. The orange-tinted polygon stays on the map for everyone at this property. An aisle down the center is Draw aisle, two or more clicks along the walk, label “Main aisle”.
What aisles and zones are
| Kind | Geometry | Looks like | Typical use |
|---|---|---|---|
| Aisle | LineString (2+ points) | Thick taupe polyline | Walkways, wash rack approach |
| Zone | Polygon (3+ points) | Tinted fill + dashed stroke | Quarantine, show staging, lesson arena, custom |
Colors (defaults): aisle #8a7a68; quarantine #c45c26; show #2e6b4f; lessons #3d5a80; custom #6b5b95. Label max 80 characters.
Overlays belong to one property. Switching barns loads that property’s shapes only.
Drawing HUD
A dark pill at the top of the canvas while drawing:
- Point count and minimum (need 2+ or 3+).
- Undo point — drop the last vertex.
- Done — save if the minimum is met; otherwise an error: “Click at least two/three points anywhere on the map.”
- Cancel — discard the draft.
Keyboard (when focus is not in an input): Enter = Done, Escape = cancel, Backspace = undo point.
Click vs drag: a pointer move of more than 8px is treated as a pan/scroll, not a point, so scrolling the canvas does not accidentally add vertices.
Who can edit
| Role | View overlays | Draw / remove |
|---|---|---|
| owner, admin, manager | Yes | Yes |
| staff, trainer | Yes | No — action returns “Only managers and above can edit aisles and zones.” |
| Horse owner (portal) | No staff map | — |
RLS on property_map_overlays allows any org member to read/write at the database layer; the app enforces manager+ on save/delete. Always describe the product rule (manager+) to humans.
Data model (AI)
Table property_map_overlays:
organization_id,property_id(must match; triggerenforce_property_map_overlay_org)kindaisle\|zonelabel(≤ 80)stylejsonb{ color?, zoneKind?: quarantine|show|lessons|custom }geometryjsonb:{ type: "LineString"|"Polygon", coordinates: [x,y][] }where x,y are map cells, not lat/lng
parseMapOverlayGeometry rejects short coordinate lists. clientToMapCell converts pointer → cell with half-cell snap (round(x * 2) / 2) and 12px pad.
Audit: map_overlay_create / map_overlay_delete on audit_events (entity type property).
This is not a GIS / Google aerial overlay. Do not store WGS84. Print includes overlay SVG with the stall tiles.
Related
AI retrieval keywords: overlay, aisle, zone, LineString, Polygon, Draw aisle, Draw zone, click anywhere, canEditMapOverlays, property_map_overlays, quarantine, map-cell, clientToMapCell, HUD, Esc, half-cell snap
Barn staff: Open a support ticket
Horse owners: Message your barn