git_ui: Fix status entry icons overlapping right-side UI in narrow git panel (#66278)

## 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 <kirill@zed.dev>
This commit is contained in:
Xin ZhaoandKirill Bulatov authored and GitHub committed 2026-11-09 06:33:41 +00:00
1 parent 4023e3c88e
commit 96508041c7
1 file changed
+7 -1
+7 -1
View File
@@ -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);