Skip to content

Add filter_format field for Column in pickers #13912

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

peret
Copy link
Contributor

@peret peret commented Jul 8, 2025

Add the option to provide a formatting function for the filtering of picker columns that is separate from the formatting function for displaying it in the view.
Use this new option for the "path" column of the workspace diagnostics picker, so that we are filtering on the full (relative) file path, instead of the truncated value.

Fixes #13608

Add the option to provide a formatting function for the filtering of
picker columns that is separate from the formatting function for
displaying it in the view.
Use this new option for the "path" column of the workspace diagnostics
picker, so that we are filtering on the full (relative) file path,
instead of the truncated value.

Fixes helix-editor#13608
Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before #9647 you could override the sort and filter text in pickers and we explicitly removed that. For a column with a path that is truncated really aggressively like the workspace diagnostics picker it makes some sense since you can guess what the truncated parts might be and try to filter on those. For other columns it doesn't really make sense: you can't always guess what's truncated. And as a consequence if you're filtering on text that is different than what is showed in the column then the highlighting of matching text can't work.

For #13608 we should change the way that paths are truncated so it's not so aggressive. The downside is that the picker is already very cramped so it takes up a lot of space.

@peret
Copy link
Contributor Author

peret commented Jul 8, 2025

For #13608 we should change the way that paths are truncated so it's not so aggressive. The downside is that the picker is already very cramped so it takes up a lot of space.

Thanks for clarifying, I'll look into that 👍 As you point out, we don't have too much space for the path-column, so I'm wondering what would be a good way to truncate the path. Here's what I'm thinking right now: Have a character limit X for the path; last component (file name) is always displayed in full, the remaining characters are distributed equally to the remaining path components (at least one char per component).

Question is how to determine the character limit X. Constant value would be easiest, ofc. Is there a way to dynamically calculate a value that works? Is there maybe even an example how this is handled somewhere else in the code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Column filtering uses shortened presentation and not the underlying column value
2 participants