Files
Parker Loflin bb5e6dfd07 project_panel: Show the empty-name error for whitespace-only names (#67125)
## Summary

#38744 made the empty-name check `filename.is_empty()` inside `if
!filename.is_empty()`, so it never ran. Names made only of whitespace
got the leading or trailing whitespace warning instead of "File or
directory name cannot be empty." The check is now
`filename.trim().is_empty()`.

## Testing

- `test_whitespace_only_filename_is_reported_as_empty` enters spaces as
a new file's name and checks for the error. It fails without the fix.
- `cargo test -p project_panel` and `./script/clippy` pass.

## 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).
- [x] Tests cover the new or changed behavior.

Release Notes:

- Fixed the project panel showing the wrong message for whitespace-only
file names

---------

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
2026-11-18 05:53:08 +00:00
..