From e5908a945ee7edc33d7cc510e1f9eaa87bccabb7 Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Thu, 24 Sep 2026 20:24:40 +0800 Subject: [PATCH] fix(panel): start Info and Changes flush under the tab row Their first line is text centred in a 28px row, so the extra 8px step put it visibly lower than the Files tab's search well. Only Files keeps it. --- src/ui/right_panel.rs | 11 ++++++++++- src/ui/scm/panel.rs | 9 +++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/ui/right_panel.rs b/src/ui/right_panel.rs index 30e31c14..3488fc47 100644 --- a/src/ui/right_panel.rs +++ b/src/ui/right_panel.rs @@ -589,7 +589,16 @@ impl Tty7App { cx, )) })) - .children(cfg!(target_os = "macos").then(|| div().flex_none().h(px(8.)))) + // Only the Files tab steps down 8px. Its first row is a filled + // search well whose top edge is the first thing you see, so it + // wants air under the tab row. Info and Source Control open on + // bare text centred in a 28px row, which already sits ~7px + // under the row's top; adding 8 more put their first line a + // visible step lower than the Files well beside them. + .children( + (cfg!(target_os = "macos") && tab == RightPanelTab::Files) + .then(|| div().flex_none().h(px(8.))), + ) .child(body) .children(self.sftp_transfers_footer(cx)) .child(handle) diff --git a/src/ui/scm/panel.rs b/src/ui/scm/panel.rs index f389cc16..da484908 100644 --- a/src/ui/scm/panel.rs +++ b/src/ui/scm/panel.rs @@ -118,10 +118,11 @@ const COMMIT_RADIUS: gpui::Pixels = px(6.); /// one unit: 8px under the tab row, 10px between its three parts and 14px /// before the first group. /// -/// On macOS the panel already puts 8px between its tab row and every tab's -/// body (`render_right_panel`), so the block adds nothing of its own there; -/// adding it anyway put the branch 16px down while Info and Files started at -/// 8. Elsewhere the tab row is inside the body and the 8 is this block's. +/// On macOS the block starts flush under the tab row, the way Info does: the +/// branch is text centred in a 28px row, so it already sits ~7px down, level +/// with the top edge of the Files tab's search well (which does get an 8px +/// step, see `render_right_panel`). Elsewhere the tab row is inside the body +/// and the 8 is this block's. const PINNED_TOP: f32 = if cfg!(target_os = "macos") { 0. } else { 8. }; const PINNED_GAP: f32 = 10.; const PINNED_BOTTOM: f32 = 14.;