revert: restore stable chat history scrolling

This commit is contained in:
Bohdan Triapitsyn
2026-06-14 23:06:03 +03:00
parent 296177357b
commit 928b7ff1d6
2 changed files with 5 additions and 15 deletions
+1 -3
View File
@@ -411,9 +411,7 @@ export const useChatAutoFollow = ({
}, [sessionIsWorking, startFollowLoop]);
// Replay a deferred restoreSnapshot once ChatViewport mounts.
// useLayoutEffect ensures scroll position is set before the browser paints,
// preventing a visible flash of content at the wrong scroll position.
React.useLayoutEffect(() => {
React.useEffect(() => {
if (!containerEl) return;
if (pendingInitialRestoreRef.current && pendingInitialRestoreRef.current === currentSessionId) {
void restoreSnapshot();