feat: enhance LeadThoughtsGroup UI and tool preview handling

- Updated LeadThoughtsGroup component to visually distinguish 'Agent' and 'TaskCreate' tool calls with specific styling and icons.
- Increased the character limit for tool previews from 60 to 200 in the extractToolPreview function, allowing for more detailed descriptions.
- Improved overall tooltip display for better user insights into tool usage.
This commit is contained in:
iliya 2026-03-06 16:21:27 +02:00
parent ff5e877023
commit f61077d4ee
2 changed files with 20 additions and 8 deletions

View file

@ -115,12 +115,24 @@ function ToolSummaryTooltipContent({
<div className="mb-0.5 text-[10px] text-text-secondary"> <div className="mb-0.5 text-[10px] text-text-secondary">
{toolCalls.length} {toolCalls.length === 1 ? 'tool call' : 'tool calls'} {toolCalls.length} {toolCalls.length === 1 ? 'tool call' : 'tool calls'}
</div> </div>
{toolCalls.map((tc, i) => ( {toolCalls.map((tc, i) => {
<div key={i} className="flex items-baseline gap-2"> const isAgent = tc.name === 'Agent' || tc.name === 'TaskCreate';
<span className="shrink-0 font-semibold">{tc.name}</span> return (
{tc.preview && <span className="truncate text-text-secondary">{tc.preview}</span>} <div key={i} className={`flex items-baseline gap-2 ${isAgent ? 'mt-0.5' : ''}`}>
</div> <span className={`shrink-0 font-semibold ${isAgent ? 'text-violet-400' : ''}`}>
))} {isAgent ? '🤖 ' : ''}
{tc.name}
</span>
{tc.preview && (
<span
className={`text-text-secondary ${isAgent ? 'whitespace-pre-wrap' : 'truncate'}`}
>
{tc.preview}
</span>
)}
</div>
);
})}
</div> </div>
); );
} }

View file

@ -96,9 +96,9 @@ export function extractToolPreview(
case 'Agent': case 'Agent':
case 'TaskCreate': case 'TaskCreate':
return typeof input.prompt === 'string' return typeof input.prompt === 'string'
? truncateStr(input.prompt, 60) ? truncateStr(input.prompt, 200)
: typeof input.description === 'string' : typeof input.description === 'string'
? truncateStr(input.description, 60) ? truncateStr(input.description, 200)
: undefined; : undefined;
case 'WebFetch': case 'WebFetch':
if (typeof input.url === 'string') { if (typeof input.url === 'string') {