fix(web): PR code tab no longer reloads when turns finish or the PR updates #14539
main fromrefs/pull/14539/head·opened View on GitHubFinished turns and PR revisions cleared the Code tab’s loaded diff pages, interrupting reviews of large pull requests. Background refreshes now keep unchanged pages and revalidate their cursors sequentially. Changed pages discard their descendants, and later pagination requires a fresh response. Explicit Refresh still resets to page one. Failed refreshes keep the diff visible and offer Retry; uncached pagination starts one request per page.
Thanks @Gigioxx for the original fix in #14539. This takeover preserves the contributor’s commits, merges current main, and rebuilds the component integration around the current query lifecycle.
Verification:
- Focused diff logic suite: 17 tests before → 16 after; three PR-added cases reduced to two behavioral regressions. Both regressions fail under targeted mutations.
- Web typecheck, lint and formatting for the four changed files pass.
- Headless Linux browser: the actual panel with three synthetic HTTP diff pages (24 files) and injected refresh signals. Unchanged turn/revision refreshes retain pages and scroll; a changed middle page invalidates descendants and reloading fetches them; menu Refresh resets to page one. This verifies frontend integration, not a real provider turn or host-side revision.
- Independent whole-diff reviews: two rounds with Claude Opus 5.5 and Codex gpt-6-sol. Round one found silent refresh failures and duplicate uncached-page reads; both were fixed and reproduced in the browser. Round two found no confirmed blockers at d664824fa5. Build/typecheck and lint passed on the published head. The initial web CI run failed an unrelated syntax-highlighting wait in WorkflowOpeningBlock; all three tests in that browser suite pass locally. The first rerun lost its Vitest browser connection; the second rerun again failed only the same unrelated WorkflowOpeningBlock assertion (8049 tests passed). CI remains blocked; monitoring is stopped after repeated host-read failures. Macroscope correctness passed; its eligibility check requires human approval for the refresh state machine and lint suppression.
- Not verified: macOS, Windows, iOS, Android, or Electron desktop.
Before: current main, same fixture and initial scroll (800px). After a background signal it loses a loaded page (24 → 16 files+) and shifts to 722px.

After: unchanged background refresh retains all 24 files and scroll position.

Retained diff after a failed background refresh; Retry resumes the sequential reads without losing scroll:

Short recordings of background revalidation:
Before recording · After recording
Implemented with Codex gpt-6.1-sol in T3 Code; test reduction with Codex gpt-6-astra; adversarial review with Claude Opus 5.5 and Codex gpt-6-sol.
Fixes #14483
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
Approvability#
Verdict: Needs Human Approval
Macroscope's review found this PR requires human approval — This PR substantially changes how the production PR code viewer revalidates and retains paginated diff state during background updates, including new retry and pagination lifecycle behavior. It also introduces an inline static-analysis suppression, so the change warrants focused review.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).juliusmarminge added labelsmacroscope-review
I’m also experiencing this - activity in unrelated threads resets the PR diff scroll position, which makes reviewing larger diffs difficult. This fix would help a lot.
Version:
0.0.46-nightly.20261015.3171(Windows desktop).juliusmarminge assignedjuliusmarminge
Taking over this one as maintainer for batch pull-request-08. I will preserve your commits, integrate current main, simplify the tests and implementation where useful, and run fresh independent reviews. Thanks @Gigioxx for isolating the background-refresh regression.
The takeover is pushed at d664824fa5, with focused tests and browser proof in the description. Two independent whole-diff review rounds found no remaining confirmed blockers.
The first CI run passed build/typecheck and lint; its only test failure was the unrelated syntax-highlighting wait in
WorkflowOpeningBlock.browser.test.tsx. I have rerun the failed jobs and am following them. Macroscope’s current correctness check passed; its eligibility check explicitly requires human approval for the refresh state machine and lint suppression. That approval remains outstanding.The second rerun again failed only the unrelated WorkflowOpeningBlock.browser.test.tsx:103 highlighting wait: 8049 tests passed. That three-test browser suite passes locally. No PR code was changed for the CI failures. Build/typecheck, lint, focused tests, and Macroscope correctness passed.
This takeover remains unmerged and blocked on that CI failure and Macroscope’s required human eligibility approval. The app watcher repeatedly failed to read the host, so monitoring is stopped while I continue the remaining batch targets. The description contains current-head browser proof and verification limits.
Gigioxx(GitHub profile, opens in a new tab) linked this to fix #14483
Note
🤖 Claude Opus 5.5 responding on behalf of Theo
Closing. This PR has been open for more than 3 weeks, and
mainhas moved a long way since then. If the change still matters, open a fresh PR from currentmain.t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
Warning
Review limit reached#
Only developers with an assigned seat can use this organization's usage-based review budget, and seats here are assigned manually. Ask an admin to assign a seat, or change the review continuation mode in Billing.
Next included review available in 16 minutes.
Check out review usage here.
View limit details
Limit details: You’ve used all 10 included reviews currently available.
Learn how review limits work.
Review configuration:
⚙️ Run configuration
0eab4cb0-2f29-4e66-9491-afed418b0bb4📥 Commits
Reviewing files that changed from the base of the PR and between 44f977f4e819c2355cb2f8c75b93547fb9815fec and 3e062d8c246349cffebfafd369d8cedbd8df01d5.
📒 Files selected for processing: 4
apps/web/src/components/pullRequest/PullRequestCodeTab.tsxapps/web/src/components/pullRequest/PullRequestDetailPanel.tsxapps/web/src/components/pullRequest/pullRequestDiff.logic.test.tsapps/web/src/components/pullRequest/pullRequestDiff.logic.ts- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment `@coderabbitai help` to get the list of available commands.