From 809167d7a5cfb104705e229d2b83c30ec69a58da Mon Sep 17 00:00:00 2001 From: Roo Code Date: Tue, 21 Oct 2025 19:01:02 +0000 Subject: [PATCH] fix: add expand/collapse functionality to API Request section - Replace static double-arrow icon with expandable chevron for completed API requests - Add click handler to toggle expansion state - Display API request details in CodeAccordian when expanded - Maintain consistent UI behavior with other expandable sections Fixes #8755 --- webview-ui/src/components/chat/ChatRow.tsx | 86 +++++++++++++++++++++- 1 file changed, 83 insertions(+), 3 deletions(-) diff --git a/webview-ui/src/components/chat/ChatRow.tsx b/webview-ui/src/components/chat/ChatRow.tsx index b0b87e7a2d..b10e5c67d9 100644 --- a/webview-ui/src/components/chat/ChatRow.tsx +++ b/webview-ui/src/components/chat/ChatRow.tsx @@ -1032,12 +1032,16 @@ export const ChatRowContent = ({ const isApiRequestInProgress = apiReqCancelReason === undefined && apiRequestFailedMessage === undefined && cost === undefined + // For completed requests (with cost), make them expandable + const isCompletedRequest = cost !== null && cost !== undefined + const canExpand = isCompletedRequest && message.text !== null && message.text !== undefined + return ( <>
+ }} + onClick={canExpand ? handleToggleExpand : undefined}>
- {icon} + {apiReqCancelReason !== null && apiReqCancelReason !== undefined ? ( + apiReqCancelReason === "user_cancelled" ? ( +
+ +
+ ) : ( +
+ +
+ ) + ) : canExpand ? ( +
+ +
+ ) : apiRequestFailedMessage ? ( +
+ +
+ ) : ( + + )} {title}
+ {/* Show API request details when expanded */} + {canExpand && isExpanded && message.text && ( +
+ {}} + /> +
+ )} {(((cost === null || cost === undefined) && apiRequestFailedMessage) || apiReqStreamingFailedMessage) && (