From 01971741e05a22e0402ac6c755ce0eced8f2930b Mon Sep 17 00:00:00 2001 From: Brandon Keiji Date: Fri, 23 May 2025 05:28:31 +0000 Subject: feat: add emphasis to tool confirmations (#502) --- .../ui/components/messages/ToolGroupMessage.tsx | 53 ++++++++++++++-------- 1 file changed, 33 insertions(+), 20 deletions(-) (limited to 'packages/cli/src/ui/components/messages/ToolGroupMessage.tsx') diff --git a/packages/cli/src/ui/components/messages/ToolGroupMessage.tsx b/packages/cli/src/ui/components/messages/ToolGroupMessage.tsx index 4b2c7dfe..8bcde3bb 100644 --- a/packages/cli/src/ui/components/messages/ToolGroupMessage.tsx +++ b/packages/cli/src/ui/components/messages/ToolGroupMessage.tsx @@ -29,6 +29,8 @@ export const ToolGroupMessage: React.FC = ({ const staticHeight = /* border */ 2 + /* marginBottom */ 1; + // only prompt for tool approval on the first 'confirming' tool in the list + // note, after the CTA, this automatically moves over to the next 'confirming' tool const toolAwaitingApproval = useMemo( () => toolCalls.find((tc) => tc.status === ToolCallStatus.Confirming), [toolCalls], @@ -50,27 +52,38 @@ export const ToolGroupMessage: React.FC = ({ borderColor={borderColor} marginBottom={1} > - {toolCalls.map((tool) => ( - - - {tool.status === ToolCallStatus.Confirming && - tool.callId === toolAwaitingApproval?.callId && - tool.confirmationDetails && ( - { + const isConfirming = toolAwaitingApproval?.callId === tool.callId; + return ( + + + - )} - - ))} + availableTerminalHeight={availableTerminalHeight - staticHeight} + emphasis={ + isConfirming + ? 'high' + : toolAwaitingApproval + ? 'low' + : 'medium' + } + /> + + {tool.status === ToolCallStatus.Confirming && + isConfirming && + tool.confirmationDetails && ( + + )} + + ); + })} ); }; -- cgit v1.2.3