forge
Explore
Log in

Don't you dare go Hollow

A clip let go in the bench's left gutter lands at frame 0

Browse files at this commit

bbc437bc4c98fb098813698e513cb7ea1831ffb1Ahmet Kaan GümüşParent: 8bd7e0c
  • fix
    • a clip let go in the bench's left gutter lands at frame 0
Show full message
🐛 fix(app): a clip let go in the bench's left gutter lands at frame 0

gpui fires on_drop only on an element whose own hitbox holds the pointer,
and the bench's 12px side gutter was padding on the parent div -- so a
release at x < 12, exactly where a hand aiming a clip at frame 0 puts it,
reached no drop target and moved nothing, silently. The gutter now lives
inside bench-content's own box: same pixels, and the catch-all release
already written there now covers the edge.
crates/app/src/ui/bench_stance.rsmodified+7 -0
@@ -1229,6 +1229,9 @@ fn lane_row(
1229 1229
1230 /// The bench's content: pinned ruler, pinned heads, lane stack -- compressed1230 /// The bench's content: pinned ruler, pinned heads, lane stack -- compressed
1231 /// evenly to [`LANES_COMPRESS`] rows and then scrolling (DESIGN §7).1231 /// evenly to [`LANES_COMPRESS`] rows and then scrolling (DESIGN §7).
1232+/// The bench's side gutter, spent inside [`render`]'s own content box.
1233+const BENCH_GUTTER: f32 = 12.;
1234+
1232 pub(crate) fn render(1235 pub(crate) fn render(
1233 player: &mut Player,1236 player: &mut Player,
1234 box_h: f32,1237 box_h: f32,
@@ -1292,6 +1295,10 @@ pub(crate) fn render(
1292 .on_scroll_wheel(cx.listener(|this, event: &ScrollWheelEvent, _, cx| {1295 .on_scroll_wheel(cx.listener(|this, event: &ScrollWheelEvent, _, cx| {
1293 this.timeline_wheel(event, cx);1296 this.timeline_wheel(event, cx);
1294 }))1297 }))
1298+ // The bench's side gutter, spent here rather than by the `bench` div
1299+ // above, so this element's bounds -- and the catch-all release below
1300+ // with them -- reach the window edge (note at `ui::stance::bench`).
1301+ .px(px(BENCH_GUTTER))
1295 // The catch-all release: a clip let go of anywhere on the bench that is1302 // The catch-all release: a clip let go of anywhere on the bench that is
1296 // not a lane row -- left of the tracks, in the gap between two rows, on1303 // not a lane row -- left of the tracks, in the gap between two rows, on
1297 // the empty bench below the last one -- lands on the lane and the x the1304 // the empty bench below the last one -- lands on the lane and the x the
crates/app/src/ui/stance.rsmodified+8 -1
@@ -615,7 +615,14 @@ fn bench(
615 // the bench is the selection one a picked clip draws (DESIGN §2/§4).615 // the bench is the selection one a picked clip draws (DESIGN §2/§4).
616 .flex()616 .flex()
617 .flex_col()617 .flex_col()
618- .px(px(12.))618+ // The 12px side gutter is spent INSIDE `bench_stance`'s own content
619+ // box, not here: gpui fires `on_drop` only on an element whose own
620+ // hitbox holds the pointer (`div.rs:2089`), and padding on this
621+ // parent left the gutter outside every registered target -- a clip
622+ // let go at x < 12, hard against the left edge where a hand aiming
623+ // at frame 0 puts it, reached nothing at all and moved nothing,
624+ // silently (DESIGN §8: a release that has aimed has made an edit).
625+ // Same box, same pixels; only the catch-all's bounds grow.
619 .py(px(4.))626 .py(px(4.))
620 .child(bench_stance::render(player, bench_h - BENCH_CHROME_H, cx))627 .child(bench_stance::render(player, bench_h - BENCH_CHROME_H, cx))
621 }628 }