Skip to content

Commit 463ac4e

Browse files
fix(web): keep wrapped split diffs from jumping while scrolling
1 parent 26fffe5 commit 463ac4e

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ import { DiffWorkerPoolProvider } from "../DiffWorkerPoolProvider";
1414

1515
/** The app's diff stylesheet, shared by single-file renderers so their separators match. */
1616
export const DIFF_VIEW_UNSAFE_CSS = `${DIFF_SURFACE_THEME_UNSAFE_CSS}
17+
/* A 1fr track's automatic minimum grows with the currently mounted lines. In split
18+
wrap mode that shifts width between columns, rewraps rows and makes the virtualizer
19+
repeatedly correct the scroll position. Keep both code columns at the same width. */
20+
[data-diff-type="split"][data-overflow="wrap"] {
21+
--diffs-code-grid: var(--diffs-grid-number-column-width) minmax(0, 1fr);
22+
}
23+
1724
:is(
1825
[data-line],
1926
[data-line-annotation],

0 commit comments

Comments
 (0)