git panel: Truncate file paths from the left (#43462)

ozzy , Danilo Leal , and Danilo Leal created

https://github.com/user-attachments/assets/758e1ec9-6c34-4e13-b605-cf00c18ca16f

Release Notes:

- Improved: Git panel now truncates long file paths from the left,
showing "…path/filename" when space is limited, keeping filenames always
visible.

@cole-miller @mattermill

---------

Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>

Change summary

crates/git_ui/src/git_panel.rs               | 2 +-
crates/ui/src/components/label/label_like.rs | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

Detailed changes

crates/git_ui/src/git_panel.rs 🔗

@@ -5203,7 +5203,7 @@ impl GitPanel {
 
                 this.child(
                     self.entry_label(path_name, path_color)
-                        .truncate()
+                        .truncate_start()
                         .when(strikethrough, Label::strikethrough),
                 )
             })

crates/ui/src/components/label/label_like.rs 🔗

@@ -56,7 +56,7 @@ pub trait LabelCommon {
     /// Sets the alpha property of the label, overwriting the alpha value of the color.
     fn alpha(self, alpha: f32) -> Self;
 
-    /// Truncates overflowing text with an ellipsis (`…`) if needed.
+    /// Truncates overflowing text with an ellipsis (`…`) at the end if needed.
     fn truncate(self) -> Self;
 
     /// Sets the label to render as a single line.