The lane bed clips its clips at the pinned heads
Browse files at this commit2bf7f4a6ad7ef4628c33c9253cfa3a6a58ef6cf3Parent: 9c4d7ce- fix
- the lane bed clips its clips at the pinned heads
2 changed files +30 -0
crates/app/src/tests/layout.rsmodified+19 -0
| @@ -2795,3 +2795,22 @@ fn the_seam_paints_nothing_until_a_pointer_finds_it() { | |||
| 2795 | assert!(body.contains(step), "the divider is missing {step}"); | 2795 | assert!(body.contains(step), "the divider is missing {step}"); |
| 2796 | } | 2796 | } |
| 2797 | } | 2797 | } |
| 2798 | + | ||
| 2799 | +/// DESIGN §7: "lanes scroll behind the pinned ruler and track heads" -- pinned | ||
| 2800 | +/// means pinned. A clip that starts left of the view sits at a negative `left` | ||
| 2801 | +/// inside its bed, and with no clip mask gpui paints it (and its hitbox) over | ||
| 2802 | +/// the 72 px head column, so V1/A1 and their verbs disappear under the first | ||
| 2803 | +/// take as soon as the bench is wheeled past frame 0. The mask belongs on the | ||
| 2804 | +/// bed itself so a half-scrolled clip still drags on the half that shows. | ||
| 2805 | +#[test] | ||
| 2806 | +fn the_lane_bed_clips_its_clips_at_the_pinned_heads() { | ||
| 2807 | + let src = src_text("ui/bench_stance.rs"); | ||
| 2808 | + let start = src.find(r#".id(("bench-bed""#).expect("the bed"); | ||
| 2809 | + let bed = | ||
| 2810 | + &src[start..start + src[start..].find(".bg(rgb(DARK_CANVAS()))").expect("its fill")]; | ||
| 2811 | + assert!( | ||
| 2812 | + bed.contains(".overflow_hidden()"), | ||
| 2813 | + "the bed lets its clips paint outside itself, straight over the \ | ||
| 2814 | + pinned lane heads: {bed}" | ||
| 2815 | + ); | ||
| 2816 | +} | ||
crates/app/src/ui/bench_stance.rsmodified+11 -0
| @@ -1039,6 +1039,17 @@ fn lane_row( | |||
| 1039 | .flex_1() | 1039 | .flex_1() |
| 1040 | .min_w(px(0.)) | 1040 | .min_w(px(0.)) |
| 1041 | .h_full() | 1041 | .h_full() |
| 1042 | + // DESIGN §7: the lanes scroll BEHIND the pinned heads. A | ||
| 1043 | + // clip whose start is left of the view sits at a negative | ||
| 1044 | + // `left`, and without a clip mask gpui paints it -- and its | ||
| 1045 | + // hitbox -- straight over the 72px head column, so V1/A1 and | ||
| 1046 | + // their verbs vanish under it. The mask cuts painting and | ||
| 1047 | + // hit-testing at the bed's own edges together, so the visible | ||
| 1048 | + // half of a half-scrolled clip still drags and trims and the | ||
| 1049 | + // hidden half answers nothing. Menus, drag previews and | ||
| 1050 | + // tooltips are unaffected: they render at the window root | ||
| 1051 | + // (`ui/overlays.rs`, gpui's `active_drag`), not in here. | ||
| 1052 | + .overflow_hidden() | ||
| 1042 | .bg(rgb(DARK_CANVAS())) | 1053 | .bg(rgb(DARK_CANVAS())) |
| 1043 | // The seam is drawn as an absolute overlay rather than a | 1054 | // The seam is drawn as an absolute overlay rather than a |
| 1044 | // layout `border_l_1`: a border eats a pixel out of the | 1055 | // layout `border_l_1`: a border eats a pixel out of the |