-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
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) and2.0(existing default max) panOffsetpins 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
- Entering linear mode always lands with OUTER nodes visible and near the left edge
- Does not trigger on the intermediate 2D step of a
3d → linearmorph - Padding constants are named constants for easy tuning
- No regressions on 2D/3D modes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels