Files
openidea/src/ui/Scrollbar.module.css
T
l0ng-ai b99fe1704b fix(vcs): keep Git Log rows painted while dragging the scrollbar (#1914)
Dragging the Git Log scrollbar through a long history stuttered and showed
blank rows: the native scrollbar scrolls asynchronously in WebKit, so the
virtual list rendered rows a frame or more after the new offset was painted.

The list now uses a scrollbar drawn in the DOM (`Scrollbar` in `src/ui`) that
sets the offset from pointer events and notifies scroll listeners at once, so
the virtualizer renders the matching rows before the next paint. Rows are
keyed by slot so a large jump updates the mounted rows instead of rebuilding
them, overscan is lowered, and rows rendered mid-scroll draw their graph
without edge hit targets, which come back once scrolling stops.

Adds a `gitLogScrollbar` perf scenario with budgets.
2026-11-07 12:14:09 +08:00

28 lines
584 B
CSS

/* Same look as the global ::-webkit-scrollbar (global.css). */
.track {
position: absolute;
top: 0;
right: 0;
width: 10px;
z-index: 1;
}
.thumb {
position: absolute;
left: 0;
right: 0;
top: 0;
border: 2px solid transparent;
border-radius: 6px;
background-clip: content-box;
background-color: var(--scrollbar-thumb);
will-change: transform;
}
.thumb:hover,
.thumb[data-dragging] {
background-color: var(--scrollbar-thumb-hover);
}
/* For the scroller whose vertical scrollbar `Scrollbar` draws. */
.hideNative::-webkit-scrollbar:vertical {
width: 0;
}