Skip to content

Fleet UI: zone editor — edit zones on the map, saved as candidate revisions - #95

Merged
MJohnson459 merged 2 commits into
mainfrom
zone-editor-mvp
Aug 2, 2026
Merged

Fleet UI: zone editor — edit zones on the map, saved as candidate revisions#95
MJohnson459 merged 2 commits into
mainfrom
zone-editor-mvp

Conversation

@MJohnson459

Copy link
Copy Markdown
Contributor

The dashboard grows the review half the promote picker was missing (voro #346, P1; mapping-pipeline design stage 3): an edit zones mode on the fleet map, whose save never touches the floor it edits.

What it does

  • Drag polygon vertices, drag whole zones (footprint + pose move together), drag pose crosses; double-click an edge to insert a vertex, a vertex to remove one (a triangle refuses to collapse further).
  • Rename / display-name / add / delete in a panel beside the map; machine names validated against the same rule the robot's loader enforces, client-side, before save.
  • Save derives a new candidate revision server-side: POST /v1/sites/<site>/floors/<floor>/zones (operator-authenticated, audited as map.zones) packs the canonical revision's bytes with the submitted zones (vocabulary_revision bumped) and feeds them through the same accept() path as a robot upload — validation, id-collision handling, provenance sidecar, pruning all unchanged. The canonical revision stays byte-identical, which the announced digests depend on; promotion of the edited candidate is the existing route, so the browser's write surface remains: dispatch, zone edit, promote — all audited.
  • After a successful save the edited set stays on screen as a frozen overlay labelled as the candidate's — the first field use read the revert-to-canonical as data loss (the candidate isn't previewable until #339).

Testing

  • mote_fleet/test/test_zone_edit.py (7 tests, live server): candidate derived + listed + promotable, canonical bytes untouched, 401 without operator, 422 on structurally unreadable zones, warning (not refusal) on a name a dispatcher can't type, 409 with no published map, 400 on a non-mapping body.
  • ui_test.mjs +7: concave point-in-polygon, vertex/edge hit-tests, insert/remove/translate/pose ops, fresh-zone naming, wire payload shape, and the [hidden] display guard (the M3 promote-picker lesson).
  • Full mote_fleet suite: 194 passed, 4 skipped (broker-gated e2e, as always).
  • Field-tested against the live registry: the whole flat was re-zoned in one sitting (candidate 20260802T203339).

Known follow-ups tracked in voro: #346 (aliases/kind, candidate-based editing, carry-forward accept/reject), #339 (candidate preview), #350 (grid snapping + shared vertices).

🤖 Generated with Claude Code

https://claude.ai/code/session_013o39JoxarofwaPi6kGYxXY

MJohnson459 and others added 2 commits August 2, 2026 21:24
The dashboard grows the review half the promote picker was missing: an
'edit zones' mode on the map canvas (drag a vertex, drag a zone, drag a
pose cross, double-click to add or remove vertices, rename/add/delete in
a side panel) whose save never touches the floor it edits. The server
derives a new candidate from the canonical revision — same map bytes,
submitted zones, vocabulary_revision bumped — via the same accept() path
as a robot upload, so validation, collision handling, provenance sidecar
and pruning all apply unchanged, and the promoted revision's announced
digest stays backed by immutable bytes. Promotion of the edited
candidate is the existing route; the browser's write surface stays
operator-authenticated and audited (action map.zones).

Geometry is pure functions over zones in world metres (zone_editor.mjs),
tested under node beside the map transform; the editor panel carries the
explicit [hidden] display guard the M3 promote picker taught us.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013o39JoxarofwaPi6kGYxXY
Saving closed the editor and re-rendered the canonical zones — the old
ones, since the edits live in a candidate the map cannot preview until
promotion (task 339). The operator read that as their work vanishing.
finish() now freezes the saved set as the overlay, the note says the
zones on screen are the candidate's, and a floor change or promotion
clears the overlay since the canonical then speaks for itself.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013o39JoxarofwaPi6kGYxXY
@MJohnson459
MJohnson459 marked this pull request as ready for review August 2, 2026 20:53
@MJohnson459
MJohnson459 merged commit ea6f67b into main Aug 2, 2026
5 checks passed
@MJohnson459
MJohnson459 deleted the zone-editor-mvp branch August 2, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant