From 7d190a8298d7c68bde92b544dfaadb7799b0e35e Mon Sep 17 00:00:00 2001 From: thomas Date: Sat, 25 Jul 2026 10:12:52 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix(windows):=20restore=20the=20=E2=8B=AF?= =?UTF-8?q?=20menu's=20native=20window-control=20rhythm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The de3896c chrome redesign moved the right-corner chrome into `window_chrome()` and reset its non-macOS right padding to `pr_3` (12px), silently reverting the `pr_1` fix from 9b1c7bf. That put the "⋯" glyph centre ~45px from the minimise glyph — visibly adrift from the native window controls, which sit on a 34px rhythm. Restore `pr_1` (4px) so the "⋯" centre lands ~37px out, reading as part of the same row with just enough slack not to be mistaken for a fourth window control. macOS is unaffected (controls are on the left; the content-inset padding still holds). Co-Authored-By: Claude Opus 4.8 (1M context) --- src/ui/tab_strip.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/ui/tab_strip.rs b/src/ui/tab_strip.rs index fce0cc50..304e2856 100644 --- a/src/ui/tab_strip.rs +++ b/src/ui/tab_strip.rs @@ -215,9 +215,14 @@ impl Tty7App { // *glyph* there instead of its 30px hit box. .pr(px(crate::ui::app::CONTENT_INSET - crate::ui::app::TILE_PAD)) // On Windows/Linux the window controls (─ ▢ ✕) sit on the right, right - // where the "⋯" lands; give it extra breathing room there so it reads - // as a menu affordance, not a fourth window control. - .when(!cfg!(target_os = "macos"), |this| this.pr_3()) + // where the "⋯" lands, so its inset has to match *their* rhythm rather + // than add breathing room: the 34px control tiles put consecutive glyph + // centres 34px apart, and the "⋯" centre sits `16 + pr + 17` from the + // minimise glyph. `pr_1` (4px) lands it at ~37px — reading as part of + // the same row, with just enough slack to not be mistaken for a fourth + // window control. `pr_3` (12px) put it at ~45px, visibly adrift from the + // group (this is where the de3896c chrome redesign reset it — see 9b1c7bf). + .when(!cfg!(target_os = "macos"), |this| this.pr_1()) .child( div().occlude().flex_shrink_0().child( chrome_tile( From a00abe1c0927a53cf3b158da25de4da2d32e8a3c Mon Sep 17 00:00:00 2001 From: thomas Date: Sat, 25 Jul 2026 10:12:52 +0800 Subject: [PATCH 2/3] fix(windows): un-swallow the sidebar collapse/new-tab buttons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The rail's control row is a `WindowControlArea::Drag` so the window can be dragged by it. On Windows that maps to HTCAPTION, so the OS claims clicks as window-drags before GPUI hit-tests — the "+" and collapse tiles never fired their `on_click`, and collapsing the sidebar did nothing. (Fine on macOS, where titlebar dragging doesn't gate child hit-testing, so it looked correct there.) Wrap both tiles in an `occlude()` div — a BlockMouse hitbox that stops hit-testing on the button — exactly as the title-strip chrome tiles already do. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/ui/tab_sidebar.rs | 54 ++++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 21 deletions(-) diff --git a/src/ui/tab_sidebar.rs b/src/ui/tab_sidebar.rs index d9c1e960..425943c9 100644 --- a/src/ui/tab_sidebar.rs +++ b/src/ui/tab_sidebar.rs @@ -755,36 +755,48 @@ impl Tty7App { .gap(px(2.)) // Glyph, not hit box, on the content edge — see `TILE_PAD`. .pr(px(crate::ui::app::CONTENT_INSET - crate::ui::app::TILE_PAD)) + // Both tiles are wrapped in an `occlude()` div, exactly like the + // title-strip chrome. This row is a `WindowControlArea::Drag` (set + // below), which on Windows maps to HTCAPTION — the OS claims the click + // as a window-drag before gpui ever hit-tests, so a bare button never + // fires its `on_click`. `occlude()` gives each a BlockMouse hitbox so + // hit-testing stops on the button. (No-op on macOS, where titlebar + // dragging doesn't gate child hit-testing — which is why this worked + // there and silently did nothing on Windows.) .child( - self.attach_new_tab_menu( - // `chrome_tile`, not `ghost()`: this "+" sits beside the - // collapse tile and the title bar's own "+", and ghost's - // hover is a heavier, differently-derived grey. + div().occlude().flex_shrink_0().child( + self.attach_new_tab_menu( + // `chrome_tile`, not `ghost()`: this "+" sits beside the + // collapse tile and the title bar's own "+", and ghost's + // hover is a heavier, differently-derived grey. + crate::ui::tab_strip::chrome_tile( + Button::new("sidebar-add").icon(Icon::new(IconName::Plus).size(px(18.))), + false, + cx, + ) + .xsmall() + .w(px(32.)) + .h(px(32.)) + .rounded_lg(), + cx, + ), + ), + ) + .child( + div().occlude().flex_shrink_0().child( crate::ui::tab_strip::chrome_tile( - Button::new("sidebar-add").icon(Icon::new(IconName::Plus).size(px(18.))), + Button::new("sidebar-collapse") + .icon(Icon::empty().path("icons/panel-left.svg").size(px(18.))), false, cx, ) .xsmall() .w(px(32.)) .h(px(32.)) - .rounded_lg(), - cx, + .rounded_lg() + .tooltip("Hide Sidebar") + .on_click(cx.listener(|this, _, _window, cx| this.toggle_left_panel(cx))), ), - ) - .child( - crate::ui::tab_strip::chrome_tile( - Button::new("sidebar-collapse") - .icon(Icon::empty().path("icons/panel-left.svg").size(px(18.))), - false, - cx, - ) - .xsmall() - .w(px(32.)) - .h(px(32.)) - .rounded_lg() - .tooltip("Hide Sidebar") - .on_click(cx.listener(|this, _, _window, cx| this.toggle_left_panel(cx))), ); // Borderless "Search tabs…" that sits directly on the sunk surface: a // leading magnifier + an appearance-less input, no box and no divider From ace2b416ac65dbe344f919c0d797653d7ece76f5 Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Sat, 25 Jul 2026 10:30:13 +0800 Subject: [PATCH 3/3] style: rustfmt the re-nested sidebar add button The occlude() wrapper pushed the chrome_tile call one level deeper, past rustfmt's width for the single-line Button builder. --- src/ui/tab_sidebar.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ui/tab_sidebar.rs b/src/ui/tab_sidebar.rs index 425943c9..4f39ff5a 100644 --- a/src/ui/tab_sidebar.rs +++ b/src/ui/tab_sidebar.rs @@ -770,7 +770,8 @@ impl Tty7App { // collapse tile and the title bar's own "+", and ghost's // hover is a heavier, differently-derived grey. crate::ui::tab_strip::chrome_tile( - Button::new("sidebar-add").icon(Icon::new(IconName::Plus).size(px(18.))), + Button::new("sidebar-add") + .icon(Icon::new(IconName::Plus).size(px(18.))), false, cx, )