From ae8e4d854b150b3f69ddfc647dc8cd615a7ffc2d Mon Sep 17 00:00:00 2001 From: Roo Code Date: Thu, 7 Aug 2025 00:34:34 +0000 Subject: [PATCH] fix: make error display less jarring by matching diff_error style - Added collapsible UI for error messages similar to diff_error display - Added copy button for error text - Added expand/collapse chevron indicator - Error text now appears in a subtle background container when expanded - Maintains error icon and color but in a less jarring presentation --- webview-ui/src/components/chat/ChatRow.tsx | 99 ++++++++++++++++++++-- 1 file changed, 91 insertions(+), 8 deletions(-) diff --git a/webview-ui/src/components/chat/ChatRow.tsx b/webview-ui/src/components/chat/ChatRow.tsx index 4fa921f443..d829f18353 100644 --- a/webview-ui/src/components/chat/ChatRow.tsx +++ b/webview-ui/src/components/chat/ChatRow.tsx @@ -118,6 +118,8 @@ export const ChatRowContent = ({ const [reasoningCollapsed, setReasoningCollapsed] = useState(true) const [isDiffErrorExpanded, setIsDiffErrorExpanded] = useState(false) const [showCopySuccess, setShowCopySuccess] = useState(false) + const [isErrorExpanded, setIsErrorExpanded] = useState(false) + const [showErrorCopySuccess, setShowErrorCopySuccess] = useState(false) const [isEditing, setIsEditing] = useState(false) const [editedContent, setEditedContent] = useState("") const [editMode, setEditMode] = useState(mode || "code") @@ -1132,15 +1134,96 @@ export const ChatRowContent = ({ ) case "error": return ( - <> - {title && ( -
- {icon} - {title} +
+
+
setIsErrorExpanded(!isErrorExpanded)}> +
+ + + {t("chat:error")} + +
+
+ { + e.stopPropagation() + + // Call copyWithFeedback and handle the Promise + copyWithFeedback(message.text || "").then((success) => { + if (success) { + // Show checkmark + setShowErrorCopySuccess(true) + + // Reset after a brief delay + setTimeout(() => { + setShowErrorCopySuccess(false) + }, 1000) + } + }) + }}> + + + +
- )} -

{message.text}

- + {isErrorExpanded && ( +
+

+ {message.text} +

+
+ )} +
+
) case "completion_result": return (