From b50f1e747908085bd12dccc94cdb8ee15353fd88 Mon Sep 17 00:00:00 2001
From: Sean Hatfield <seanhatfield5@gmail.com>
Date: Mon, 22 Apr 2024 15:06:48 -0700
Subject: [PATCH] [FEAT] Improve autoscroll during message streaming (#1139)

emulate chatgpt autoscroll to not always force autoscroll when streaming responses
---
 .../WorkspaceChat/ChatContainer/ChatHistory/index.jsx           | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/index.jsx b/frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/index.jsx
index dc7331476..8fa4815dc 100644
--- a/frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/index.jsx
+++ b/frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/index.jsx
@@ -14,7 +14,7 @@ export default function ChatHistory({ history = [], workspace, sendCommand }) {
   const chatHistoryRef = useRef(null);
 
   useEffect(() => {
-    scrollToBottom();
+    if (isAtBottom) scrollToBottom();
   }, [history]);
 
   const handleScroll = () => {
-- 
GitLab