From 7d1dd546804fac0c07ad97bb50305658930646b0 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 23:41:02 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20style(app):=20the=20keys=20list?= =?UTF-8?q?=20leaves=20the=20tab=20strip=20and=20the=20dock=20stops=20ring?= =?UTF-8?q?ing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The strip is the SOURCES/CLIP pair again -- the keys list keeps its home in the dock body, under its own KEYS head, where '?' and the ledger's 'keys ?' ghost put it (user: "remove keys section from here since we also have it next to ledger"). The dock's focus ring is no longer painted: its border stays in flow and transparent in every state, so keyboard focus is untouched and the white box around the library on a click is gone. --- crates/app/src/tests/layout.rs | 47 ++++++++++++++++++++++-------- crates/app/src/ui/dock_stance.rs | 50 +++++++++++++++++--------------- 2 files changed, 62 insertions(+), 35 deletions(-) diff --git a/crates/app/src/tests/layout.rs b/crates/app/src/tests/layout.rs index 3ad17df..f6a4898 100644 --- a/crates/app/src/tests/layout.rs +++ b/crates/app/src/tests/layout.rs @@ -2988,31 +2988,54 @@ fn a_dock_ring_never_moves_what_it_rings() { 4, "a dock ring lost its at-rest transparent border" ); + // ...and the focus ring is not painted at all (user 2026-09-09: + // "clicking through timeline draws a white overlay around the timeline, + // same happens for library section too"). Keyboard focus is unchanged -- + // only the paint is gone -- so no dock surface may reach for the focus + // stroke or for `ink1` on a focused border. + assert!( + !dock.contains("STROKE_FOCUS"), + "a dock surface paints the focus ring again" + ); + assert!( + !dock.contains("is_focused(window)"), + "a dock surface reads focus for paint again" + ); + assert!( + dock.contains(".track_focus(&player.focus_dock)") + && dock.contains(".track_focus(&player.focus_inspector)"), + "dropping the ring's paint took the surface's keyboard focus with it" + ); } -/// DESIGN §9 as amended 2026-09-09: the keys list is the dock's third tab, -/// not a plate over the bench. The overlay the user asked about ("clicking -/// them opens a menu ... probably location problem") is gone with its scrim, -/// the tab strip lists all three tabs, and the rows still come off -/// `keys_rows` with the refused ones greyed rather than hidden (§8). +/// DESIGN §9 as amended 2026-09-09: the keys list lives in the dock BODY, +/// not a plate over the bench and not a tab of its own (user: "remove keys +/// section from here since we also have it next to ledger"). The strip is +/// the SOURCES/CLIP pair; the list rides `keys_open` under a KEYS section +/// head, and the rows still come off `keys_rows` with the refused ones +/// greyed rather than hidden (§8). #[test] -fn the_keys_list_is_a_dock_tab_and_the_plate_is_gone() { +fn the_keys_list_is_dock_body_state_not_a_tab() { let stance = src_text("ui/stance.rs"); assert!( !stance.contains("keys_overlay") && !stance.contains("stance-keys-overlay"), "the keys plate is still mounted over the bench" ); let dock = src_text("ui/dock_stance.rs"); - for (id, label) in [ - ("dock-tab-src", "SOURCES"), - ("dock-tab-clip", "CLIP"), - ("dock-tab-keys", "KEYS"), - ] { + for (id, label) in [("dock-tab-src", "SOURCES"), ("dock-tab-clip", "CLIP")] { assert!( dock.contains(&format!("dock_tab(\"{id}\", \"{label}\"")), "the dock's tab strip lost {label}" ); } + assert!( + !dock.contains("dock-tab-keys"), + "KEYS is still a tab in the strip" + ); + assert!( + dock[dock.find("fn keys_tab(").unwrap()..].contains("section_head(\"KEYS\")"), + "the keys list draws no KEYS head in the dock body" + ); assert!( dock.contains("fn keys_tab(") && dock.contains("keys_rows()"), "the KEYS tab draws something other than the action registry" @@ -3023,7 +3046,7 @@ fn the_keys_list_is_a_dock_tab_and_the_plate_is_gone() { ); assert!( dock[dock.find("fn keys_tab(").unwrap()..].contains(".overflow_y_scroll()"), - "the KEYS tab does not scroll like its neighbours" + "the keys list does not scroll like its neighbours" ); // The Sources filter box belongs to Sources: it is built inside // `sources_tab`, never in the shared frame `render` draws. diff --git a/crates/app/src/ui/dock_stance.rs b/crates/app/src/ui/dock_stance.rs index b44e589..a95c0dc 100644 --- a/crates/app/src/ui/dock_stance.rs +++ b/crates/app/src/ui/dock_stance.rs @@ -196,15 +196,13 @@ fn dock_tab( .when(active, |d| d.border_t_1().border_color(rgb(INK1()))) .cursor_pointer() .on_click(cx.listener(move |this, _: &ClickEvent, _, cx| { - // KEYS is a *look*, not a place the room reopens in: it rides - // `keys_open` and is never written to the dock-tab file, so the - // pair underneath it (`dock_src_active`) is still what a press on - // KEYS comes back to. - this.keys_open = label_text == "KEYS"; - if !this.keys_open { - this.dock_src_active = label_text == "SOURCES"; - save(this.dock_src_active); - } + // The keys list is body state, not a tab (user 2026-09-09: + // "remove keys section from here since we also have it next to + // ledger") -- picking either tab is also the way out of it, and + // the pair itself (`dock_src_active`) is what the file keeps. + this.keys_open = false; + this.dock_src_active = label_text == "SOURCES"; + save(this.dock_src_active); cx.notify(); })) .tooltip(crate::ui::widgets::tip_hover(&format!("Show {}", label_text.to_lowercase()), "", None)) @@ -912,8 +910,11 @@ fn subtitle_tab_rows(player: &Player, cx: &mut Context) -> (usize, Vec) -> impl IntoElement { - let focused = player.focus_dock.is_focused(window); +fn sources_tab( + player: &Player, + _window: &mut Window, + cx: &mut Context, +) -> impl IntoElement { let text_tab = player.library_tab == LibraryTab::Text; // Text has no per-stream `Row` to fill -- its rows are subtitle tracks // grouped by source ([`subtitle_tab_rows`]), not `library_rows`' files -- @@ -986,11 +987,12 @@ fn sources_tab(player: &Player, window: &mut Window, cx: &mut Context) - .on_key_down(cx.listener(move |this, event: &KeyDownEvent, window, cx| { cycle_on_key_down(Surface::Dock)(this, event, window, cx) })) + // The focus ring is not painted (user 2026-09-09: "clicking through + // timeline draws a white overlay around the timeline, same happens + // for library section too"). The border stays in flow, transparent in + // every state, so keyboard focus still moves and nothing shifts. .border_1() - .border_color(match focused { - true => rgb(STROKE_FOCUS()).into(), - false => gpui::transparent_black(), - }) + .border_color(gpui::transparent_black()) .flex_1() .min_h(px(0.)) .flex() @@ -1280,10 +1282,9 @@ fn clip_tab( player: &Player, width: f32, window_size: Size, - window: &mut Window, + _window: &mut Window, cx: &mut Context, ) -> impl IntoElement { - let focused = player.focus_inspector.is_focused(window); // The room actually given here, not the window's: `eq_card_w`/ // `card_max_w` are asked "how wide may I draw" and answered with the // *whole viewport's* width when handed `window_size` verbatim -- but this @@ -1301,11 +1302,12 @@ fn clip_tab( .on_key_down(cx.listener(move |this, event: &KeyDownEvent, window, cx| { cycle_on_key_down(Surface::Inspector)(this, event, window, cx) })) + // The focus ring is not painted (user 2026-09-09: "clicking through + // timeline draws a white overlay around the timeline, same happens + // for library section too"). The border stays in flow, transparent in + // every state, so keyboard focus still moves and nothing shifts. .border_1() - .border_color(match focused { - true => rgb(STROKE_FOCUS()).into(), - false => gpui::transparent_black(), - }) + .border_color(gpui::transparent_black()) .flex_1() .min_h(px(0.)) .flex() @@ -1482,6 +1484,9 @@ fn keys_tab(player: &Player) -> impl IntoElement { .gap(px(3.)) .p(px(8.)) .overflow_y_scroll() + // The list no longer wears a tab, so it says its own name the way + // every other dock body section does -- MEDIA / IMPORT's head. + .child(section_head("KEYS")) .children(keys_rows().into_iter().map(|row| match row { KeyRow::Head(category) => div() .flex_none() @@ -1543,8 +1548,7 @@ pub(crate) fn render( .border_b_1() .border_color(rgb(DARK_HAIRLINE())) .child(dock_tab("dock-tab-src", "SOURCES", src_active, cx)) - .child(dock_tab("dock-tab-clip", "CLIP", !src_active && !keys, cx)) - .child(dock_tab("dock-tab-keys", "KEYS", keys, cx)), + .child(dock_tab("dock-tab-clip", "CLIP", !src_active && !keys, cx)), ) .child(match (keys, src_active) { (true, _) => keys_tab(player).into_any_element(),