file_finder: Keep filenames visible for long paths (#62839)
# Objective
Prevent long worktree and directory paths from shrinking filenames until
they become difficult to read in file finder results.
## Solution
Give the filename label non-shrinking flex sizing, and let the path
label use the remaining space. When the path does not fit, it truncates
from the beginning so the directories nearest the file remain visible.
## Testing
- Ran `cargo fmt --all --check`.
- Ran `cargo test -p file_finder --lib` — 79 tests passed.
- Ran `./script/clippy -p file_finder`.
- To verify manually, open a project with a long root name, search for
files, and resize the file finder. Confirm that filenames remain visible
while paths truncate from the beginning.
## Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
---
Release Notes:
- Fixed long project paths obscuring file names in the file finder.
1a332533aaMaría Craig committed on 8/19/2026, 9:23:57 AM· committed by GitHubparent7a7c3e1