fix(web): keep selected language filters visible#1377
Open
DivyamTalwar wants to merge 4 commits into
Open
Conversation
Constraint: Existing filter panel sorting already pins selected entries; the fix keeps that behavior while changing only filtered membership. Rejected: Replacing the filter UI or changing Fuse matching | unnecessary scope for issue sourcebot-dev#131. Confidence: high Scope-risk: narrow Directive: Keep selected filter chips visible even when the current filter text does not match their display name. Tested: node .yarn/releases/yarn-4.7.0.cjs workspace @sourcebot/web test 'src/app/(app)/search/components/filterPanel/filter.test.tsx'; node .yarn/releases/yarn-4.7.0.cjs workspace @sourcebot/web lint Not-tested: Full web build.
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
Walkthrough
Selected filter visibility fix
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Constraint: Sourcebot requires every non-doc PR to add an Unreleased changelog entry that links to the PR. Confidence: high Scope-risk: narrow Directive: Keep future changelog entries under the matching Unreleased section and include the real PR link. Tested: Changelog format matched adjacent Unreleased entries. Not-tested: No code tests run for changelog-only commit.
Merge upstream main after sourcebot-dev#1376 changed the same Unreleased changelog block, keeping both release-note entries. Constraint: GitHub reported PR sourcebot-dev#1377 as dirty against current main.\nRejected: Rewriting the open PR branch | Avoids force-pushing an existing review branch.\nConfidence: high\nScope-risk: narrow\nDirective: This merge commit should only resolve the changelog ordering conflict.\nTested: git diff --check\nNot-tested: Targeted regression test rerun follows after the merge commit.
Replace the filter option click container with a native toggle button while preserving selected entries as clearable controls. Constraint: Frontend review found the existing filter row was mouse-only.\nRejected: Adding ARIA to a div | Native button semantics provide keyboard activation and focus behavior with less custom code.\nConfidence: high\nScope-risk: narrow\nDirective: Keep selected disabled entries clearable so users can remove incompatible filters.\nTested: node .yarn/releases/yarn-4.7.0.cjs workspace @sourcebot/web test 'src/app/(app)/search/components/filterPanel/filter.test.tsx'\nTested: node .yarn/releases/yarn-4.7.0.cjs workspace @sourcebot/web exec eslint 'src/app/(app)/search/components/filterPanel/filter.tsx' 'src/app/(app)/search/components/filterPanel/filter.test.tsx' 'src/app/(app)/search/components/filterPanel/entry.tsx'\nTested: git diff --check\nNot-tested: Full web build not rerun for this narrow component accessibility change.
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.
Fixes #131
Problem
Selected language filters disappear when the filter-panel search text does not match their display name. That makes the active search query and the visible filter list disagree.
Root cause
The filter panel ran Fuse over all entries and rendered only matching results, so selected entries were dropped whenever they did not match the current text.
Solution
aria-pressed, so the filter controls are keyboard-accessible and announce selected state.Tests
PowerShellfilter remains visible and pinned while searching forC.node .yarn/releases/yarn-4.7.0.cjs workspace @sourcebot/web test 'src/app/(app)/search/components/filterPanel/filter.test.tsx'node .yarn/releases/yarn-4.7.0.cjs workspace @sourcebot/web exec eslint 'src/app/(app)/search/components/filterPanel/filter.tsx' 'src/app/(app)/search/components/filterPanel/filter.test.tsx' 'src/app/(app)/search/components/filterPanel/entry.tsx'git diff --checkRisk
Low. The change is limited to filter-panel result membership and row semantics. Selected disabled rows remain clearable so users can remove incompatible filters.
Summary by CodeRabbit
Bug Fixes
Tests
Accessibility / UI
aria-pressedand improved disabled/interaction behavior.Documentation