agent_ui: Truncate file path in context completions (#42682)
Closes https://github.com/zed-industries/zed/issues/38753
Followed some prior art here: [a similar calculation
](https://github.com/zed-industries/zed/blob/e80b490ac00bfb5c206d3eb3f5c2dec10e742678/crates/file_finder/src/file_finder.rs#L1105)
in `file_finder.rs`
Release Notes:
- improved visibility of long path names in context completions by
truncating on the left when space is insufficient to render the full
path
Before:
<img width="544" height="251" alt="Screenshot of overflowing file paths"
src="https://github.com/user-attachments/assets/8440710d-3f59-4273-92bb-3db85022b57c"
/>
After:
<img width="544" height="251" alt="Screenshot of truncated file paths"
src="https://github.com/user-attachments/assets/e268ba87-7979-4bc3-8d08-9198b4baea02"
/>
518ea716eeScott Churchley committed on 11/27/2025, 8:26:00 PM· committed by GitHubparent20b5843