mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-06 16:34:36 +00:00
Two causes, both reproduced on a clone of a real long thinking-partner chat
(replies and thinking rows several screens tall, GFM tables).
1. The window lowered in e42771970 (initial 2 / batch 2 / window 5) holds only
two or three tall rows, so a fling outruns the mounted range and the viewport
crosses unmounted rows: 65 blank frames over a 4,152-frame traversal. Keep the
small initial render that bounds cold-open measurement, but refill a window of
10 in batches of 10: 0 blank frames over 4,347, p95 25 ms.
2. Scroll-to-bottom from deep history animated across every row in between,
which no finite window can mount in time: 9 blank frames (~150 ms) per jump.
Animate only when the current offset is within the bottom-side overscan,
otherwise jump instantly. Near-bottom jumps still animate. Web already does
not animate this jump.
Cold open on the same chat is unchanged (first content 569 -> 568 ms); the
deeper window costs first-scroll acknowledgement (2.58 -> 2.94 s in a debug
build).
11 lines
455 B
TypeScript
11 lines
455 B
TypeScript
export function shouldAnimateNativeScrollToBottom(input: {
|
|
offsetY: number;
|
|
viewportHeight: number;
|
|
windowSize: number;
|
|
}): boolean {
|
|
// VirtualizedList splits the extra window around the viewport. An animated
|
|
// jump farther than the bottom-side overscan crosses unmounted history.
|
|
const bottomOverscanHeight = ((input.windowSize - 1) / 2) * input.viewportHeight;
|
|
return input.viewportHeight > 0 && input.offsetY <= bottomOverscanHeight;
|
|
}
|