Repository navigation
fix: respect fuzzy filter when selecting/deselecting all in InteractiveMultiselect - #781
Merged
MarvinJWendt merged 3 commits intoOct 10, 2026
Merged
Conversation
When a fuzzy filter is active, pressing Right Arrow (select all) iterated over p.Options instead of p.fuzzySearchMatches, selecting every option regardless of the current filter. Similarly, Left Arrow (deselect all) always cleared the entire selection. Fix both handlers to iterate p.fuzzySearchMatches. When no filter is active, fuzzySearchMatches equals Options, so the unfiltered behaviour is preserved. When a filter is active, only the visible subset is selected or deselected. Add three tests: - Show_SelectAll: right arrow selects all when no filter active - Show_DeselectAll: right then left returns to empty selection - Show_SelectAllWithFilter: right arrow with 'a' filter selects only 'a' Fixes pterm#761
Contributor
Author
|
The CI failures are pre-existing flaky tests unrelated to this change:
My changes only touch These failures also appear in other unrelated PRs in this repo — they are not introduced by this PR. |
# Conflicts: # interactive_multiselect_printer_test.go
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #781 +/- ##
=======================================
Coverage 92.21% 92.22%
=======================================
Files 66 66
Lines 4318 4321 +3
=======================================
+ Hits 3982 3985 +3
Misses 244 244
Partials 92 92 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Problem
When typing a search filter in `InteractiveMultiselectPrinter` and pressing Right Arrow (select all), all options get selected — not just the ones visible in the filtered list.
Repro:
Similarly, Left Arrow (deselect all) always cleared the entire selection regardless of filter.
Fixes #761.
Root cause
Both handlers iterated `p.Options` (all options) instead of `p.fuzzySearchMatches` (the currently visible subset):
Fix
Iterate `p.fuzzySearchMatches` and use the existing `selectOption`/`isSelected` helpers. When no filter is active, `fuzzySearchMatches == Options`, so unfiltered behaviour is unchanged.
Tests
Three new tests:
All existing tests pass.