feat(junction): enable complex carriageway width editing

This commit is contained in:
que01 committed 2026-09-08 12:09:44 +08:00
1 parent 56647fcdaa
commit c4bcbe8ff9
22 files changed
+449 -52

No files matched your search

+12 -2
View File
@@ -10,7 +10,7 @@ It is required because the feature crosses compiler, storage, and HTTP layers.
```js
resolveDirectEditConstraints(model, editDocument, context)
// -> { roadProfiles, junctionPlans, constraintStates, handles, diagnostics }
// -> { roadProfiles, junctionPlans, clusterPlans, constraintStates, handles, diagnostics }
GET /api/edit-state
POST /api/edit-preview
@@ -316,7 +316,17 @@ then `structureFromTopology(topology, shape, center, features)`. Projection is
`cluster:<id>`. The legacy singular field is null at this unscoped entry point.
- `GET /api/edit-state?junction=<node>` preserves the node selection contract;
`?cluster=<id>` selects a cluster. Preview uses the equivalent `selection`
object. Cluster handle manifests are empty until a future writable contract.
object. A selected editable cluster publishes only `cluster-carriageway-width`
handles for its external carriageways.
- A `cluster-carriageway-width` anchor contains `clusterId`, stable
`carriagewayKey`, `sourceNodeIds`, and `sourceRoadIds`. Replay matches all
source identity; a missing or changed source is stale with `anchor-missing`.
The solver stores accepted values in `clusterPlans`, and `compileGeometry()`
applies them to the matching complex-junction approach before geometry is
generated. It must not widen unrelated member-node approaches.
- Preview and save both evaluate the same candidate through the resolver and
`compileGeometry()`. Save rejects every `severity: error` diagnostic before
writing the edit document.
- Complex road-surface features carry `junction_key`, `object_key` and relevant
`arm_key`, `carriageway_key`, `corner_key`. Core (or the first remaining
approach when the core fails) carries `junction_structure` for persisted reads.
+14 -1
View File
@@ -256,7 +256,9 @@ one. `handle.constraintId` — present only when a constraint exists — is also
- [ ] Constraints sent with their operations
- [ ] No geometry or OL reads inside a `setState` updater
- [ ] No per-`pointermove` React state updates
- [ ] Flag off ⇒ no sources, no layers, no interactions, no requests
- [ ] Flag off ⇒ no sources, layers, or interactions. A selected complex
JunctionTools workspace may request its scoped manifest solely to discover
server-published edit capability before the edit switch is enabled.
- [ ] Every input channel meets at the shared exits, not a parallel path
- [ ] Displayed bounds round inward, so an offered extreme is accepted
- [ ] A focused field is not rewritten by an arriving preview
@@ -279,6 +281,17 @@ reuse the unscoped singular structure when its ref differs. A missing structure
stays unavailable. Use `junctionEditSelection(ref)` for edit-state and preview
requests so a cluster never falls back to the last selected road or node.
## 17. Complex carriageway width editing
Complex JunctionTools consumes the same v2 `EditSession`, `PreviewRequester`,
`ParameterPanel`, and map handle callbacks as ordinary junctions. The only
editable handle in this stage is `cluster-carriageway-width` with a
`cluster-carriageway` anchor. Before edit mode, a selected cluster loads its
scoped manifest so `canEditJunction()` can use an editable server handle as the
capability signal. Once enabled, those same handles are rendered on the map and
in the panel; `App.tsx` resolves the anchor snapshot from `sourceRoadIds[0]`.
Do not add a cluster-local draft, preview, undo, or save flow.
Compiler structure provenance supplies cluster hotspots and external road IDs.
`localJunctionState` and `localJunctionPreview` recognize explicit `junction_key`
(and legacy `cluster_id`) before testing node/road references. This keeps core