Show only ready PRs in the inbox Pull requests tab#2758
Conversation
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
|
There was a problem hiding this comment.
Clean, focused filter change with matching tests. The logic refactor in isPullRequestReport and isReportTabReport is coherent and well-commented. The only review comment is a bot style suggestion (use it.each) marked resolved on an older commit — that's a style preference, not a correctness concern.
|
Reviews (2): Last reviewed commit: "Update reportFiltering.ts" | Re-trigger Greptile |
The Pull requests tab listed (and counted) PRs of every status, so merged/closed (`resolved`) PRs inflated the count with work the user has already finished — e.g. 4 PR reports shown when only 1 was actually actionable. Restrict the tab's list and count to `ready` PRs (a Responder draft awaiting review). `isPullRequestReport` now requires `status === "ready"`, the list and count queries use the new `INBOX_PULL_REQUEST_STATUS_FILTER`, and any report carrying a PR (including resolved ones) stays out of the Reports tab. This keeps the count honest about what the list shows, and is the same direction the PostHog Cloud inbox is moving. Generated-By: PostHog Code Task-Id: a6430aac-4a87-4443-841e-fb96961a6832
6a95b03 to
d6ba320
Compare
New commits pushed (delta classified non_linear_history) — stamphog approval dismissed; re-review running automatically.
The two pull-request membership tests used status "resolved", which is a Cloud-only concept absent from Code's SignalReportStatus union. Vitest strips types so the tests passed locally, but tsc (and CI typecheck) rejected the literal. Switch them to the valid non-ready "candidate" status, which exercises the same "only ready PRs count" behavior. Generated-By: PostHog Code Task-Id: a6430aac-4a87-4443-841e-fb96961a6832
|
Retaining stamphog approval — delta since last review classified as |
Problem
The inbox Pull requests tab listed and counted PRs of every status, so merged/closed (
resolved) PRs piled up alongside active ones. A user saw 4 PR reports when only 1 was actually actionable — the other 3 were already-merged PRs. The count should reflect only what's worth acting on.(Supersedes #2757, which aligned Code with Cloud by showing resolved PRs — wrong direction. Cloud is being changed to match this instead.)
Changes
Restrict the Pull requests tab's list and its count to
readyPRs (a Responder draft awaiting review):isPullRequestReportnow requiresstatus === "ready".pullRequestsOnly) and the count query use a newINBOX_PULL_REQUEST_STATUS_FILTER = "ready".isReportTabReportexcludes any report carrying a PR (including resolved/merged), so done PRs drop out of the inbox rather than reappearing as a Report.Resolved/merged and still-running PRs no longer inflate the tab or its badge. The Reports and Runs tabs are unchanged.
How did you test this?
reportMembership.test.ts(ready PR shown; resolved and in-progress PRs excluded; resolved PRs kept out of Reports).vitest run src/inbox/reportMembership.test.ts src/inbox/reportFiltering.test.ts src/inbox/engagement.test.ts— 64 tests pass.Automatic notifications
Created with PostHog Code from a Slack thread