From daaedc65963f8598dd50def679a4c4a7b60338d8 Mon Sep 17 00:00:00 2001 From: Roo Code Date: Tue, 21 Oct 2025 19:13:06 +0000 Subject: [PATCH] refactor: address code review feedback - Remove code duplication in icon rendering logic - Use existing icon variable for non-expandable states - Fix CodeAccordion onToggleExpand handler --- webview-ui/src/components/chat/ChatRow.tsx | 55 ++-------------------- 1 file changed, 4 insertions(+), 51 deletions(-) diff --git a/webview-ui/src/components/chat/ChatRow.tsx b/webview-ui/src/components/chat/ChatRow.tsx index b10e5c67d9..f042f06db3 100644 --- a/webview-ui/src/components/chat/ChatRow.tsx +++ b/webview-ui/src/components/chat/ChatRow.tsx @@ -1053,41 +1053,8 @@ export const ChatRowContent = ({ }} onClick={canExpand ? handleToggleExpand : undefined}>
- {apiReqCancelReason !== null && apiReqCancelReason !== undefined ? ( - apiReqCancelReason === "user_cancelled" ? ( -
- -
- ) : ( -
- -
- ) - ) : canExpand ? ( + {/* Use chevron icon for expandable completed requests, otherwise use the computed icon */} + {canExpand ? (
- ) : apiRequestFailedMessage ? ( -
- -
) : ( - + icon )} {title}
@@ -1133,7 +1086,7 @@ export const ChatRowContent = ({ code={message.text} language="json" isExpanded={true} - onToggleExpand={() => {}} + onToggleExpand={handleToggleExpand} /> )}