fix(ui): preserve server-ranked file picker results - #1229
Conversation
📝 WalkthroughWalkthroughA new ChangesFilter list items refactoring with skipFilter predicate
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
There was a problem hiding this comment.
Suggested priority: P2 (includes user-path files (packages/app/src/components/command-palette/command-palette-dialog.tsx, packages/app/src/components/prompt-input/popover-controllers.ts)).
P1/P0 are reserved for maintainer confirmation. Please relabel manually if this is a release blocker, security issue, data-loss risk, or updater/runtime failure.
There was a problem hiding this comment.
Code Review
This pull request extracts the filtering logic from useFilteredList into a separate helper function filterListItems and introduces a new skipFilter option. This option allows certain items to bypass the filtering process and remain in the results. The new functionality is integrated into DialogSelectFile, createPopoverControllers, and LineCommentEditor, and is accompanied by a new unit test. There are no review comments to address.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/ui/test/use-filtered-list.test.ts (1)
5-18: ⚡ Quick winAdd one mixed-result test to lock the append-order contract.
Current coverage proves skipped entries survive, but it does not verify behavior when both fuzzy matches and skipped items are present together. A small second test here would prevent regressions in the
filtered + skippedmerge path.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/ui/test/use-filtered-list.test.ts` around lines 5 - 18, Add a new unit test in packages/ui/test/use-filtered-list.test.ts that verifies the merge order when both fuzzy-matched items and skipped (serverRanked) items are present: using the existing filterListItems helper and Item type, provide an input list containing a fuzzy-matchable item (e.g., {id: "command", title: "Open Settings"}) and a serverRanked item (e.g., {id: "file", title: "src/..", serverRanked: true}), call filterListItems with a query that matches the first item (e.g., "Open") and assert the returned ids preserve the contract that filtered/fuzzy results come first and skipped serverRanked items are appended (e.g., expect(["command","file"])).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/ui/test/use-filtered-list.test.ts`:
- Around line 5-18: Add a new unit test in
packages/ui/test/use-filtered-list.test.ts that verifies the merge order when
both fuzzy-matched items and skipped (serverRanked) items are present: using the
existing filterListItems helper and Item type, provide an input list containing
a fuzzy-matchable item (e.g., {id: "command", title: "Open Settings"}) and a
serverRanked item (e.g., {id: "file", title: "src/..", serverRanked: true}),
call filterListItems with a query that matches the first item (e.g., "Open") and
assert the returned ids preserve the contract that filtered/fuzzy results come
first and skipped serverRanked items are appended (e.g.,
expect(["command","file"])).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 9a05bc9d-754f-454b-9010-f1ecfef608d0
📒 Files selected for processing (6)
packages/app/src/components/command-palette/command-palette-dialog.tsxpackages/app/src/components/prompt-input/popover-controllers.tspackages/ui/src/components/line-comment.tsxpackages/ui/src/hooks/filter-list-items.tspackages/ui/src/hooks/use-filtered-list.tsxpackages/ui/test/use-filtered-list.test.ts
Summary
Preserve server-ranked file search results in PawWork pickers by allowing file rows to opt out of the local fuzzy refilter step.
This PR ports the UI hunk from upstream anomalyco/opencode#31366 only. It adds a narrow
skipFilterpath to the shared filtered-list hook and enables it for command palette file rows, prompt@server results, and line-comment mentions.Why
File search results are already ranked by the server-side search path. The UI then ran
fuzzysortagain with the same user query, which could hide valid server-returned files when their display text did not locally fuzzymatch the query.Related Issue
Upstream anomalyco/opencode#31366. No PawWork issue exists for this small upstream-value port.
Human Review Status
Pending
Review Focus
Please check that
skipFilteris only enabled for server-ranked file results, while ordinary command/session/local list filtering still uses the existing fuzzy behavior.Risk Notes
Low UI behavior risk. File picker rows can remain visible even when the local display text does not fuzzymatch, but ordinary local results still filter. No platform, packaging, permissions, docs, dependencies, generated files, or persistence surfaces were changed.
How To Verify
Screenshots or Recordings
Ran the existing command palette snap target and inspected the generated light/dark grid at
docs/design/preview/screenshots/command-palette-header.png. The picker opens, renders list content, and has no blank or overlapping state; the fixture's bottom server-unreachable toast is unrelated to this filtering change.Checklist
bug,enhancement,task,documentation. Type labels are author-added; the labeler bot does NOT assign them. Add the label in the GitHub UI, then tick this.app,ui,platform,harness,ci. The labeler bot assigns these on PR open based on changed paths. Confirm the bot's choice (or override if wrong), then tick this.P0,P1,P2,P3. The priority-triage bot suggests one on PR open. Confirm or override, then tick this.Pending,Approved by @<reviewer>, orNot required: <reason>(default isPending; "not required" is restricted to bot-authored low-risk PRs).dev, and my PR title and commit messages use Conventional Commits in English.