GeezerVison is showing github.com — fix(web): PR Code tab no longer requests the diff of a commit the PR dropped by juliusmarminge · Pull Request #25916 · pingdotgg/t3code
Conversation
Problem
Opening a commit from the PR timeline that a force-push removed (or keeping one selected across a force-push) left the Code tab scoped to that commit for a render. It subscribed a diff request for a commit the pull request no longer has and reset the scope (draft, selected lines, toggled files, slices). Then an effect wrote null back to the parent panel, which re-rendered both and reset the scope a second time.
Change
PullRequestCodeTab derives its commit scope in render: a selected oid that is not in detail.commits reads as "All commits" from the first render. The write-back effect is removed.
What this improves
- Bug fixed: no diff request for a commit the PR no longer contains, and one fewer scope reset plus parent and tab re-render. Test:
never requests the diff of a selected commit the pull request no longer has in PullRequestCodeTab.browser.test.tsx (fails on main with expected [ 'gone', 'gone' ] to not include 'gone').
- Sync removed: the child-to-parent write-back effect.
Behavior change: the stale oid now stays in the parent's state instead of being cleared. Only the next user selection replaces it, so it would apply again if that exact commit came back to the pull request (for example, a reverted force-push). On the force-push path itself this saves a parent and tab re-render; it does not save a request, because the stale diff was already subscribed.
Effects
apps/web/src/components/pullRequest/PullRequestCodeTab.tsx: 4 -> 3
Verification
vp test run src/components/pullRequest/PullRequestCodeTab.browser.test.tsx: 4 passed. The new test fails on main's PullRequestCodeTab.tsx.
vp run check:changed: format, lint, knip 1/2, knip 2/2, typecheck (3 packages), and test all pass.
Model: Claude Opus 5.5, Claude Code harness.
🤖 Generated with Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…dropped
Opening a commit from the PR timeline that a force-push removed (or keeping
one selected across a force-push) left the Code tab scoped to that commit for
a render: it subscribed a diff request for a commit the pull request no
longer has and reset the scope, then an effect wrote null back to the parent
panel, which re-rendered both and reset the scope again.
The tab now derives its commit scope in render: a selected oid that is not in
detail.commits reads as "All commits" from the first render. The write-back
effect is removed. The stale oid stays in the parent's state, which is only
replaced by the next user selection; it would apply again only if that same
commit came back to the pull request.
Effects: PullRequestCodeTab.tsx 4 -> 3 (removed the parent write-back).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Approvability
Verdict: Approved at ac22601
Macroscope's review found this PR approvable — This is a narrowly scoped web bug fix that prevents the PR Code tab from requesting a dropped commit and removes a redundant state-reset cycle. Existing valid commit selection behavior remains unchanged, and the regression is covered by a browser test.
You can add or adjust custom eligibility rules. Learn more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between 58c31f2 and ac22601.
Files selected for processing: 2
-
apps/web/src/components/pullRequest/PullRequestCodeTab.browser.test.tsx
apps/web/src/components/pullRequest/PullRequestCodeTab.tsx
Limit details: You’ve used all 10 included reviews currently available.
Walkthrough
-
The pull request code tab now uses a selected commit only when it appears in the pull request’s commit list. Otherwise, it requests the all-commits diff without clearing the parent selection. A browser test covers this fallback.
Changes: Pull request diff scope
| Layer / File(s) |
Summary |
Selected commit validation and fallback apps/web/src/components/pullRequest/PullRequestCodeTab.tsx, apps/web/src/components/pullRequest/PullRequestCodeTab.browser.test.tsx |
The code tab uses the selected commit only if it appears in the pull request’s commit list. Otherwise, it requests the all-commits diff without changing the parent selection. The browser test records requested commits and checks the fallback diff. |
Priority: Low
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: maria-rcks, t3dotgg
Merge Risk: Minimal · up to ac226
-
The Code tab falls back to all commits when a selected commit is removed. No actionable merge risk remains beyond normal checks.
Pre-merge checks: 3 · 1
-
Failed checks: 1 warning
| Check name |
Status |
Explanation |
Resolution |
| Description check |
 |
The description clearly covers the problem, change, behavior impact, and verification. It does not provide the required scope and approval information, such as a linked issue or maintainer approval, o… |
Add the Scope and approval section. Link the triaged issue or approval discussion, including the approval comment. If this fix qualifies as an obvious focused bug fix, state that reason explicitly. |
Passed checks: 3 passed
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title clearly identifies the main fix: the Code tab no longer requests a diff for a commit removed from the pull request. |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Full details: Description check
-
Explanation
The description clearly covers the problem, change, behavior impact, and verification. It does not provide the required scope and approval information, such as a linked issue or maintainer approval, or explain why this focused bug fix qualifies for an exemption.
Resolution
Add the Scope and approval section. Link the triaged issue or approval discussion, including the approval comment. If this fix qualifies as an obvious focused bug fix, state that reason explicitly.
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Usage-based review receipt
Note This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.
Comment @coderabbitai help to get the list of available commands.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:S
10-29 changed lines (additions + deletions).
vouch:trusted
Author is trusted by repo permissions or the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|