feat(workbench): unify lane maneuver edits in v2

This commit is contained in:
que01 committed 2026-09-01 16:46:22 +08:00
1 parent 118dc8e9aa
commit c804a373ca
15 files changed
+337 -263

No files matched your search

+8
View File
@@ -17,6 +17,7 @@ import {
import type {
AnchorSnapshot,
ConstraintValue,
LaneManeuverValue,
EditHandle,
JunctionReserve,
RoadConstraint,
@@ -92,6 +93,8 @@ export function constraintValueFor(
transition: Transition = 'smoothstep',
): ConstraintValue {
switch (handle.kind) {
case 'lane-maneuver':
throw new Error('lane-maneuver requires laneManeuverValueFor');
case 'road-edge-offset':
return { offsetMeters: scalar, transition };
case 'road-sidewalk-width':
@@ -117,6 +120,11 @@ export function constraintValueFor(
}
}
/** Packages the two-field lane arrow edit as one direct-edit value. */
export function laneManeuverValueFor(maneuver: string, placementDistanceMeters: number): LaneManeuverValue {
return { maneuver, placementDistanceMeters };
}
/**
* The station range a road interval may occupy, i.e. everything outside the
* junction reserves. Mirrors the window `makeRoadHandles()` centres its handles