PR #9678 review: filter pull requests by requested reviewer

PR #9678 Review workspace Author: Kitenite · Reviewed at 49b23f0b · 2026-11-12

Summary

The PR adds a Reviewer row to the desktop PR view's filter popover. Each picked login becomes a review-requested:<login> qualifier in the GitHub search, and the #N direct-lookup path applies the same check (direct requests, and team requests through team membership). The Author picker is extracted into a shared PullRequestUserFilter with a kind prop. reviewer is an optional field on searchPullRequests, so older clients keep working.

Verdict

Minor issues

The feature works end to end in the dev app and the structure is clean. One filter combination gives wrong results: the Reviewer filter plus "Awaiting review from you or your team" widens the list (3 → 10) instead of narrowing it, and the #N path disagrees with the list for the same filters. The fix is small.

Findings

MediumReviewer + "Awaiting review from you or your team" ORs instead of ANDs

packages/host-service/src/trpc/router/workspace-creation/procedures/search-pull-requests.ts:919 (with :104)

The Reviews option team-review-requested maps to review-requested:@me. The new filter adds review-requested:<login>. GitHub ORs repeated uses of the same qualifier (this is what the PR relies on for multiple logins), so the two filter rows combine as me OR login. Every other pair of rows narrows the result.

repo:ParadevAI/Paradev is:pr is:open review-requested:@me                          → 7
repo:ParadevAI/Paradev is:pr is:open review-requested:Kitenite                     → 3
repo:ParadevAI/Paradev is:pr is:open review-requested:@me review-requested:Kitenite → 10  (union)
repo:ParadevAI/Paradev is:pr is:open user-review-requested:@me review-requested:Kitenite → 0 (AND, as expected)

The direct-lookup path ANDs the two checks (ghDirectLookupRow / octokitDirectLookupRow), so with both filters on, #9661 is in the list but a search for #9661 returns nothing. That is the search/lookup disagreement the PR description says it prevents. Reproduced in the app (screenshots 08 and 09 below).

Fix: the simplest fix is to reject the combination: add input.review !== "team-review-requested" to the .refine when reviewer is set, and disable that Reviews option in the popover while a reviewer is picked (or clear one when the other is set). Another option is to keep the combination and build the intersection in another way. A one-line fix such as user-review-requested:@me would change what "or your team" means, so it is not a good fix. Add a host-service test for the qualifier string either way.

LowTeam-membership checks run one at a time, reviewers × teams

search-pull-requests.ts:331–352 and :505–527

ghMatchesReviewerRequest and octokitMatchesReviewerRequest await one gh api …/memberships/… call (a subprocess on the gh path) per (team, reviewer) pair. With 20 logins and 3 requested teams, a #N lookup that does not match makes 60 calls in sequence before it returns. The case is rare (Paradev has no team requests today), but the cost is easy to remove.

Fix: run the pairs in parallel and return when one is true (for example Promise.any over the pairs, mapping false to a rejection), or cap the work.

InfoThe "256-character cap → 422" limitation in the description did not reproduce

PR description, "Known Limitations"

I sent a 990-character query with 20 real author: and 20 real review-requested: qualifiers to search/issues. It returned 200. GitHub's 256-character limit does not count qualifiers. What does return a 422 is a list of logins that are all unknown: review-requested:nosuchuserxyz123q alone gives "The listed users cannot be searched…". If at least one login exists, GitHub drops the unknown ones without an error. The free-text "Filter by @…" option can therefore produce a 422 on a typo. This also happens with Author on main, but the description should state the real cause.

InfoFree-text logins are lowercased

PullRequestUserFilter.tsx:144

When you type Kitenite, the option reads "Filter by @kitenite" and the URL becomes ?reviewer=kitenite. GitHub logins are case-insensitive, so results are correct. The behavior came over from AuthorFilter unchanged. It is a cosmetic point only.

Evidence: desktop app (dev build over CDP)

This workspace's dev desktop app at the PR head 49b23f0b, renderer on localhost:3005, CDP on port 9333, signed in. Real mouse/keyboard input over CDP. Setup step (not the feature): the native folder dialog cannot be driven over CDP, so I linked the Paradev project to /workspace on this host with the same project.setup host-service call that the setup modal makes. The gh account on the host is superset-home.

Filter popover with Reviewer row
The Reviewer row is between Author and Reviews. The empty state reads "Any reviewer".
Reviewer picker with typed login
With all repositories in scope, the picker is a username box. Typing "Kitenite" gives "Filter by @kitenite".
Reviewer selected
After the pick: URL #/pull-requests?reviewer=kitenite, badge "Filters, 1 active", persisted store reviewerFilter:"kitenite" at version 8.
Filtered list shows 3 PRs
The filtered list is Open 3: #9661, #5873, #5704. This matches gh api search/issues for review-requested:Kitenite exactly.
Union bug: 10 PRs
Finding 1: adding Reviews = "Awaiting review from you or your team" changes Open 3 to Open 10 (2 filters active). The list is the union of the two filters, not the intersection.
Direct lookup returns 0
Finding 1: with the same two filters, a search for #9661 gives Open 0, but #9661 is in the list above.
Direct lookup positive
Direct lookup, reviewer only: #9661 + reviewer=kitenite returns #9661 (Open 1). Correct.
Direct lookup negative
Direct lookup, reviewer only: #9674 (requested from superset-home only) + reviewer=kitenite returns Open 0. Correct: no leak.

Surfaces not run: none. The change is desktop + host-service only. I did not test team-routed requests live because no PR in this repo has a team request.

Questions for the author

Test / CI notes

WhatResult (at 49b23f0b)
bun test apps/desktop pull-requests104 pass, 0 fail
bun test host-service workspace-creation-github.integration51 pass, 0 fail
typecheck apps/desktop and packages/host-serviceclean
CI: Lint, Typecheck, Test, Sherif, Vale, Version Sync, Build CLI, Deployspass
CI: Boot twicefail. "first boot: checkout done" timed out in the cloud sandbox boot test. The PR changes no sandbox or boot code, and the same workflow passes on main (latest scheduled run 2026-11-12). This is probably flaky or caused by infrastructure. Rerun it.
GitHub Search API probesOR/AND semantics and query length, as above