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) && (