From 96508041c7dbd7a302d2bf754ade77c3af107e8f Mon Sep 17 00:00:00 2001 From: Xin Zhao Date: Mon, 9 Nov 2026 06:33:41 +0000 Subject: [PATCH] git_ui: Fix status entry icons overlapping right-side UI in narrow git panel (#66278) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary When the git panel shrinks and becomes too narrow to contain all the UI elements of a status entry, the file name and path are truncated first, but the icons then overflow and overlap with the right-side UI (diff stats and checkbox). The reason is that although the icons are `flex_none`, they were grouped with the name and path inside a `flex_1` / `min_w_0` container, causing an overflow. This PR splits the icons and path into separate divs, keeping the icon div as `flex_none` to prevent the overflow. ## Testing Left is current, right is after the fix: [屏幕录像_20261029_155224.webm](https://github.com/user-attachments/assets/bd751480-adfd-411e-85b0-e80323b8cdfe) ## Self-review - [x] I've reviewed my diff for quality, security, reliability, and performance. - [x] UI changes follow the [checklist](https://zed.dev/docs/development/ui-checklist). - [ ] Tests cover the new or changed behavior. Release Notes: - Fixed entry icons overlapping diff stats in a narrow Git panel. --------- Co-authored-by: Kirill Bulatov --- crates/git_ui/src/git_panel.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rs index e9bf92c93d0..d00f20dcf64 100644 --- a/crates/git_ui/src/git_panel.rs +++ b/crates/git_ui/src/git_panel.rs @@ -9336,7 +9336,13 @@ impl GitPanel { .bg(base_bg) .hover(|s| s.bg(hover_bg)) .active(|s| s.bg(active_bg)) - .child(name_row) + .child( + h_flex() + .min_w_0() + .flex_1() + .overflow_hidden() + .child(name_row), + ) .when(GitPanelSettings::get_global(cx).diff_stats, |el| { el.when_some(entry.diff_stat, move |this, stat| { let id = format!("diff-stat-{}", id_for_diff_stat);