From 80c6396b6598963b304f081ec23bea6ca6591c05 Mon Sep 17 00:00:00 2001 From: Taylor Ho Date: Mon, 14 Jul 2025 21:48:21 -0700 Subject: [PATCH 1/3] fix: improved contrast of tool calls --- .../src/components/ToolCallWithResponse.tsx | 150 +++++++++--------- ui/desktop/src/components/ui/Dot.tsx | 2 +- ui/desktop/src/styles/main.css | 2 +- 3 files changed, 76 insertions(+), 78 deletions(-) diff --git a/ui/desktop/src/components/ToolCallWithResponse.tsx b/ui/desktop/src/components/ToolCallWithResponse.tsx index b8787d0fc16f..ebb824451363 100644 --- a/ui/desktop/src/components/ToolCallWithResponse.tsx +++ b/ui/desktop/src/components/ToolCallWithResponse.tsx @@ -3,9 +3,10 @@ import { Button } from './ui/button'; import { ToolCallArguments, ToolCallArgumentValue } from './ToolCallArguments'; import MarkdownContent from './MarkdownContent'; import { Content, ToolRequestMessageContent, ToolResponseMessageContent } from '../types/message'; -import { snakeToTitleCase } from '../utils'; +import { cn, snakeToTitleCase } from '../utils'; import Dot, { LoadingStatus } from './ui/Dot'; import { NotificationEvent } from '../hooks/useMessageStream'; +import { ChevronRight } from 'lucide-react'; interface ToolCallWithResponseProps { isCancelledMessage: boolean; @@ -26,7 +27,11 @@ export default function ToolCallWithResponse({ } return ( -
+
); @@ -58,11 +63,16 @@ function ToolCallExpandable({
{isExpanded &&
{children}
}
@@ -358,76 +368,65 @@ function ToolCallView({ }; return ( -
- - - - {(() => { - const description = getToolDescription(); - if (description) { - return description; - } - // Fallback to the original tool name formatting - return snakeToTitleCase( - toolCall.name.substring(toolCall.name.lastIndexOf('__') + 2) - ); - })()} - - - } - > - {/* Tool Details */} - {isToolDetails && ( -
- -
- )} - - {logs && logs.length > 0 && ( -
- + + + {(() => { + const description = getToolDescription(); + if (description) { + return description; } - /> + // Fallback to the original tool name formatting + return snakeToTitleCase(toolCall.name.substring(toolCall.name.lastIndexOf('__') + 2)); + })()} + + + } + > + {/* Tool Details */} + {isToolDetails && ( +
+ +
+ )} + + {logs && logs.length > 0 && ( +
+ +
+ )} + + {toolResults.length === 0 && + progressEntries.length > 0 && + progressEntries.map((entry, index) => ( +
+
- )} + ))} - {toolResults.length === 0 && - progressEntries.length > 0 && - progressEntries.map((entry, index) => ( -
- -
- ))} - - {/* Tool Output */} - {!isCancelledMessage && ( - <> - {toolResults.map(({ result, isExpandToolResults }, index) => { - const isLast = index === toolResults.length - 1; - return ( -
0 ? '' : 'rounded-t'} - ${isLast ? 'rounded-b' : ''} - `} - > - -
- ); - })} - - )} - -
+ {/* Tool Output */} + {!isCancelledMessage && ( + <> + {toolResults.map(({ result, isExpandToolResults }, index) => { + return ( +
+ +
+ ); + })} + + )} +
); } @@ -442,11 +441,10 @@ interface ToolDetailsViewProps { function ToolDetailsView({ toolCall, isStartExpanded }: ToolDetailsViewProps) { return ( Tool Details} - className="py-1" + label={Tool Details} isStartExpanded={isStartExpanded} > -
+
{toolCall.arguments && ( } /> )} @@ -466,7 +464,7 @@ function ToolResultView({ result, isStartExpanded }: ToolResultViewProps) { label={Output} isStartExpanded={isStartExpanded} > -
+
{result.type === 'text' && result.text && (
{logs.map((log, i) => ( diff --git a/ui/desktop/src/components/ui/Dot.tsx b/ui/desktop/src/components/ui/Dot.tsx index 7d2d7c84170a..8c8d02c1eb56 100644 --- a/ui/desktop/src/components/ui/Dot.tsx +++ b/ui/desktop/src/components/ui/Dot.tsx @@ -7,7 +7,7 @@ export default function Dot({ loadingStatus: LoadingStatus; }) { const backgroundColorClasses = { - loading: 'bg-background-accent', + loading: 'bg-blue-500', success: 'bg-green-600', error: 'bg-red-600', }; diff --git a/ui/desktop/src/styles/main.css b/ui/desktop/src/styles/main.css index 96a4252f829d..19b8cebdcfa0 100644 --- a/ui/desktop/src/styles/main.css +++ b/ui/desktop/src/styles/main.css @@ -124,7 +124,7 @@ --background-info: var(--color-blue-100); --background-warning: var(--color-yellow-100); - --border-default: var(--color-neutral-800); + --border-default: var(--color-neutral-900); --border-input: var(--color-neutral-800); --border-strong: var(--color-neutral-700); --border-danger: var(--color-red-100); From 43e6651519ffcea2bd2af3877d03e922a828d6ef Mon Sep 17 00:00:00 2001 From: Taylor Ho Date: Mon, 14 Jul 2025 22:16:50 -0700 Subject: [PATCH 2/3] feat: using loading spinner when loading --- ui/desktop/src/components/ToolCallWithResponse.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ui/desktop/src/components/ToolCallWithResponse.tsx b/ui/desktop/src/components/ToolCallWithResponse.tsx index ebb824451363..a0689deca55c 100644 --- a/ui/desktop/src/components/ToolCallWithResponse.tsx +++ b/ui/desktop/src/components/ToolCallWithResponse.tsx @@ -6,7 +6,7 @@ import { Content, ToolRequestMessageContent, ToolResponseMessageContent } from ' import { cn, snakeToTitleCase } from '../utils'; import Dot, { LoadingStatus } from './ui/Dot'; import { NotificationEvent } from '../hooks/useMessageStream'; -import { ChevronRight } from 'lucide-react'; +import { ChevronRight, LoaderCircle } from 'lucide-react'; interface ToolCallWithResponseProps { isCancelledMessage: boolean; @@ -373,8 +373,14 @@ function ToolCallView({ isForceExpand={isShouldExpand} label={ <> - - +
+ {loadingStatus === 'loading' ? ( + + ) : ( + + )} +
+ {(() => { const description = getToolDescription(); if (description) { From 36734345a5cdf74e9001fcbf9b892f799170775b Mon Sep 17 00:00:00 2001 From: Taylor Ho Date: Mon, 14 Jul 2025 23:04:50 -0700 Subject: [PATCH 3/3] fix: adjusts layout of toolcall detail view --- ui/desktop/src/components/ToolCallArguments.tsx | 4 ++-- ui/desktop/src/components/ToolCallWithResponse.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/desktop/src/components/ToolCallArguments.tsx b/ui/desktop/src/components/ToolCallArguments.tsx index 216bbfbe793f..b435b2e1df95 100644 --- a/ui/desktop/src/components/ToolCallArguments.tsx +++ b/ui/desktop/src/components/ToolCallArguments.tsx @@ -28,7 +28,7 @@ export function ToolCallArguments({ args }: ToolCallArgumentsProps) { if (!needsExpansion) { return ( -
+
{key} {value} @@ -78,7 +78,7 @@ export function ToolCallArguments({ args }: ToolCallArgumentsProps) { return (
-
+
{key}
             {content}
diff --git a/ui/desktop/src/components/ToolCallWithResponse.tsx b/ui/desktop/src/components/ToolCallWithResponse.tsx
index a0689deca55c..4becd5721aa1 100644
--- a/ui/desktop/src/components/ToolCallWithResponse.tsx
+++ b/ui/desktop/src/components/ToolCallWithResponse.tsx
@@ -450,7 +450,7 @@ function ToolDetailsView({ toolCall, isStartExpanded }: ToolDetailsViewProps) {
       label={Tool Details}
       isStartExpanded={isStartExpanded}
     >
-      
+
{toolCall.arguments && ( } /> )}