Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): PR code view keeps its scroll when a turn finishes #13835

Mergedsameerr03(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/13835/headmerged by juliusmarminge View on GitHub

Completing a turn anywhere in an environment cleared an open pull request Code tab, unmounted its viewer, and reset the reader to the top even when the diff had not changed.

Pass turn completion as a separate background refresh signal. Reread the first page and viewed-file metadata while retaining slices; the existing page comparison preserves unchanged pages and discards downstream slices if a page changes. Explicit refresh and PR revision changes retain the hard reset. Adapted from @sameerr03’s #13835 to current main.

Verification: 198 existing tests across five targeted unit/Chromium suites pass both before and after. Web typecheck, changed-file lint/format, and whitespace checks pass. No new regression was added: the existing panel browser harness substitutes the Code tab and cannot establish real viewer retention. These checks are compatibility evidence, not direct scroll-retention proof.

Original fork history is preserved and main merged. Two independent review rounds completed: round 1 found cross-environment stale-page retention; adding environment identity to the local slice scope fixed it. Both round-2 reviews found no source blockers.

Integrated isolated app started and paired, but its list/detail services still report "Could not reach GitHub at github.com". All current-head CI jobs that ran passed, including the native-fingerprint rerun; skipped jobs remain skipped. Pending: integrated unchanged/changed-first-page and multi-page scroll verification and fresh recordings. macOS, Windows, iOS, Android, and Electron desktop were not verified. This offline preparation is not merge-ready.

Model: GPT-6.1-Sol (implementation), GPT-6-Astra (tests), Claude Opus 5.5 and GPT-6-Sol (review). Harness: Codex and Claude through T3 Code.

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration

      Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml

      Review profile: CHILL

      Plan: Advanced

      Run ID: a78da863-f382-4ae2-8003-206c5a95ca16

      📥 Commits

      Reviewing files that changed from the base of the PR and between 95030dc674883f0f2a7fd034b32ce742c8cf55d0 and 3472adcb2ed29f15fdf010df8c6cd52ac8906152.

      📒 Files selected for processing (2)
      • apps/web/src/components/pullRequest/PullRequestCodeTab.tsx
      • apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

      📝 Walkthrough

      The Code tab now receives manual and background refresh tokens separately. When the background token changes, it refreshes diff and viewed-file data from the first diff page while retaining accumulated slices.

      Changes: Pull request code refresh

      Layer / File(s)Summary
      Pass and handle separate refresh signals
      apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx, apps/web/src/components/pullRequest/PullRequestCodeTab.tsx
      The detail panel passes separate manual and background refresh tokens. The Code tab resets its requested cursor to the first page and refreshes diff and viewed-file data when the background token changes. It retains later pages if the first-page response is unchanged; otherwise, existing slice-update logic replaces subsequent pages.

      Priority: ⬇️ Low

      Estimated code review effort: 2 (Simple) | ~10 minutes

      Change: Bug fix

      Suggested reviewers: juliusmarminge

      Merge Risk: ⚪ Minimal · up to 3472a

      Turn completion can refresh the Code tab without resetting its scroll position, and no actionable merge-blocking issue remains after normal checks.

      Security architecture risk: 🟡 Moderate · up to 3472a

      Background refreshes keep the Code tab stable, but a switch between environments showing the same pull request may leave pages from the previous environment on screen. No new server access or authorization bypass is evident; the concern is which cached pages the UI displays.

      Retained concerns

      • Medium · security · inferred: A background refresh can retain diff pages under the same reference and commit when the environment changes. If the new environment returns an identical first page, later pages from the previous environment can remain displayed; unlike the former turn-triggered clearing path, the new path does not clear them.
      Security review details

      Security Blast Radius

      • inferred — The identified exposure is previously loaded diff content in the current browser view, not evidence of a new cross-environment server read or gained privilege.

      Security Findings and Attack Paths

      • inferred — If the Code tab remains mounted across an environment switch with the same reference and commit, its old later pages can survive a soft refresh when the new first page compares equal. Actual reuse and the resulting display have not been verified.

      Trust Boundaries and Controls

      • observed — The refresh token is a read trigger: the diff query continues to carry the selected environment and PR reference, and viewed-file reads retain their capability gate.

      Hardening Proposals

      • proposed — Include environment identity in the retained diff-slice scope and verify that an older refresh completion cannot replace data for a newer context or refresh intent.
      Pre-merge checks: Passed 4 · Failed 1
      Failed Failed checks: 1 warning
      Check nameStatusExplanationResolution
      Docstring CoverageWarningDocstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files.Write docstrings for the functions missing them to satisfy the coverage threshold.
      Passed Passed checks: 4 passed
      Check nameStatusExplanation
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Title checkPassedThe title clearly identifies the web pull request Code view scroll-retention fix when a turn finishes. It matches the primary change.
      Description checkPassedThe description explains the problem, the implementation, verification results, review history, limitations, and pending checks. It does not use the template headings or provide a direct triaged issue…
      Full details: Description check

      Explanation

      The description explains the problem, the implementation, verification results, review history, limitations, and pending checks. It does not use the template headings or provide a direct triaged issue or approval link, but the required information is mostly present.

      • Fix all pre-merge checks with AI
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create a new PR
      Comment `@coderabbitai help` to get the list of available commands.
    3. juliusmarminge added labelsmacroscope-review

    4. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at b55a26b

      Macroscope's review found this PR approvable — This is a focused web bug fix that separates background turn refreshes from explicit resets, preserving the mounted diff viewer and its scroll position while still revalidating changed data. The two-file change has a narrow, understandable runtime impact and introduces no schema, deployment, security, billing, or static-analysis changes.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. juliusmarminge assignedjuliusmarminge

    6. Taking over this one as maintainer for batch pull-request-02. I am adapting the focused soft-refresh fix to current main, preserving your branch history, and checking the full diff with independent reviews. No merge is planned.

    7. Reviewed the CodeRabbit docstring-coverage warning against the current diff. No docstrings added: AGENTS.md asks comments to explain constraints rather than restate component/function names or control flow. The two changed React components do not need new documentation for the separate refresh token. The current body records the missing live proof, so this is not a claim of merge readiness.

    8. juliusmarminge merged this073a20a

    9. juliusmarminge closed this

Sign in to join this conversation.