19 Commits
Author SHA1 Message Date
que01 0c42eb46cd fix complex junction island geometry 2026-09-16 13:24:34 +08:00
que01 376427d270 fix: default complex junction crosswalks 2026-09-11 12:40:46 +08:00
que01 f40caaa264 fix: hide handles for unavailable junction structures 2026-09-11 11:37:58 +08:00
que01 3a8af43140 fix: require source evidence for complex crosswalks 2026-09-11 11:24:19 +08:00
que01 f1a5b284a7 test: include carriageway edit handles in api scope 2026-09-10 14:06:56 +08:00
que01 79f83412e6 feat: complete complex junction transition editing 2026-09-09 16:57:47 +08:00
que01 9b6b5b5791 test(junction): keep facilities aligned with width edits 2026-09-09 11:58:53 +08:00
que01 280b726c6f feat(junction): taper complex carriageway edits 2026-09-09 10:24:57 +08:00
que01 a98d170757 fix(junction): align complex crossing handles 2026-09-09 10:20:01 +08:00
que01 49a44fdf73 feat(junction): edit complex crossing facilities 2026-09-08 15:05:00 +08:00
que01 80f122be46 feat(junction): edit complex cutbacks and corners 2026-09-08 14:30:43 +08:00
que01 c4bcbe8ff9 feat(junction): enable complex carriageway width editing 2026-09-08 12:09:44 +08:00
que01 0a5a229ce3 feat(junction): establish stable complex junction structure 2026-09-08 11:25:57 +08:00
que01 63c6cefce7 feat(junction): enforce stage3 geometry validation on save 2026-09-07 15:47:34 +08:00
que01 a78f5257fc test(junction): verify preview and compile parity 2026-09-03 13:32:37 +08:00
que01andClaude Opus 5 d94c546450 fix: recompile after saving direct edits
Saving wrote the v2 document but nothing else, and `/api/state` serves the
outputs of the last compile — so a refresh showed the pre-edit geometry and a
successful save was indistinguishable from a failed one. Reported as "saved,
refreshed, edit gone"; the document on disk was in fact correct, resolving as
`exact` with the constraint reaching the profile.

Save now recompiles and clears the preview overlay, since the baseline carries
the edit afterwards and would otherwise draw it twice. The recompile is reported
separately from the save: if it fails the message says the edit was saved and
names the compile error, rather than claiming the save failed.

The existing identity test could not have caught this. An ignored `editsFile`
and an empty document produce the same output, so it proved nothing about a
non-empty one. The API test now compiles with and without a saved constraint and
asserts the outputs differ.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-28 09:25:09 +08:00
que01andClaude Opus 5 38593f6f67 feat: save, undo and redo direct edits
Step 5 of the map editor. EditSession becomes the single owner of the constraint
set, replacing the pair of refs step 4 kept alongside it: it now holds the saved
operations too, and `fragment()` assembles the constraints plus every operation
they reference — the shape both preview and save send. That removes the class of
bug that produced the earlier 400, because callers can no longer ship a
constraint whose provenance points at nothing.

Save goes through `expectedDocumentVersion`. A 409 adopts the server's version so
the next attempt is checked against reality, and says which version won instead
of failing silently. Undo of a saved gesture appends an inverse operation rather
than rewriting persisted history; undo of an unsaved one just moves the cursor.
Discard drops unsaved commands, cancels anything in flight, and returns the map
to the baseline.

One gesture mints one operation id, released on pointerup. Reusing an id across
gestures put two operations with the same id in the document, which
validateEditDocument() rejects.

The API test now covers the payload the client actually sends — `constraints` +
`operations` merged into the active document, rather than a whole document — and
asserts that a save survives a reload as `exact`. Sending constraints without
their operations is asserted to be rejected rather than written.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-27 18:11:52 +08:00
que01 f3f763f94c feat: persist direct edits with revision rebase 2026-08-27 12:52:40 +08:00
que01 41c314fc61 feat: add direct edit preview APIs 2026-08-27 12:48:29 +08:00