From fa550de922f3fab7ba4668f3e976a80e576f8528 Mon Sep 17 00:00:00 2001 From: Ruangyot Nanchiang Date: Tue, 21 Oct 2025 23:42:43 +0700 Subject: [PATCH] Fix Git UI truncation for long branch names (#40598) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #40524 Release Notes: - Fixed branch names not truncating properly in git branch picker. Please review if you have time. PS. I’m not fully sure if this completely fixes the issue, but I’ve tested it on my local build and it seems to work fine. Before Fix: 502782621-91ac0578-9f55-4fb3-b0da-49a49e862a33 After Fix: FixedRound2 --- crates/git_ui/src/branch_picker.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/git_ui/src/branch_picker.rs b/crates/git_ui/src/branch_picker.rs index 7a046266ac..cf8b03d1fd 100644 --- a/crates/git_ui/src/branch_picker.rs +++ b/crates/git_ui/src/branch_picker.rs @@ -494,8 +494,12 @@ impl PickerDelegate for BranchListDelegate { ) .into_any_element() } else { - HighlightedLabel::new(entry.branch.name().to_owned(), entry.positions.clone()) - .truncate() + h_flex() + .max_w_48() + .child( + HighlightedLabel::new(entry.branch.name().to_owned(), entry.positions.clone()) + .truncate(), + ) .into_any_element() };