From 97599786fcd56063ee77ec78b496205a99be61f8 Mon Sep 17 00:00:00 2001 From: Roo Code Date: Sat, 18 Oct 2025 22:03:31 +0000 Subject: [PATCH] fix(chat): allow editing historical messages while streaming and prevent auto-jump to bottom; ensure edit area scrolls into view --- webview-ui/src/components/chat/ChatRow.tsx | 8 +++++--- webview-ui/src/components/chat/ChatView.tsx | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/webview-ui/src/components/chat/ChatRow.tsx b/webview-ui/src/components/chat/ChatRow.tsx index 10de013ef1..112a2be809 100644 --- a/webview-ui/src/components/chat/ChatRow.tsx +++ b/webview-ui/src/components/chat/ChatRow.tsx @@ -1164,9 +1164,11 @@ export const ChatRowContent = ({ className="flex-grow px-2 py-1 wrap-anywhere rounded-lg transition-colors" onClick={(e) => { e.stopPropagation() - if (!isStreaming) { - handleEditClick() + // Allow editing historical messages even while streaming; only block when this is the last message and streaming + if (isStreaming && isLast) { + return } + handleEditClick() }} title={t("chat:queuedMessages.clickToEdit")}> @@ -1174,7 +1176,7 @@ export const ChatRowContent = ({
{ e.stopPropagation() handleEditClick() diff --git a/webview-ui/src/components/chat/ChatView.tsx b/webview-ui/src/components/chat/ChatView.tsx index d358c68f1c..a617e7ba20 100644 --- a/webview-ui/src/components/chat/ChatView.tsx +++ b/webview-ui/src/components/chat/ChatView.tsx @@ -1384,7 +1384,9 @@ const ChatViewComponent: React.ForwardRefRenderFunction { - if (!disableAutoScrollRef.current) { + // Only auto-scroll when user is already at the bottom. + // This prevents editing a historical message from forcing the list to jump to the bottom. + if (!disableAutoScrollRef.current && isAtBottom) { if (isTaller) { scrollToBottomSmooth() } else { @@ -1392,7 +1394,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction {