From dd96126513013ceda325115d9b19809e3f84af25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Fri, 21 Aug 2026 12:45:51 +0300 Subject: [PATCH] fix(ui): scroll equalizer card from hint --- crates/app/src/tests/cards.rs | 33 +++++++++++++++++++++++++++++++++ crates/app/src/ui/cards.rs | 23 +++++++++++------------ 2 files changed, 44 insertions(+), 12 deletions(-) diff --git a/crates/app/src/tests/cards.rs b/crates/app/src/tests/cards.rs index d0461aa..6a9322b 100644 --- a/crates/app/src/tests/cards.rs +++ b/crates/app/src/tests/cards.rs @@ -1770,6 +1770,39 @@ fn a_cards_own_help_paints_while_the_card_is_open_but_the_ui_under_it_stays_quie ); } +/// Structural guard only: this binary has no `TestAppContext`, so it cannot +/// mount the card, aim at its hint, wheel it, or read painted movement. A +/// driving pass must still prove a wheel over the hint changes card pixels. +/// This pins the declaration-level invariant that the EQ card's outer +/// container, which also owns the hint sibling, owns `eq_scroll`; putting the +/// handle back on `eq-card-rows` recreates that hint's dead zone. +#[test] +fn eq_cards_scroll_handle_belongs_to_the_container_that_also_holds_its_hint() { + let card = fn_body("eq_card"); + let card_at = card.find(".id(\"eq-card\")").expect("EQ card container"); + let rows_at = card.find(".id(\"eq-card-rows\")").expect("EQ card rows"); + let container = &card[card_at..rows_at]; + + assert!( + container.contains(".overflow_y_scroll()") + && container.contains(".track_scroll(&self.eq_scroll)"), + "eq_scroll must belong to eq-card, the container that also holds the \ + below-fold hint, rather than a body-only child" + ); + + let rows = &card[rows_at..]; + assert!( + !rows.contains(".track_scroll(&self.eq_scroll)"), + "eq-card-rows owns eq_scroll again -- its sibling hint becomes a \ + wheel dead zone" + ); + assert!( + rows.contains("more below — scroll the card"), + "the below-fold hint disappeared; this guard must cover the child it \ + keeps in the card's wheel surface" + ); +} + /// "Maximize a card in place" changes size only, never the relative /// semantics a value is drawn against: `eq_x`/`eq_y` map into `0..1` of /// whatever box they are given, so a wider/taller EQ card is genuinely more diff --git a/crates/app/src/ui/cards.rs b/crates/app/src/ui/cards.rs index 2c66462..eae9654 100644 --- a/crates/app/src/ui/cards.rs +++ b/crates/app/src/ui/cards.rs @@ -1560,14 +1560,19 @@ impl Player { // outright hung the card's right-hand third off the edge // of the window. The two cards beside it are built this // way for the same reason. + .id("eq-card") .w_full() .max_w(px(eq_card_w(f32::from(viewport.width), self.card_maximized))) // And a cap the other way, for the same reason the width // has one: the card is docked in a column now, and at the // 360 px floor it is taller than that column -- its title // ran off the top and its buttons off the bottom, with - // neither reachable. Capped here, scrolled below. + // neither reachable. The card itself owns that scroll: + // every child, including the below-fold line, is in its + // wheel surface rather than a fixed sibling dead zone. .max_h(relative(1.)) + .overflow_y_scroll() + .track_scroll(&self.eq_scroll) // Maximized also *claims* the room the cap above // only allows: `flex_1()`/`max_h` on the graph below // has nothing to grow into if the card itself still @@ -1584,18 +1589,12 @@ impl Player { .child( div() .id("eq-card-rows") - // Shrinkable below its content, which is what - // makes the cap above a scroll rather than a - // clip; the rows themselves keep their heights. - .min_h(px(0.)) - // Maximized: stretch to the room the card - // above now claims, so the graph's own - // `flex_1` (above) has the leftover space to - // grow into instead of the card just hugging - // its content and leaving none. + // A non-maximized card exposes the body's full + // natural height to its parent scroll surface; + // maximized fills the claimed card room so the + // graph can consume only the leftover height. + .when(!graph_maximized, |d| d.flex_none()) .when(graph_maximized, |d| d.flex_1()) - .overflow_y_scroll() - .track_scroll(&self.eq_scroll) .flex() .flex_col() .gap(px(2.))