Skip to content

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

Closed
CadenEl wants to merge 1 commit into
pingdotgg:mainfrom
CadenEl:feat/pr-list-exclude-filters-v2
Closed

CadenEl wants to merge 1 commit into
pingdotgg:mainfrom
CadenEl:feat/pr-list-exclude-filters-v2

Conversation

@CadenEl

@CadenEl CadenEl commented Nov 12, 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, in batches of 100 on larger servers, and drops rows of excluded projects that arrive before their repository identity loads.
  • Typed -author:, -review: and -status:/-checks: parse to exclusions, and typed exclusions add to the menu's rather than replacing them.
  • A list entry can't show CI state, or tell "no reviews" apart from "this host doesn't report reviews". So the server judges checks exclusions and -review:none, and those searches skip the unfiltered rows the page otherwise mixes into text search.

Scope and approval

Replaces #33522, which was closed for conflicting with main. Proposed in Discussion #33520, which has no maintainer response yet.

Verification

  • vp run check:changed passes: format, lint, knip, typecheck (37 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 and project scoping
    • excluding repositories when building the request
  • Manual check in an isolated web preview with three public repos, on the branch before it was rebuilt on current main. 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.

@github-actions

Copy link
Copy Markdown
Contributor

Closing: CadenEl already has 3 or more open PRs here, which is the limit for contributors who are not vouched.

Once one of them is merged or closed, open this again. See the open PR limit.

@github-actions github-actions Bot closed this Nov 12, 2026
@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 12, 2026
const excludedAuthors = unionNames(menu.excludedAuthors, typed.excludedAuthors);
return {
...menu,
...typed,

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.

🟡 Medium src/pullRequestQuery.ts:164

Combining the menu exclusion excludedReview: "approved" with typed -review:changes-requested returns only excludedReview: "changes-requested", so approved PRs reappear in server and local results. The ...typed spread overwrites the menu’s scalar exclusion; preserve both constraints or explicitly reject this combination instead of silently dropping one.

🤖 Copy this AI Prompt to have your agent fix this:
In file @packages/client-runtime/src/pullRequestQuery.ts around line 164:

Combining the menu exclusion `excludedReview: "approved"` with typed `-review:changes-requested` returns only `excludedReview: "changes-requested"`, so approved PRs reappear in server and local results. The `...typed` spread overwrites the menu’s scalar exclusion; preserve both constraints or explicitly reject this combination instead of silently dropping one.

Comment on lines +212 to +214
const first = projects.find(
(project) => pullRequestRepositoryKey(project) === excludedRepositories[0],
);

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.

🟡 Medium pull-requests/PullRequestListFilters.tsx:212

Turning the Project exclusion switch off with no excluded repository selects the first project whose repository key is undefined, unexpectedly scoping the list to that project. projects.find runs even when excludedRepositories is empty; only search for a project when an excluded repository exists.

Suggested change
const first = projects.find(
(project) => pullRequestRepositoryKey(project) === excludedRepositories[0],
);
const first =
excludedRepositories[0] === undefined
? undefined
: projects.find(
(project) => pullRequestRepositoryKey(project) === excludedRepositories[0],
);
🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/mobile/src/features/pull-requests/PullRequestListFilters.tsx around lines 212-214:

Turning the Project exclusion switch off with no excluded repository selects the first project whose repository key is `undefined`, unexpectedly scoping the list to that project. `projects.find` runs even when `excludedRepositories` is empty; only search for a project when an excluded repository exists.

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.

🟡 Medium

: targets.length && connectedTargets.length === 0

Excluding every repository makes targets empty, so the empty state incorrectly tells users to “Connect an environment” even when an environment is configured. Because targets contains only environments with non-null filtered inputs, use configured-environment availability—not targets.length—to choose the empty state.

🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/mobile/src/features/pull-requests/PullRequestsScreen.tsx around line 407:

Excluding every repository makes `targets` empty, so the empty state incorrectly tells users to “Connect an environment” even when an environment is configured. Because `targets` contains only environments with non-null filtered inputs, use configured-environment availability—not `targets.length`—to choose the empty state.

@macroscopeapp

macroscopeapp Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Would Approve

Macroscope's review found this PR approvable — Adds optional exclusion filters to PR lists and searches on web and mobile, without changing product defaults or mutating repository data. The supplied Medium filtering and empty-state findings remain subject to the separate blocking gate.

Needs human approval because:

  • 3 blocking correctness issues found at or above your repo's Minimum Blocking Severity

Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more.

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.

1 participant