From d1ad919a440948d73ad74a3b18d963a0763bb08e Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Sat, 23 May 2026 14:11:44 -0500 Subject: [PATCH] test(tui): clarify virtual history resize snapshot Update the resize regression and comments so the test specifically guards viewport-height changes in the virtual-history snapshot key. --- ui-tui/src/hooks/useVirtualHistory.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ui-tui/src/hooks/useVirtualHistory.ts b/ui-tui/src/hooks/useVirtualHistory.ts index dddf999e365..ad78220c10c 100644 --- a/ui-tui/src/hooks/useVirtualHistory.ts +++ b/ui-tui/src/hooks/useVirtualHistory.ts @@ -186,11 +186,9 @@ export function useVirtualHistory( }, [scrollRef]) // Quantized snapshot: same-bin scrolls (most wheel ticks) produce the same - // number → React.Object.is short-circuits the commit entirely. sticky state - // is folded in via the sign bit so sticky→broken transitions also trigger. - // Uses the TARGET (committed + pendingDelta), not committed scrollTop, so - // scrollBy notifications immediately remount for the destination before - // Ink's drain frames need the children. + // key → React.Object.is short-circuits the commit entirely. The key includes + // sticky state, target scroll position, and viewport height so resize-only + // changes still recompute the mounted transcript window. const subscribe = useCallback( (cb: () => void) => (hasScrollRef ? scrollRef.current?.subscribe(cb) : null) ?? NOOP, [hasScrollRef, scrollRef]