Skip to content

fix(web): keep diff file lists scrollable past expanded files - #6423

Merged
t3dotgg merged 3 commits into
pingdotgg:mainfrom
dominic-r:dominic/fix-pr-diff-file-scroll-cutoff
Aug 13, 2026
Merged

fix(web): keep diff file lists scrollable past expanded files#6423
t3dotgg merged 3 commits into
pingdotgg:mainfrom
dominic-r:dominic/fix-pr-diff-file-scroll-cutoff

Conversation

@dominic-r

@dominic-r dominic-r commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

In a pull request's Code tab, expanding a file left the file rows after it clipped at the bottom of the scroll area — with a file open mid-list you could scroll until the next file's row peeked in cut off, and the rows past it were unreachable.

Pierre's stylesheet unconditionally paints 8px of padding under a file's last code line (--diffs-gap-fallback), but StyledDiffCodeView declared itemMetrics.paddingBottom: 0, so every expanded file's virtual height ran 8px short of its rendered height and the virtualizer's scroll range came up short by 8px per expanded file. Counting the painted 8px in the metric restores the pairing; spacing and paddingTop stay zero, so the gap above the first expanded file's header that the zeroing originally fixed does not come back. The thread diff panel shares this adapter and gets the same correction.

Validated in the running app against a live 10-file pull request: with one file or all files expanded (context hydration settled), the scroll range matches the rendered content exactly — the last row lands flush at the viewport bottom, with no new gap above or between files. Web typecheck passes.

BEFORE:

a0675f9d-7011-4775-9007-e09cdfd801c2-02812817-1b46-4c7f-9526-38e5ea738240

AFTER:

Pasted Graphic 2

🤖 Generated with Claude Code


Note

Low Risk
Single geometry constant in the shared diff adapter with no auth, data, or API changes; regression risk is limited to diff list scrolling layout.

Overview
Fixes PR Code tab (and shared diff views) clipping file rows below expanded files by setting itemMetrics.paddingBottom to 8 in StyledDiffCodeView, matching Pierre’s always-painted --diffs-gap-fallback under each file’s last line.

Previously virtual row height was 8px short per expanded file, so scroll range ended early and later files were unreachable. spacing and paddingTop stay 0 so the fix for the gap above the first expanded header is unchanged. The unit test expectation for paddingBottom is updated to 8.

Reviewed by Cursor Bugbot for commit 33d5a59. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Fix diff file list scrolling by correcting itemMetrics.paddingBottom in StyledDiffCodeView

The virtualized height calculation in StyledDiffCodeView was not accounting for the 8px bottom padding painted by the stylesheet, causing the last rows of expanded files to be clipped and the end of the list to be unreachable via scrolling. Sets itemMetrics.paddingBottom from 0 to 8 in StyledDiffCodeView.tsx to match the actual rendered gap.

Macroscope summarized 33d5a59.

Pierre's stylesheet unconditionally paints 8px of padding under a file's
last code line (--diffs-gap-fallback), but our itemMetrics declared
paddingBottom: 0, so every expanded file's virtual height ran 8px short
of its rendered height. The accumulated deficit pushed the end of the
list past the reachable scroll range: in a pull request's Code tab,
expanding a file left the following file rows clipped at max scroll.

Count the painted 8px in the metric. spacing and paddingTop stay zero,
so the gap above the first expanded file's header this block guards
against does not come back.

Validated against a live 10-file pull request: with one or all files
expanded, the scroll range now matches the rendered content exactly and
the last row lands flush at the viewport bottom, with no new gap above
or between files.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 264f1ac8-a4f4-4395-aea4-b22bb08aed10

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Aug 13, 2026
dominic-r and others added 2 commits August 12, 2026 22:52
The adapter test pins the styling/geometry pairing and still expected
the old paddingBottom: 0 that clipped the list tail.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@macroscopeapp

macroscopeapp Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved 33d5a59

This is a straightforward UI bug fix that corrects a scroll calculation error by adjusting a padding metric from 0 to 8 pixels. The change is minimal, well-documented with a clear comment explaining the root cause, and includes an updated test.

You can customize Macroscope's approvability policy. Learn more.

@t3dotgg
t3dotgg merged commit 6bc6cb6 into pingdotgg:main Aug 13, 2026
17 of 18 checks passed
@dominic-r
dominic-r deleted the dominic/fix-pr-diff-file-scroll-cutoff branch August 13, 2026 03:12
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Aug 13, 2026
0veek pushed a commit to 0veek/Ronin that referenced this pull request Aug 13, 2026
…tgg#6423)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit 6bc6cb6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants