Add intermediate divider snapping (uneven pane sizes)

Dragging a divider now resizes its two adjacent panes live and, on release,
snaps the boundary to the nearest of 1/4, 1/3, 1/2, 2/3, 3/4 — so one pane can
be made dominant within a 2- or 3-pane window. Dragging far enough to squeeze a
pane past the collapse threshold still triggers the membership transition
(slide/shrink per R1-R6), after which sizing resets to even.

MobileState gains a `weights: [f32;3]` (normalized on use); config_rects is
weight-aware; edge drags keep animating toward the even-split target.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Skyler Lehmkuhl
2026-06-30 01:18:13 -04:00
co-authored by Claude Opus 4.8
parent 0e3c437d50
commit 3b39e80e40
2 changed files with 166 additions and 46 deletions
@@ -122,8 +122,11 @@ pub struct StackDrag {
pub struct MobileState {
/// Index into `STACK` of the topmost visible pane.
pub window_top: usize,
/// Number of visible panes (2 or 3).
/// Number of visible panes (1, 2, or 3; 1 = a single pane filling the stack).
pub window_count: usize,
/// Relative heights of the visible panes (first `window_count` entries are used; normalized on
/// use). Reset to even on any membership change; adjusted by intermediate divider snapping.
pub weights: [f32; 3],
/// Node/Instrument band: false = node editor, true = instrument/preset browser.
pub show_instruments: bool,
/// Active handle drag (transient).
@@ -136,6 +139,7 @@ impl Default for MobileState {
// Launch on {Stage, Timeline}.
window_top: 2,
window_count: 2,
weights: [1.0, 1.0, 1.0],
show_instruments: false,
drag: None,
}