You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(web): the PR badge shows for "pr 123" searches that list the thread - #44267
Thread search lists a thread for "pr 22889" but hides its pull request badge. Sidebar search and Cmd+K show the matching PR's badge (icon, number, state colour) beside the title when the query matched one of the thread's PRs. Thread search accepts the prefixes "pr", "pull request" and "pull", and a query in double quotes, so "#22889", "pr 22889", "PR #22889", "pull request 22889" and "#22889" all find the thread. Only the first of them shows the badge. In the sidebar, which has no match-hint line, the row then gives no sign of why it matched.
Steps (Linux, no sign-in):
Link a PR to a thread (ask the agent to link_pull_request a public PR URL, or open a thread on a branch with a PR).
Type #<number> in the sidebar search: the row shows the PR badge.
Type pr <number> or PR #<number>: the same row is listed but the badge is gone. Same in Cmd+K.
Cause
pullRequestMatchesSearchQuery in apps/web/src/components/Sidebar.logic.ts splits the query on spaces and requires every token as a substring of "#22889 owner/repo#22889 <title>". The token "pr", "request" or a quote character is never in that text. Ranking uses scoreThreadSearch, whose threadFieldQuery strips the prefixes and quotes, so the list and the badge disagree. The badge matcher dates from #14658; the prefix stripping came later with the thread search work and the badge was not moved over.
Change
The badge is matched with scoreThreadSearch on a subject that holds only the thread's pull requests, so it shows exactly when the PR fields match the query as search reads it. One file, 16 lines; the normalizeSearchText import goes.
Behaviour note: a short repo-name word (for example "widgets") used to light the badge by substring. References now count only as search counts them (the whole query, 8 or more characters), which matches when the thread is listed at all.
Scope
Small fix of an obvious bug, steps reproduce it, so it needs no issue.
Verification
New Sidebar.logic.test.ts case "shows the number for every pull request query the search lists the thread for": for "#22889", "pr 22889", "PR #22889", "pull request 22889" and "#22889", searchSidebarThreads lists the thread and pullRequestMatchesSearchQuery is true; "22889" and "acme/widgets#22889" are true, "trim" (title only) is false.
FAIL src/components/Sidebar.logic.test.ts > pullRequestMatchesSearchQuery > shows the number for every pull request query the search lists the thread for
AssertionError: pr 22889: expected false to be true
Tests 1 failed | 95 skipped (96)
With the fix:
Test Files 1 passed (1)
Tests 96 passed (96)
vp run check:changed: format, lint, knip, typecheck (2 packages), test (2 files, 101 tests) and React Compiler (1 file) all pass.
Not verified: I did not link a real PR and look at the sidebar row; the test checks the matcher against the same query list the search accepts.
Model: Claude Opus 5.5. Harness: Claude Code in T3 Code.
Reviewing files that changed from the base of the PR and between 30e6d01 and 52eddf8.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The pull-request matcher now uses thread-search scoring instead of normalized-token substring matching. Tests compare its results with sidebar thread search for several pull-request number formats.
Changes: Pull-request search matching
Layer / File(s)
Summary
Align pull-request matching with thread search apps/web/src/components/Sidebar.logic.ts, apps/web/src/components/Sidebar.logic.test.ts
pullRequestMatchesSearchQuery builds a pull-request-only search subject and checks it with scoreThreadSearch. Tests cover prefixed, unprefixed, and repository-qualified pull-request numbers, plus a non-matching title query.
This change makes the pull-request badge in sidebar search follow the same matching rules as thread listing. No merge-blocking risk was identified.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the change: the PR badge is wrong for "pr 123" searches that list the thread. It follows the conventional commit form and matches the raw summary, which shows pullRequestMatchesSearchQ…
Description check
The description follows the template. It has Problem, Change, Scope, and Verification sections. It gives reproduction steps, the cause in Sidebar.logic.ts, the fix, and a scope rationale for skipping …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the change: the PR badge is wrong for "pr 123" searches that list the thread. It follows the conventional commit form and matches the raw summary, which shows pullRequestMatchesSearchQuery now uses scoreThreadSearch so badge visibility follows thread search matching.
Full details: Description check
Explanation
The description follows the template. It has Problem, Change, Scope, and Verification sections. It gives reproduction steps, the cause in Sidebar.logic.ts, the fix, and a scope rationale for skipping an issue. Verification shows a failing test before the fix and passing results after. It states that the real sidebar row was not checked. The template asks for before/after screenshots for UI changes, and none are attached, but the author explains that the change was verified by a test and not by a visual check. This is a minor gap.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Reviewing files that changed from the base of the PR and between fe03466 and 30e6d01.
Files selected for processing: 2
apps/web/src/components/Sidebar.logic.test.ts
apps/web/src/components/Sidebar.logic.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
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
size:S10-29 changed lines (additions + deletions).takeover:needs-juliusTakeover done; route gate says Julius decidesvouch:unvouchedAuthor is not yet trusted in the VOUCHED list.
2 participants
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
Thread search lists a thread for "pr 22889" but hides its pull request badge. Sidebar search and Cmd+K show the matching PR's badge (icon, number, state colour) beside the title when the query matched one of the thread's PRs. Thread search accepts the prefixes "pr", "pull request" and "pull", and a query in double quotes, so "#22889", "pr 22889", "PR #22889", "pull request 22889" and
"#22889"all find the thread. Only the first of them shows the badge. In the sidebar, which has no match-hint line, the row then gives no sign of why it matched.Steps (Linux, no sign-in):
link_pull_requesta public PR URL, or open a thread on a branch with a PR).#<number>in the sidebar search: the row shows the PR badge.pr <number>orPR #<number>: the same row is listed but the badge is gone. Same in Cmd+K.Cause
pullRequestMatchesSearchQueryinapps/web/src/components/Sidebar.logic.tssplits the query on spaces and requires every token as a substring of "#22889 owner/repo#22889 <title>". The token "pr", "request" or a quote character is never in that text. Ranking usesscoreThreadSearch, whosethreadFieldQuerystrips the prefixes and quotes, so the list and the badge disagree. The badge matcher dates from #14658; the prefix stripping came later with the thread search work and the badge was not moved over.Change
The badge is matched with
scoreThreadSearchon a subject that holds only the thread's pull requests, so it shows exactly when the PR fields match the query as search reads it. One file, 16 lines; thenormalizeSearchTextimport goes.Behaviour note: a short repo-name word (for example "widgets") used to light the badge by substring. References now count only as search counts them (the whole query, 8 or more characters), which matches when the thread is listed at all.
Scope
Small fix of an obvious bug, steps reproduce it, so it needs no issue.
Verification
New
Sidebar.logic.test.tscase "shows the number for every pull request query the search lists the thread for": for "#22889", "pr 22889", "PR #22889", "pull request 22889" and"#22889",searchSidebarThreadslists the thread andpullRequestMatchesSearchQueryis true; "22889" and "acme/widgets#22889" are true, "trim" (title only) is false.Test commit alone, on main fe03466:
With the fix:
vp run check:changed: format, lint, knip, typecheck (2 packages), test (2 files, 101 tests) and React Compiler (1 file) all pass.Not verified: I did not link a real PR and look at the sidebar row; the test checks the matcher against the same query list the search accepts.
Model: Claude Opus 5.5. Harness: Claude Code in T3 Code.