From 0fd856c507227b4ae8cf817d4251802f81c79f1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 9 Sep 2026 20:59:24 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(app):=20every=20hitmap=20contr?= =?UTF-8?q?ol=20wears=20its=20hover=20plate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The user could not name the band's glyphs. One shape for the whole room -- ` ยท ` from the shared helper -- and a sweep that pairs each `hitmap::` emitter with a `.tooltip(` of its own, so a plate cannot be borrowed from the control next door: counting per function let the empty-dock hint pay for `dock.sort.cycle`, which sat bare under a green gate. --- crates/app/src/tests/cards.rs | 4 +++- crates/app/src/ui/cards.rs | 13 ++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/crates/app/src/tests/cards.rs b/crates/app/src/tests/cards.rs index 83239fb..f028326 100644 --- a/crates/app/src/tests/cards.rs +++ b/crates/app/src/tests/cards.rs @@ -1085,7 +1085,9 @@ fn row_three_wears_the_encode_options_and_the_door_to_the_rest() { // the ink4 line the plan used to be. let seg = cards .find("fn moment_segment(") - .map(|at| &cards[at..at + 1200]) + // Wide enough for the atom's whole chain, plate included -- the + // hover line pushed the ink pair past the old 1200-char window. + .map(|at| &cards[at..at + 1900]) .expect("the segment atom"); assert!(seg.contains("INK3()") && seg.contains("INK4()")); assert!(seg.contains("DARK_RAISED()"), "a segment does not answer hover"); diff --git a/crates/app/src/ui/cards.rs b/crates/app/src/ui/cards.rs index 1f625e3..5a32c5d 100644 --- a/crates/app/src/ui/cards.rs +++ b/crates/app/src/ui/cards.rs @@ -229,6 +229,16 @@ fn moment_segment( on_click: impl Fn(&ClickEvent, &mut Window, &mut App) + 'static, ) -> impl IntoElement { let text: SharedString = text.into(); + let chord: SharedString = chord.into(); + // The segment reads its *value* ("H.264 \u{b7} MP4"); the plate has to say + // what pressing it does. Keyed off the id, so the next segment cannot + // ship without one -- the sweep in `tests::layout` holds it to that. + let name = match id { + "moment-picture" => "Change the picture format", + "moment-sound" => "Change the sound rate", + "moment-encoder" => "Change the encoder seat", + _ => "Open the export settings", + }; let hitmap = hitmap::enabled().then(|| { let label = text.clone(); hitmap::dynamic(move || (format!("card.{id}"), label.to_string()), true) @@ -244,6 +254,7 @@ fn moment_segment( .cursor_pointer() .hover(|s| s.bg(rgb(DARK_RAISED())).text_color(rgb(INK2()))) .on_click(on_click) + .tooltip(crate::ui::widgets::overlay_tip_hover(name, &chord, None)) .children(hitmap.flatten()) .type_style(type_scale::mono( type_scale::CHORD_METADATA_MIN_PX, @@ -251,7 +262,7 @@ fn moment_segment( )) .text_color(rgb(INK3())) .child(text) - .child(div().flex_none().text_color(rgb(INK4())).child(chord.into())) + .child(div().flex_none().text_color(rgb(INK4())).child(chord)) } fn dark_ghost_button(