From c687086b69bde9185c310f778f3abe1868ff0f2e Mon Sep 17 00:00:00 2001 From: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com> Date: Thu, 3 Oct 2024 03:00:55 -0400 Subject: [PATCH] Fixes --- webview-ui/src/components/chat/ChatView.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/webview-ui/src/components/chat/ChatView.tsx b/webview-ui/src/components/chat/ChatView.tsx index e651287..5e39978 100644 --- a/webview-ui/src/components/chat/ChatView.tsx +++ b/webview-ui/src/components/chat/ChatView.tsx @@ -508,7 +508,10 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie const lastMessage = messages.at(-1) if (lastMessage && lastMessage.say === "api_req_retried") { // unique case where the api_req_started row will shrink in size when scrollview at bottom, causing didScrollUp to get set to true and followoutput to break. To mitigate this when an api request is retried, it's safe to assume they're already scrolled to the bottom - scrollToBottomAuto() + const timer = setTimeout(() => { + scrollToBottomAuto() + }, 0) + return () => clearTimeout(timer) } }, [messages, scrollToBottomAuto])