Skip to content

Commit 6bc6cb6

Browse files
dominic-rclaude
andauthored
fix(web): keep diff file lists scrollable past expanded files (#6423)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 1e59b4c commit 6bc6cb6

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

apps/web/src/components/diffs/StyledDiffCodeView.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe("StyledDiffCodeView", () => {
4444
diffHeaderHeight: 32,
4545
hunkSeparatorHeight: 24,
4646
paddingTop: 0,
47-
paddingBottom: 0,
47+
paddingBottom: 8,
4848
},
4949
layout: { paddingTop: 0, paddingBottom: 0, gap: 0 },
5050
});

apps/web/src/components/diffs/StyledDiffCodeView.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,16 @@ export function StyledDiffCodeView<LAnnotation = undefined>({
304304
diffHeaderHeight: 32,
305305
hunkSeparatorHeight: 24,
306306
// Pierre uses its general file spacing as a fallback in expanded-file layout paths.
307-
// Keep it zero alongside the explicit paddings or expanding the first file can
307+
// Keep it zero alongside the explicit paddingTop or expanding the first file can
308308
// reintroduce the library's default 8px gap above its header.
309309
spacing: 0,
310310
paddingTop: 0,
311-
paddingBottom: 0,
311+
// Unlike the gap above, the 8px under a file's last line is painted
312+
// unconditionally by Pierre's stylesheet (`--diffs-gap-fallback`), so the metric has
313+
// to count it: at zero every expanded file's virtual height ran 8px short of its
314+
// rendered height, and the end of the list sat past the reachable scroll range —
315+
// one clipped file row per expanded file above it.
316+
paddingBottom: 8,
312317
},
313318
layout: { paddingTop: 0, paddingBottom: 0, gap: 0 },
314319
}}

0 commit comments

Comments
 (0)