GeezerVison is showing github.com — fix(web): short PR diffs scroll without the header snapping back by mxdhavgautam · Pull Request #19843 · pingdotgg/t3code
Conversation
Problem
In the PR panel's Code tab, a diff only a little taller than the panel could not be scrolled. Each scroll condensed the header, the diff jumped back to the top, the header reopened, and the cycle repeated.
Condensing collapses the fold, so the scroller grows by chromeDelta. The browser clamps scrollTop to the smaller range first, and then the layout effect subtracts chromeDelta from the clamped value. On #19603 at 1280x880, the fold is 108px, chromeDelta is 80px and the scroll range is 146px. After the collapse the range is 66px, so the refund lands at max(0, 66 - 80) = 0, which hits the top < 4 reopen check.
Change
The header now condenses only when more than a fold's height of scroll range remains after the collapse (scrollHeight - clientHeight - chromeDelta > foldHeight), as suggested on the issue. The refund then lands at least the condensed row's height below the top, so the reopen check no longer fires. The check moves into shouldCondenseDetailChrome next to the existing Summary scroll helper. Summary and Timeline share the handler, so they get the same fix.
Scope and approval
Fixes #19694, a triaged bug. A maintainer confirmed the cause on main and suggested this guard in the triage comment. The diff only changes the condense check.
Verification
Before (main) |
After |
 |
 |
After three scroll steps, main is back at the top (scrollTop 50, 100, 0, repeating):
before-short-diff-loop.mp4
With the fix it reaches the end (50, 100, 146) and the header stays put:
after-short-diff-smooth.mp4
A long diff (#19827, 72 files) still condenses at scrollTop 180 and reopens at the top:
after-long-diff-condenses.mp4
I only checked the Code tab, in Chromium. Summary and Timeline use the same code path but I did not exercise them separately.
Note Created with Claude Opus 5.5 in Claude Code (T3 Code). Reviewed with GPT-6.1-Sol in Codex.
Closes #19694
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Only condense the PR detail header when more than a fold's height of
scroll range remains after the collapse, so the refund can no longer
land at the top and reopen it.
Fixes pingdotgg#19694
Codex Review Summary
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
⚠️ Failed 2026-10-15T09:54:17.312753Z |
bb29d5d |
Manual request |
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Approvability
Verdict: Approved at bb29d5d
Macroscope's review found this PR approvable — This is a small, self-contained fix to prevent short pull-request tabs from repeatedly collapsing and reopening their header. The production change is limited to one existing scroll handler, with the new predicate covered by focused tests and no schema, deployment, security, billing, or configuration impact.
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:
328f5d80-23ac-4a93-9403-e76d2b0a12ac
📥 Commits
-
Reviewing files that changed from the base of the PR and between 339179f and bb29d5d.
📒 Files selected for processing: 3
-
apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx
apps/web/src/components/pullRequest/pullRequestSummaryScroll.logic.test.ts
apps/web/src/components/pullRequest/pullRequestSummaryScroll.logic.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
📝 Walkthrough
-
The PR detail panel now uses shouldCondenseDetailChrome to decide when to condense its header. The helper checks the fold height, scroll position, and remaining scroll range. Tests cover cases where the remaining range is too short and where it is sufficient.
Changes: PR detail header scroll
| Layer / File(s) |
Summary |
Condensing eligibility and panel integration apps/web/src/components/pullRequest/pullRequestSummaryScroll.logic.ts, apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx, apps/web/src/components/pullRequest/pullRequestSummaryScroll.logic.test.ts |
The panel delegates its condensing decision to shouldCondenseDetailChrome. The helper requires a positive fold height, a scroll position more than 32 pixels beyond the fold, and enough remaining scroll range after subtracting the chrome delta. Tests check two scroll-height cases. |
Priority: ➖ Normal
Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix · Severity of issue fixed: Medium
Merge Risk: ⚪ Minimal · up to bb29d
-
Short PR diffs should scroll without the header snapping back, and long diffs should still condense the header. The change is small and local, with unit tests for both cases. I found no concrete merge-blocking risk.
Pre-merge checks: 4
-
Passed checks: 4 passed
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title clearly and concisely describes the main fix for short pull request diffs whose header repeatedly snaps back. |
| Description check |
 |
The description covers the problem, root cause, implementation, issue approval, focused tests, manual verification, screenshots, recordings, and unverified Summary and Timeline cases. |
| Linked Issues check |
 |
Issue #19694 requires the short-diff collapse/reopen loop to stop. The change adds shouldCondenseDetailChrome, which requires scrollHeight - clientHeight - chromeDelta > foldHeight before condensa… |
| Out of Scope Changes check |
 |
The reviewed changes are limited to the header condense predicate, its wiring in PullRequestDetailPanel.tsx, and focused unit tests in pullRequestSummaryScroll.logic.test.ts. The helper is shared … |
✨ 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.
Note 🤖 Claude Opus 5.5 responding on behalf of Madhav
@codex review
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”.
An unknown error occurred
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Note Written by claude-opus-5-5 on behalf of Maria
Thanks for this. I'm closing it as part of PR triage. Another PR already covers the same fix.
From the review: #15678 addresses the same header collapse loop by preserving the absolute scroll target when the browser clamps scrolling near the bottom of a short diff.
If you think this was a mistake, message me on Twitter at @maria_rcks and I'll take another look.
|
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:unvouched
Author is not yet trusted in the VOUCHED list.
Milestone
No milestone
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.
|