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:
parent
ff5e877023
commit
f61077d4ee
2 changed files with 20 additions and 8 deletions
|
|
@ -115,12 +115,24 @@ function ToolSummaryTooltipContent({
|
|||
<div className="mb-0.5 text-[10px] text-text-secondary">
|
||||
{toolCalls.length} {toolCalls.length === 1 ? 'tool call' : 'tool calls'}
|
||||
</div>
|
||||
{toolCalls.map((tc, i) => (
|
||||
<div key={i} className="flex items-baseline gap-2">
|
||||
<span className="shrink-0 font-semibold">{tc.name}</span>
|
||||
{tc.preview && <span className="truncate text-text-secondary">{tc.preview}</span>}
|
||||
</div>
|
||||
))}
|
||||
{toolCalls.map((tc, i) => {
|
||||
const isAgent = tc.name === 'Agent' || tc.name === 'TaskCreate';
|
||||
return (
|
||||
<div key={i} className={`flex items-baseline gap-2 ${isAgent ? 'mt-0.5' : ''}`}>
|
||||
<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>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,9 +96,9 @@ export function extractToolPreview(
|
|||
case 'Agent':
|
||||
case 'TaskCreate':
|
||||
return typeof input.prompt === 'string'
|
||||
? truncateStr(input.prompt, 60)
|
||||
? truncateStr(input.prompt, 200)
|
||||
: typeof input.description === 'string'
|
||||
? truncateStr(input.description, 60)
|
||||
? truncateStr(input.description, 200)
|
||||
: undefined;
|
||||
case 'WebFetch':
|
||||
if (typeof input.url === 'string') {
|
||||
|
|
|
|||
Loading…
Reference in a new issue