GeezerVison is showing github.com — fix(web): the pull request Code tab keeps its diff after a refresh by Brechard · Pull Request #21734 · pingdotgg/t3code
Conversation
Note 🤖 Claude Sonnet 5.5 writing on behalf of Rodrigo
Problem
The pull request Code tab intermittently shows "This pull request has no file changes." and a "0 files" header for a PR that has changes. It appears a few minutes after the PR opens or after an agent turn, and clears on its own once the diff changes or the tab remounts.
The cause is in PullRequestCodeTab.tsx. A refresh (the panel's refreshToken goes up after a PR sync, an agent turn, or a manual refresh) empties the accumulated diff slices and refetches the first page. The slices were only refilled when the query returned a different data object, cursor or scope. Since #20850, an equal refetch keeps the previous data object, so after the reset data, the cursor and the scope all match what was already applied and nothing refills the slices. This happens whenever nothing beyond the first page is loaded, which is the normal case for a small or new PR.
Change
The tab now decides whether the current page is already applied by looking at the loaded slices, instead of tracking the data object's identity in a separate appliedPage state. A refresh shows the first page again right away and replaces it only if its content changed. The rule that a changed page drops the slices after it is unchanged. The existing content comparison became a small sameSlice helper used in both places.
Scope and approval
Very small, focused fix for an obvious bug, so submitted without a prior issue or discussion: a refresh of an unchanged diff leaves the tab permanently empty. It changes no setting, control or default, and no contract.
Verification
- New browser test
PullRequestCodeTab.browser.test.tsx renders the real component with the real useEnvironmentQuery and useAtomRefresh, loads a one-file diff, bumps refreshToken, and has the refetch return the same page object. It expects the file to stay on screen. On upstream/main it fails with the "no file changes" message; with this change it passes.
vp lint on both files and the apps/web typecheck are clean.
- Observed in the private build of the app: the server's diff request to GitHub returned HTTP 200 three times in eight seconds for a five-minute-old PR while the tab showed "0 files", which matches the client-side cause above.
Not checked: the fix in a live app, since the empty state cannot be staged without altering state, so there are no screenshots. The test fakes the equal refetch with a stand-in atom rather than the real environment query family. A second suspected path (selecting a commit or update range and switching back before its diff loads) is covered by the same change but has no test.
Written by Claude Opus 5.5 (fix and test) and Claude Sonnet 5.5 (PR) in Claude Code.
🤖 Generated with Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Dhinihan and MarcRez33 reacted with thumbs up emoji
A refresh emptied the accumulated diff slices and refetched the first page,
but slices were only refilled when the query's data changed identity. An
equal refetch keeps the previous value's identity, so the tab showed
"no file changes" until the diff's content changed. Read whether a page is
already applied from the slices instead of a separate identity gate.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 68b4e5a599e3561ddd5a23568bb5183a38fb342c)
Approvability
Verdict: Approved at 815842c
Macroscope's review found this PR approvable — This is a focused bug fix that restores an existing pull request diff after an equivalent refresh, with the changed-page behavior preserved and a targeted browser regression test added. It introduces no new capability, schema, product default, deployment change, or static-analysis override.
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
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
fae4b529-ad68-4fdd-b2dc-c241502d5701
📥 Commits
-
Reviewing files that changed from the base of the PR and between 5307c23 and 815842c.
📒 Files selected for processing: 2
-
apps/web/src/components/pullRequest/PullRequestCodeTab.browser.test.tsx
apps/web/src/components/pullRequest/PullRequestCodeTab.tsx
📝 Walkthrough
-
PullRequestCodeTab now compares diff pages by their contents when refreshing. A changed page replaces its loaded slice and removes later slices. A browser test checks that an unchanged page keeps the file count visible after refresh.
Changes: Diff slice refresh handling
| Layer / File(s) |
Summary |
Diff slice comparison and updates apps/web/src/components/pullRequest/PullRequestCodeTab.tsx |
The code tab compares pages by cursor, patch, truncation status, next cursor, and ordered omitted-file statistics. It appends pages with new cursors, replaces changed slices and later pages, and leaves equal slices unchanged. |
Refresh regression test apps/web/src/components/pullRequest/PullRequestCodeTab.browser.test.tsx |
The browser test mocks a diff-page refresh with unchanged data and checks that the file count remains visible and the no-file-changes message does not appear. |
Priority: ⬇️ Low
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: juliusmarminge
Merge Risk: ⚪ Minimal · up to 81584
-
The Code tab refresh fix has no identified merge-blocking issue. It is ready to merge after normal checks.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title is concise, specific, and accurately describes the main fix: preserving the pull request Code tab diff after a refresh. |
| Description check |
 |
The description includes all required sections. It explains the problem, fix, scope rationale, focused verification, limitations, and agent attribution. The missing screenshots are explicitly explaine… |
| 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 includes all required sections. It explains the problem, fix, scope rationale, focused verification, limitations, and agent attribution. The missing screenshots are explicitly explained because the live empty state could not be staged.
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
|
Hit this on desktop nightly 0.1.1-nightly.20261020.3401: the Code tab showed "0 files / This pull request has no file changes." right after a PR update, even though the server's diff request returned 200.
I reproduced it independently on main e64766c5 with a browser test that bumps refreshToken and serves the same diff object again. It fails without a fix and passes with one. The changed-content case passes either way. Same root cause as described here, so +1 on getting this merged.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Note 🤖 Claude Opus 5.5 responding on behalf of Theo
Thanks for this fix. We took it over in #22917 so it can land now: your commit is kept with your authorship, rebased on current main, with a small follow-up commit on top. Closing this one in favor of #22917.
|
MarcRez33 reacted with thumbs up emoji
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.
Assignees
No one assigned
Labels
size:M
30-99 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.
|