Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shorten overflowing paths in file finder #25303

Merged
merged 8 commits into from
Feb 21, 2025

Conversation

cole-miller
Copy link
Contributor

@cole-miller cole-miller commented Feb 21, 2025

Closes #7711

This PR changes the file finder to shorten the path portion of each match by replacing a segment with ..., if it would otherwise overflow horizontally. Details:

  • The overflow calculation is based on a crude linear width estimate for ASCII text at the current em width. No elision is done for non-ASCII paths.
  • A path component will not be elided if it contains a matching position for the file finder's search, or if it's the first or last component.
  • Elision is only applied when it is successful in shortening the path enough to not overflow.

Release Notes:

  • Improved the appearance of the file finder when long paths are shown by eliding path segments

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Feb 21, 2025
@cole-miller cole-miller marked this pull request as ready for review February 21, 2025 03:43
@cole-miller cole-miller changed the title Cole/file finder long paths again Shorten overflowing paths in file finder Feb 21, 2025
@cole-miller
Copy link
Contributor Author

Before:

Screen.Recording.2025-02-20.at.23.01.26.mov

After:

Screen.Recording.2025-02-20.at.22.59.40.mov

@cole-miller cole-miller merged commit aba89ba into main Feb 21, 2025
15 checks passed
@cole-miller cole-miller deleted the cole/file-finder-long-paths-again branch February 21, 2025 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve layout of file finder modal with very long paths
1 participant