Skip to content

Commit 9df6649

Browse files
committed
fix(chat): integrate sticky follow with Virtuoso followOutput; remove forced scroll in atBottomStateChange to reduce jank
1 parent f858676 commit 9df6649

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

webview-ui/src/components/chat/ChatView.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1869,14 +1869,11 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
18691869
increaseViewportBy={{ top: 3_000, bottom: 1000 }}
18701870
data={groupedMessages}
18711871
itemContent={itemContent}
1872-
followOutput="smooth"
1872+
followOutput={(isAtBottom: boolean) => isAtBottom || stickyFollowRef.current}
18731873
atBottomStateChange={(isAtBottom: boolean) => {
18741874
setIsAtBottom(isAtBottom)
1875+
// Only show the scroll-to-bottom button if not at bottom
18751876
setShowScrollToBottom(!isAtBottom)
1876-
if (!isAtBottom && stickyFollowRef.current) {
1877-
// While in sticky mode, force-pin as streaming increases height
1878-
scrollToBottomAuto()
1879-
}
18801877
}}
18811878
atBottomThreshold={10}
18821879
initialTopMostItemIndex={groupedMessages.length - 1}

0 commit comments

Comments
 (0)