From f77ad89b8b698ccee9d30bcf20e95b18fbc4e30b Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Sat, 8 Aug 2026 14:12:51 +0700 Subject: [PATCH] fix(chrome): stop hovering a tile into looking selected MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `chrome_tile_variant_for` passed `sidebar_accent` to both `hover` and `active`, and `sidebar_accent` *is* the sidebar surface's selected step. So a hovered tile wore the exact fill of a selected one: with the right panel open, pointing at Changes made it and the current Files tab read as two current tabs, told apart only by a shade of glyph. The palette already derives the step below it — 1.18 from the surface where selected is 1.30, with a test holding them apart — and hover now takes it. A selected button never renders the hover style, so the selected tiles are untouched; every other tile simply stops overstating a pointer. --- src/ui/tab_strip.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/ui/tab_strip.rs b/src/ui/tab_strip.rs index 596093fe..dbae4687 100644 --- a/src/ui/tab_strip.rs +++ b/src/ui/tab_strip.rs @@ -131,10 +131,9 @@ impl Render for DragTab { } } -/// Says what the workspace head does, with its shortcut. The name alone was -/// redundant — it is already the button's label. -/// What a chrome tile says on hover: the action, then the chord that runs it -/// when there is one. +/// What a chrome tile says on hover: what it does, then the chord that does it. +/// The tile's own name is no use as a tooltip — the workspace head already +/// wears it as its label. fn chord_hint(what: &str, action: &str, cx: &gpui::App) -> SharedString { match crate::ui::home::key_hint(action, cx) { Some(keys) => SharedString::from(format!("{what} {keys}")), @@ -154,7 +153,12 @@ pub(crate) fn chrome_tile_variant_for(selected: bool, cx: &gpui::App) -> ButtonC } else { cx.theme().sidebar_foreground }) - .hover(cx.theme().sidebar_accent) + // `sidebar_accent` is the surface's *selected* step, and it was handed + // to hover as well — so a hovered tile wore the fill of a selected one + // and, with the right panel open, two tiles read as current at once. + // Hover takes the step the palette derives for it. (A selected button + // never renders the hover style, so this only reaches the rest.) + .hover(gpui::rgb(cx.global::().sidebar.hover).into()) .active(cx.theme().sidebar_accent) }