feat(desktop): filter pull requests by requested reviewer
Summary
- Adds a Reviewer row to the PR view's filter popover, backed by
review-requested:<login>— you can now ask who a PR is waiting on, not just whether it is waiting on you. - Extracts the Author picker into a shared
PullRequestUserFilterso Author and Reviewer are one component with akindprop rather than a copy. - Teaches the direct-lookup path (a bare
#Nsearch) the same filter, so a number lookup cannot leak a PR the reviewer was never asked to review.
Why / Context
The review dimension was a closed enum of eight strings with no username in it. "Awaiting review from you" existed; "awaiting review from them" did not.
The only way to express it was to type review-requested:<login> into the search box. That works today by accident — free text is concatenated verbatim into the GitHub query next to the generated qualifiers — and it breaks as soon as the text also looks like a PR number or a GitHub URL, because the normalizer reroutes those to a direct lookup. It is also undiscoverable and unvalidated.
How It Works
reviewer joins author as a comma-separated login list (max 20) through the same path: store → URL param → searchPullRequests input → qualifier. Each login becomes a review-requested:<login> qualifier.
Repeated review-requested: qualifiers OR on GitHub the same way repeated author: does — verified against the Search API rather than assumed:
review-requested:Kitenite → 64
review-requested:gregpr07 → 0
review-requested:Kitenite review-requested:gregpr07 → 64
So extra logins widen the set rather than narrowing it to nothing.
review-requested: covers requests made directly and via a team, so the direct-lookup path mirrors both: it matches a login in requested_reviewers, else checks team membership for each requested team. (ghIsViewerTeamMember was already login-generic and is renamed ghIsTeamMember.)
Manual QA Checklist
Verified in the dev build on this branch, driven over CDP:
- Reviewer row renders between Author and Reviews, empty state reads "Any reviewer"
- Scoped to one repository the picker lists the repo's real contributors (96, with avatars)
- Across several repositories it falls back to a plain username box
- Picking a reviewer sets
?reviewer=<login>and the active-filter badge counts it - Open 710 → Open 3, returning #9661, #5873, #5704
- Cross-checked against the source of truth —
gh api search/issuesforrepo:ParadevAI/Paradev is:pr is:open review-requested:Kitenitereturns exactly those three numbers - Opening a PR from the filtered list keeps the filter (carried into the detail URL)
Screenshots of each step: https://app.superset.sh/page/pr-view-filtering-by-requested-reviewer-vgvt8z
Testing
bun run typecheckbun run lint:fixbun run check:i18n— all 17 locales translatedbunx sherifbun testinapps/desktop(PR view: 104 pass) andpackages/host-service(GitHub integration: 51 pass)
4 new host-service integration tests plus a store test. The two negative cases were confirmed to go red with the feature disabled; the positive cases pass either way by design (they guard against over-filtering, e.g. a case-sensitive match).
Note the repo's aggregate bun run test is red on a clean tree. Baseline at this branch's merge-base: 9435 pass / 69 fail. With this change: 9560 pass / 39 fail. The failures are posthog-js and real-git/shell tests under concurrency, unrelated to this.
Design Decisions
review-requested:overuser-review-requested:— the broader qualifier matches what "requested reviewer" means to a reader, and covers team-routed requests. Paradev uses no team review requests today (0 of 100 open PRs), so the two agree in practice, but the direct-lookup path implements both halves so search and#Nlookup cannot disagree.- Shared component over a copy —
AuthorFilterwas ~230 lines that Reviewer would have duplicated wholesale. - Reviewer is a login list, not a relationship — "requested" is the one people ask for.
reviewed-by:andreview-involves:are the natural next step, and that is the point where this wants an operator rather than a flat list.
Known Limitations
- An older host-service silently ignores this filter. The input is optional, which is what keeps old clients working, but it also means a host below this version strips
reviewerand answers with an unfiltered list rather than an error. The local bundled host is version-pinned, so this only affects a remote host on an older build. Gating it needs the host version plumbed intoProjectQueryTarget, which does not exist today. - The 256-character query cap is tighter than it looks. GitHub caps search queries at 256 chars and
chunkProjectReposonly chunksrepo:qualifiers against that budget. 20 authors is already ~320 chars on its own; this adds up to 20 more logins at ~26 chars each. A user who picks many people will get a 422. The exposure predates this change but is widened by it.
Follow-ups
- Wire the existing-but-uncalled
viewerRelationshipenum (needs-review/reviewed/authored) insearch-pull-requests.tsto Reviewing / Mine sections. It shipped in #6710 with zero callers. - Host-version gate for the above.
- Teach the chunker about the whole qualifier string, or lower the login caps.
Summary by cubic
Adds a Reviewer row to the PR view's filter popover so you can filter pull requests by who is requested to review them, backed by GitHub's review-requested: qualifier. Previously the only way was typing review-requested:<login> into the search box, which broke when the text also looked like a PR number or URL.
The Author picker was extracted into a shared PullRequestUserFilter component now used by both filters, and the #N direct-lookup path applies the same reviewer filter, matching direct requests and requests routed through teams.
The Reviewer filter and the "awaiting review from you or your team" review filter are now mutually exclusive: both compile to review-requested:, and GitHub ORs repeated qualifiers, so asking for both widened the results instead of intersecting them. Picking either dropkicks the other, and the host-service rejects the pair outright. The picker also now shows a "no results" row when a search matches nobody.
Side effects
- Older host-service versions silently drop the reviewer filter and return an unfiltered list instead of an error.
- Selecting many reviewers can exceed GitHub's 256-character query cap and return a 422; the exposure predates this change but is widened by it.
- The filter store schema bumps to version 8, with the old author filter value migrated unchanged.
Summary by CodeRabbit
- New Features
- Filter pull requests by reviewer, alongside existing author filters. Reviewer selections are saved and carried across navigation, including when opening a pull-request preview.
- Search pull requests and direct lookups by one or more reviewers. Reviewer filtering can’t be combined with team-review-requested or viewer-relationship filters.
- Reviewer filter labels, search prompts, and empty states are localized in supported languages.