When the user switches to linear view, the viewport automatically repositions so the OUTER column (nodes at the deepest dependency level) sits near the left edge and all its nodes are visible vertically. One-time on mode-switch; free pan/zoom afterwards.
What changes
All changes are in src/move37/web/src/App.jsx:
- New
computeLinearFitViewport(size, maxLevel, outerNodeCount) → { zoom, panOffset }
- Hook into the morph-completion effect so it calls this function only when the final target mode is
"linear"
Behaviour
- Zoom is computed so the vertical span of all OUTER nodes + padding fits in the viewport height
- Zoom is clamped between
0.55 (existing min) and 2.0 (existing default max)
panOffset pins the OUTER column ~60–80 px from the left edge; other columns may run off-screen to the right
- If there is only one dependency level (single column), centres it instead of pinning left
- Ignores side panels; uses full canvas dimensions
- Switching away from linear restores the normal default viewport (existing behaviour)
Acceptance criteria
When the user switches to linear view, the viewport automatically repositions so the OUTER column (nodes at the deepest dependency level) sits near the left edge and all its nodes are visible vertically. One-time on mode-switch; free pan/zoom afterwards.
What changes
All changes are in
src/move37/web/src/App.jsx:computeLinearFitViewport(size, maxLevel, outerNodeCount)→{ zoom, panOffset }"linear"Behaviour
0.55(existing min) and2.0(existing default max)panOffsetpins the OUTER column ~60–80 px from the left edge; other columns may run off-screen to the rightAcceptance criteria
3d → linearmorph