fix(web): keep diff file lists scrollable past expanded files - #6423
Conversation
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>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
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>
ApprovabilityVerdict: 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. |
## What's Changed * fix(web): keep diff file lists scrollable past expanded files by @dominic-r in pingdotgg/t3code#6423 **Full Changelog**: pingdotgg/t3code@v0.0.34-nightly.20260813.1081...v0.0.34-nightly.20260813.1082 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.34-nightly.20260813.1082
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), butStyledDiffCodeViewdeclareditemMetrics.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;spacingandpaddingTopstay 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:
AFTER:
🤖 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.paddingBottomto8inStyledDiffCodeView, matching Pierre’s always-painted--diffs-gap-fallbackunder 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.
spacingandpaddingTopstay0so the fix for the gap above the first expanded header is unchanged. The unit test expectation forpaddingBottomis updated to8.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.paddingBottominStyledDiffCodeViewThe virtualized height calculation in
StyledDiffCodeViewwas 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. SetsitemMetrics.paddingBottomfrom0to8in StyledDiffCodeView.tsx to match the actual rendered gap.Macroscope summarized 33d5a59.