Repository navigation
Show active search filters as picker badges - #440
Merged
Merged
Conversation
Find in Files and the file picker now label widened scopes (+hidden, +ignored, +symlinks, literal) on the footer divider, so toggling them gives immediate feedback even before a query is typed. Adds PickerOptions.badges and UpdatePickerBadges to host API 0.22.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Pressing
Alt-h,Alt-iorCtrl-ein Find in Files gave no visible feedback before a query was typed: the status read "Type to search" and the active flags were only appended once there were results. Even then they were one grey word in2 matches [regex hidden preview], mixed with flags that never matter (regex,preview). The file picker did showhidden ignoredafterCtrl-e, but it replaced the result count to do it.What
Active filters now appear as bold, warning-coloured badges at the start of the footer divider, independent of the status at the end:
+hidden,+ignored,+symlinks, andliteralwhen regex is off. With default settings the divider stays clean.[…]flag list.+hidden +ignoredafterCtrl-eand keeps its5/5count.PickerOptions.badgesandUpdatePickerBadges(id, badges), added to the pending host API0.22.0with the schema, change manifest anddocs/PLUGIN_API.md.How to Test
Type to search.Alt-h, thenAlt-i:+hidden, then+hidden +ignoredappear before typing anything.Alt-raddsliteral;Ctrl-eclears hidden and ignored.Ctrl-p) and pressCtrl-e:+hidden +ignoredappears on the left with the count still on the right;Ctrl-eagain removes it.Automated:
cargo test --lib filter_badges,cargo test --lib project_search,cargo test --lib file_picker.