Skip to content

feat(pull-requests): filters can exclude authors, labels, reviews, checks, and projects - #33522

Closed
CadenEl wants to merge 3 commits into
pingdotgg:mainfrom
CadenEl:feat/pr-list-exclude-filters
Closed

CadenEl wants to merge 3 commits into
pingdotgg:mainfrom
CadenEl:feat/pr-list-exclude-filters

Conversation

@CadenEl

@CadenEl CadenEl commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Problem

PR list filters can only narrow to a pick. There's no way to say "everything except", such as all PRs except one repo, or everything not approved. Draft is the only filter that already works both ways.

Change

  • Author, Labels, Review, Checks and Project submenus open with an Exclude matches switch on web and mobile. A pick on either side decides the mode, and flipping the switch moves the current pick across.
  • The contract adds excludedAuthors, excludedReview and excludedChecks next to the existing excludedLabels. The server applies them to every provider's rows, and they're part of the list cache key. GitHub also receives them as -author:, -review: and -status: search qualifiers.
  • Excluding a project hides its repository. The client sends the remaining projectIds and drops rows of excluded projects that arrive before their repository identity loads. The projectIds cap rises from 100 to 1000, so a large server can still list every other project.
  • Typed -author:, -review: and -status:/-checks: parse to exclusions, and typed exclusions add to the menu's rather than replacing them.
  • When excluding "No reviews", clients leave the check to the server, because list entries can't tell "no reviews" apart from "this host doesn't report reviews".

Scope and approval

Proposed in Discussion #33520. No maintainer approval yet, so this is a draft for reference.

Verification

  • vp run check:changed passes: format, lint, knip, typecheck (36 packages), and tests in 8 files.
  • New tests cover:
    • server exclusions, including providers that don't report review or checks state
    • GitHub negated qualifiers
    • the parser's negated qualifiers, and menu plus typed exclusions combining
    • mobile local exclusion
    • excluding repositories when building the request
    • a contract case with 101 project ids
  • Manual check in an isolated web preview with three public repos. Each step stacks on the one before:
    • Labels, excluding vouch:unvouched, removed all unvouched rows.
    • Review, excluding Approved: 135 → 70 PRs.
    • Project, excluding t3code: 70 → 34 PRs, all uploadthing and t3-env.
    • Turning Exclude off moved the pick back to a normal include.
  • Not checked: mobile on a device.
No filters: 135 open PRs Labels: not vouch:unvouched
No filters Labels excluding vouch:unvouched
Review: not approved, 70 PRs Project: not t3code, 34 PRs
Review excluding Approved Project excluding t3code

Written by Claude Opus 5.5 through Claude Code on behalf of CadenEl, reviewed by GPT-6.1 Sol through Codex.

…ecks, and projects

Each of these filters can now narrow the list to its picks or drop them.
An "Exclude matches" switch at the top of each submenu chooses the mode
on web and mobile, and typed -author:, -review:, and -status: qualifiers
work in search.

The server applies the new exclusions to every provider's rows, and
GitHub receives them as negated search qualifiers. Excluding a project
hides every checkout of its repository by sending the remaining project
ids, so the projectIds cap rises to 1000.
Typing -author: or -label: replaced the authors and labels excluded from
the menu, so their rows came back while the menu still showed them as
excluded. Both lists now apply together on web and mobile.

Turning off the Project exclude switch now always clears the excluded
repositories, even when none of them is in the current server's scope.
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XXL 1,000+ changed lines (additions + deletions). labels Nov 9, 2026

@binjamshid binjamshid left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adds exclude mode for author, labels, review, checks and project, on web and mobile, with matching -author:/-review:/-status: GitHub qualifiers and server-side matching. I checked the contract, the server matcher in PullRequestService, the GitHub qualifier builder, the parser and merge helpers, and the project-scope helpers. The include and exclude logic is consistent across server, GitHub and both clients, and the change to the cache-key slots is safe because that cache is in memory only. I found two small things.

  1. Low: projects without a repository identity can't be excluded. apps/web/src/components/pullRequest/PullRequestListFilters.tsx:670-673 builds the exclude checklist only from projects that have a repositoryKey. The mobile list (PullRequestListFilters.tsx, the repositories.has(key) filter) does the same. A project with no resolved canonical key, such as a local-only repo, or one whose identity hasn't loaded yet, is missing from the menu in exclude mode but still listed in include mode. A user can include it but can't exclude it. Either fall back to excluding by project key when there's no repository key, or show those rows disabled with a hint.

  2. Low: the larger projectIds cap makes an existing loop quadratic. packages/contracts/src/pullRequest.ts:39 raises the cap from 100 to 1000. The server's project scoping (PullRequestService.ts, filter.projectIds.includes(project.id) inside the project loop) is O(projects × ids) per list and filter-options read. That was fine at 100 but costs more at 1000. Converting projectIds to a Set once per call fixes it.

Process: this is still a draft waiting on approval in Discussion #33520, as the description notes. Mobile hasn't been checked on a device.

@t3dotgg

t3dotgg commented Nov 12, 2026

Copy link
Copy Markdown
Member

Note

🤖 Claude Opus 5.5 responding on behalf of Theo

Closing. This PR conflicts with main in 5 files, which is more than we will review as a rebase. If the change still matters, open a fresh PR from current main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants