fix(web): keep selected search filters visible

Merged
DI
1mo ago
+82-3

Fixes #131

Typing into the language or repository filter hid selected entries that did not match the filter text. Keep those selections visible at the top so users can see and clear every active filter, while filtering the remaining entries normally.

Selected entries appear only once when they also match the search. Sorting now copies the list instead of mutating the caller's entries.

Validation completed before opening this PR:


[!NOTE]
Low Risk
Localized UI change to search filter list rendering with regression tests; no auth, API, or data-path impact.

Overview
Fixes code search filter panels so active language and repository selections stay visible while you type in the “filter options” box.

When a search string is present, selected entries are always listed first (even if they don’t match), unselected options are still fuzzy-filtered, and a selection that also matches appears only once. Sorting now runs on a copy of the list so the parent’s entries array isn’t reordered in place. Adds Vitest coverage for these cases and a changelog note.

Reviewed by Cursor Bugbot for commit adc048206b4b65c03b1239c9d5f2506ace151d8f. Bugbot is set up for automated code reviews on this repo. Configure here.


Summary by cubic

Fixes #131 by keeping selected language and repository filters visible at the top while typing, so active filters can always be seen and cleared.

  • Selected entries stay pinned above search matches and appear only once when they also match or when no other entries match.
  • Sorting copies the entries list instead of mutating the caller's array.
  • Adds Vitest coverage for pinned selections and a changelog entry.

Summary by CodeRabbit

  • Bug Fixes
    • Selected language and repository filters remain visible while searching available options, even when they don’t match the search text.
    • Selected filters appear before matching unselected options, and selected options that match the search are shown only once.
    • When a search has no matching options, selected filters remain visible while unselected options are hidden.