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.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
From the engineering review on 2026-10-13.
migratedCanvasObjectZinlib/utils/migrations/m002_unified_z_index.dart:60subtracts a fixed gap from negative z values, ignoring the grid level and the document's actual segment and station z range.kDefaultGridZLevelis -1.Results on an upgraded v2 file:
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 throughsceneZOrder.test/zindex_migration_test.dartasserts 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 agridZLevelbelow the lowest object). Needs a follow-up migration for files already upgraded.