Segment rewrites drop per-segment caps, padding flag, name and parent #102

Open
opened 2026-10-13 02:28:41 +00:00 by ImBenji · 0 comments
Owner

From the engineering review on 2026-10-13.

Several paths in lib/provider/map_data_state.dart build a fresh segment without carrying the old one's fields: convertArcSegmentToStraightAt (around line 1633), splitLineAt (2161), dissolveNode (2050) and the node drag refit in translateSelectedObjects (2548, 2570), plus BaseSegment.fromTangents. None pass startCap / endCap. Split and dissolve also force zLevelPadding: true, reset the name, lose the collection parent and leave stale lock and parent entries behind.

These paths predate the cap work, but under "null means inherit the line default" a hand-set cap silently reverts.

Evidence: test/review_probes/engine_model_ops_probe.dart (local, untracked): convert gives startCap=null endCap=null; split gives startCap=null pad=true parent=null with a stale parent entry for the dead id; node drag gives endCap=null. Dissolve and fromTangents are from reading.

Fix sketch: one shared "copy base fields" helper on BaseSegment, used at every rebuild site.

From the engineering review on 2026-10-13. Several paths in `lib/provider/map_data_state.dart` build a fresh segment without carrying the old one's fields: `convertArcSegmentToStraightAt` (around line 1633), `splitLineAt` (2161), `dissolveNode` (2050) and the node drag refit in `translateSelectedObjects` (2548, 2570), plus `BaseSegment.fromTangents`. None pass `startCap` / `endCap`. Split and dissolve also force `zLevelPadding: true`, reset the name, lose the collection parent and leave stale lock and parent entries behind. These paths predate the cap work, but under "null means inherit the line default" a hand-set cap silently reverts. **Evidence:** `test/review_probes/engine_model_ops_probe.dart` (local, untracked): convert gives `startCap=null endCap=null`; split gives `startCap=null pad=true parent=null` with a stale parent entry for the dead id; node drag gives `endCap=null`. Dissolve and `fromTangents` are from reading. **Fix sketch:** one shared "copy base fields" helper on `BaseSegment`, used at every rebuild site.
ImBenji added the bug label 2026-10-13 02:28:41 +00:00
ImBenji added this to the Arcs & Angles project 2026-10-13 02:28:41 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: IMBENJI.NET/Metro-Map-Maker#102