Skip to content

fix(web): keep selected search filters visible - #1685

Open
dipeshbabu wants to merge 2 commits into
sourcebot-dev:mainfrom
dipeshbabu:dipeshbabu/fix-selected-search-filters-131
Open

dipeshbabu wants to merge 2 commits into
sourcebot-dev:mainfrom
dipeshbabu:dipeshbabu/fix-selected-search-filters-131

Conversation

@dipeshbabu

@dipeshbabu dipeshbabu commented Sep 24, 2026 •

Copy link
Copy Markdown

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 search UI filter-list behavior with regression tests; no auth, API, or search backend changes.

Overview
Fixes code search filter panels (language and repository) so active selections no longer vanish when you type in the panel’s search box.

Selected entries stay pinned at the top of the list even when they don’t match the filter text, so users can still see and clear them. Unselected options are fuzzy-matched as before. If a selected item also matches the search, it renders once (not duplicated). When nothing matches, selected filters still show.

Sorting now runs on a copy of the filtered list ([...filteredEntries]) so the parent entries array is not reordered in place. Vitest coverage was added for these behaviors, and the unreleased changelog notes the fix (#1685).

Reviewed by Cursor Bugbot for commit 82ac4e2. 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.

Written for commit 82ac4e2. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Selected language and repository filters now remain visible while searching available options, even when they don’t match the search text.
    • Matching selected filters appear only once, and the filter list retains its original order data.

@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 71164fe4-ab5c-4c97-80f8-cbac54a1d744

📥 Commits

Reviewing files that changed from the base of the PR and between b493151 and 82ac4e2.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • packages/web/src/app/(app)/search/components/filterPanel/filter.test.tsx
  • packages/web/src/app/(app)/search/components/filterPanel/filter.tsx

Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.


Walkthrough

The search filter now keeps selected entries visible and places them before fuzzy matches. It sorts a copy of the filtered list. Tests cover filtering, entry ordering, click callbacks, duplicate prevention, and preservation of the input array.

Changes

Selected search entries

Layer / File(s) Summary
Selected entries in filtered results
packages/web/src/app/(app)/search/components/filterPanel/filter.tsx, packages/web/src/app/(app)/search/components/filterPanel/filter.test.tsx, CHANGELOG.md
Selected entries remain visible and appear before fuzzy matches for unselected entries. The component sorts a copy of the filtered list. Tests cover visibility, ordering, click callbacks, duplicate prevention, and input-array preservation. The changelog records the fix.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: brendan-kellam

Merge Risk: ⚪ Minimal · up to 82ac4

Selected filters remain visible above search matches; no issue identified here requires resolution before merging.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: keeping selected search filters visible in the web application.
Linked Issues check ✅ Passed Issue #131 requires selected languages to remain visible at the top during filtering. filter.tsx now keeps selected entries, places them first, and applies Fuse search only to unselected entries. Ma…
Out of Scope Changes check ✅ Passed The changes stay within the linked issue scope. The implementation fixes selected filter visibility, the tests verify the behavior and sorting safety, and the changelog records the fix. No unrelated c…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 3 files

Re-trigger cubic

This branch has not been deployed

No deployments
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.

Filtering languages hides already selected langs

1 participant