diff --git a/crates/app/src/tests/layout.rs b/crates/app/src/tests/layout.rs index d966771..aaaa842 100644 --- a/crates/app/src/tests/layout.rs +++ b/crates/app/src/tests/layout.rs @@ -2795,3 +2795,22 @@ fn the_seam_paints_nothing_until_a_pointer_finds_it() { assert!(body.contains(step), "the divider is missing {step}"); } } + +/// DESIGN §7: "lanes scroll behind the pinned ruler and track heads" -- pinned +/// means pinned. A clip that starts left of the view sits at a negative `left` +/// inside its bed, and with no clip mask gpui paints it (and its hitbox) over +/// the 72 px head column, so V1/A1 and their verbs disappear under the first +/// take as soon as the bench is wheeled past frame 0. The mask belongs on the +/// bed itself so a half-scrolled clip still drags on the half that shows. +#[test] +fn the_lane_bed_clips_its_clips_at_the_pinned_heads() { + let src = src_text("ui/bench_stance.rs"); + let start = src.find(r#".id(("bench-bed""#).expect("the bed"); + let bed = + &src[start..start + src[start..].find(".bg(rgb(DARK_CANVAS()))").expect("its fill")]; + assert!( + bed.contains(".overflow_hidden()"), + "the bed lets its clips paint outside itself, straight over the \ + pinned lane heads: {bed}" + ); +} diff --git a/crates/app/src/ui/bench_stance.rs b/crates/app/src/ui/bench_stance.rs index f1bf263..fb141bb 100644 --- a/crates/app/src/ui/bench_stance.rs +++ b/crates/app/src/ui/bench_stance.rs @@ -1039,6 +1039,17 @@ fn lane_row( .flex_1() .min_w(px(0.)) .h_full() + // DESIGN §7: the lanes scroll BEHIND the pinned heads. A + // clip whose start is left of the view sits at a negative + // `left`, and without a clip mask gpui paints it -- and its + // hitbox -- straight over the 72px head column, so V1/A1 and + // their verbs vanish under it. The mask cuts painting and + // hit-testing at the bed's own edges together, so the visible + // half of a half-scrolled clip still drags and trims and the + // hidden half answers nothing. Menus, drag previews and + // tooltips are unaffected: they render at the window root + // (`ui/overlays.rs`, gpui's `active_drag`), not in here. + .overflow_hidden() .bg(rgb(DARK_CANVAS())) // The seam is drawn as an absolute overlay rather than a // layout `border_l_1`: a border eats a pixel out of the