Commit Graph

16 Commits

Author SHA1 Message Date
92297270f1 feat: drag road handles with ghost and server preview
Three things, kept in one commit because they touch overlapping hunks of the
same two files and this environment has no interactive hunk staging. Splitting
them by file would have drawn boundaries that misrepresent what changed.

1. Step 4 of the map editor. A native OpenLayers PointerInteraction turns a
   drag into a clamped constraint value, the ghost source shows it immediately,
   and the solver's answer replaces a parallel set of preview layers while the
   baseline layers are hidden rather than overwritten. Preview requests debounce
   at 80 ms, pointerup flushes without waiting, and a newer request aborts the
   one in flight; EditSession decides which answers count. Handle positions come
   from the clamped value, so a handle stops at its limit instead of following
   the cursor. Three of the four drag capabilities are live: edge offset,
   sidewalk width, lane divider.

2. Road edge handles were drawn on the wrong side. offsetLine() offsets
   counter-clockwise from the direction of travel and sidewalks use
   `heading + (side === 'left' ? -90 : 90)`, so left is `tangent - 90`;
   makeRoadHandles() placed the left handle at `tangent + 90`, over the right
   kerb. Dragging the visually-left handle moved the right edge. Fixed on both
   sides of the wire, with regression tests that name the sides geographically
   rather than by axis sign.

3. Roads the junctions geometrically fill are now read-only. The 0.45 cap per
   reserve made the existing `unavailable` branch unreachable, so a 14.5 m stub
   between two junctions was offered a 1.5 m editable band with no room for the
   transitions a road-interval constraint needs. Greying only affects the
   manifest: constraints already saved against such a road keep being solved, so
   the geometry output is unchanged and the fixture baselines do not move.

Range handles are built and unit-tested but hidden behind
`intervalEditingSupported`: compileGeometry() reads neither profile.interval nor
profile.transitions, so every edit applies to the whole road and the control
would have had no effect. Recorded in research/interval-not-applied.md, which
also blocks one PRD acceptance criterion.

The ol-ext probe stays in the tree as a manual harness; ol-ext is still not a
dependency.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-27 17:38:34 +08:00
735ce69d26 feat: classify direct edit replay states 2026-08-27 12:43:35 +08:00
0eb404d8f7 feat: solve direct edit constraints 2026-08-27 12:36:35 +08:00
ab63d23896 feat: generate direct edit handle manifest 2026-08-27 12:18:11 +08:00
3297d0c97a feat: insert direct edit constraint solver stage
Adds resolveDirectEditConstraints between compileRoadModel and
compileGeometry, per the parent design's data flow. The stage is an
identity transform until the individual constraint kinds land: it
returns empty road profiles, junction plans and handle manifest, so
compileGeometry's geometry code is untouched and output stays
byte-identical.

Constraint planning is separated from solving up front. Only `exact`
and `recheck` constraints may reach the solver; `disabled`,
`pending`, `conflicted` and `stale` are reported as unapplied with a
reason. SOLVED_KINDS starts empty and grows one entry per kind, so a
partially delivered solver reports what it skipped instead of
publishing half-solved geometry.

diagnostic() moves to src/compile/diagnostics.js so the solver can
share the compiler's diagnostic shape without depending on fs, which
would break the pure-function boundary that lets preview, the full
compile and the CLI export share one implementation.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-27 10:29:45 +08:00
ba8eaba9d9 feat: compile revisions from area config snapshots 2026-08-26 18:08:55 +08:00
c0c8a16dd4 feat: add immutable road revision storage 2026-08-26 17:54:38 +08:00
35002371ae feat: add native road edits document validation 2026-08-26 17:46:02 +08:00
3ddb33e321 feat: migrate workbench to React 2026-08-26 15:01:07 +08:00
81e02c670d feat: export portable native road packages 2026-08-26 11:59:48 +08:00
3b4befb025 fix: preserve native road metadata order 2026-08-26 10:44:17 +08:00
54d77ef09d fix: preserve native road render order 2026-08-26 10:25:08 +08:00
82afafa294 feat: publish native road layer manifest 2026-08-26 09:53:21 +08:00
208df9e6af fix: package lane arrow assets 2026-08-25 17:56:55 +08:00
b7a27b96cb refactor: move native road checks into package 2026-08-25 17:15:15 +08:00
eb859c40d5 refactor: move road compiler core into package 2026-08-25 17:12:58 +08:00