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 {