v2 migration puts default tracing images under the grid #100

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

From the engineering review on 2026-10-13.

migratedCanvasObjectZ in lib/utils/migrations/m002_unified_z_index.dart:60 subtracts a fixed gap from negative z values, ignoring the grid level and the document's actual segment and station z range. kDefaultGridZLevel is -1.

Results on an upgraded v2 file:

  • A default tracing image goes from -1 to -11 and now sits under the grid. This is the most common v2 object. A fresh v3 image at -1 sits above the grid.
  • An old z=0 box (above all track) goes to 10 and is covered by track at z=12.
  • An old z=-1 image (below all track) ends up above track at z=-15.

The relayer is baked in on the next save, and the app overwrites the pre-migration file on first Cmd+S with no .bak (the CLI tool writes one).

Evidence: test/review_probes/persist_migration.dart (local, untracked), checked through sceneZOrder. test/zindex_migration_test.dart asserts the numbers but never the resulting order.

Fix sketch: compute min and max segment/station z per document and offset from those, and keep the old below-track tier at or above gridZLevel (or write a gridZLevel below the lowest object). Needs a follow-up migration for files already upgraded.

From the engineering review on 2026-10-13. `migratedCanvasObjectZ` in `lib/utils/migrations/m002_unified_z_index.dart:60` subtracts a fixed gap from negative z values, ignoring the grid level and the document's actual segment and station z range. `kDefaultGridZLevel` is -1. **Results on an upgraded v2 file:** - A default tracing image goes from -1 to -11 and now sits under the grid. This is the most common v2 object. A fresh v3 image at -1 sits above the grid. - An old z=0 box (above all track) goes to 10 and is covered by track at z=12. - An old z=-1 image (below all track) ends up above track at z=-15. The relayer is baked in on the next save, and the app overwrites the pre-migration file on first Cmd+S with no `.bak` (the CLI tool writes one). **Evidence:** `test/review_probes/persist_migration.dart` (local, untracked), checked through `sceneZOrder`. `test/zindex_migration_test.dart` asserts the numbers but never the resulting order. **Fix sketch:** compute min and max segment/station z per document and offset from those, and keep the old below-track tier at or above `gridZLevel` (or write a `gridZLevel` below the lowest object). Needs a follow-up migration for files already upgraded.
ImBenji added the bugarea:rendering labels 2026-10-13 02:28:39 +00:00
ImBenji added this to the Arcs & Angles project 2026-10-13 02:28:39 +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#100