Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/20260817145404-agents-library-row-icons.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@truefoundry/trueforge-ui': patch
---

Agents Library rows: show connectors before skills, use the composer's lightbulb icon for skills, and reveal the connector/skill names in a tooltip on hover.
25 changes: 17 additions & 8 deletions packages/trueforge-ui/src/atoms/AgentsLibrary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { useSearchAgentsList } from './lib/useSearchAgentsList.js';
import { CenteredModal } from './primitives/CenteredModal.js';
import SearchInput from './primitives/SearchInput.js';
import { Skeleton } from './primitives/Skeleton.js';
import { Tooltip } from './primitives/Tooltip.js';

export type AgentsLibraryProps = {
open: boolean;
Expand All @@ -36,6 +37,10 @@ function AgentLibraryRow({ agent, showEdit, onTry, onEdit }: AgentLibraryRowProp
const modelName = spec?.model.name;
const skillsCount = spec?.skills?.length ?? 0;
const mcpCount = spec?.mcpServers?.length ?? 0;
const skillNames = (spec?.skills ?? []).map(s => (s as { name?: string }).name).filter(Boolean);
const mcpNames = (spec?.mcpServers ?? []).map(m => (m as { name?: string }).name).filter(Boolean);
Comment thread
shubhamagarwal-create marked this conversation as resolved.
const connectorsTitle = mcpNames.length ? `Connectors: ${mcpNames.join(', ')}` : `${mcpCount} connectors`;
const skillsTitle = skillNames.length ? `Skills: ${skillNames.join(', ')}` : `${skillsCount} skills`;

return (
<div
Expand All @@ -60,14 +65,18 @@ function AgentLibraryRow({ agent, showEdit, onTry, onEdit }: AgentLibraryRowProp
<span className="truncate">{displayModelLabel(modelName)}</span>
</span>
) : null}
<span className="inline-flex items-center gap-1 text-xs" aria-label={`${skillsCount} skills`}>
<Icon name="wrench" className="size-3.5" />
{skillsCount}
</span>
<span className="inline-flex items-center gap-1 text-xs" aria-label={`${mcpCount} MCP servers`}>
<Icon name="plug" className="size-3.5" />
{mcpCount}
</span>
<Tooltip content={connectorsTitle}>
<span className="inline-flex items-center gap-1 text-xs" aria-label={connectorsTitle}>
<Icon name="plug" className="size-3.5" />
{mcpCount}
</span>
</Tooltip>
<Tooltip content={skillsTitle}>
<span className="inline-flex items-center gap-1 text-xs" aria-label={skillsTitle}>
<Icon name="lightbulb" className="size-3.5" />
{skillsCount}
</span>
</Tooltip>
Comment thread
shubhamagarwal-create marked this conversation as resolved.
</span>
) : null}
<span className="flex shrink-0 items-center gap-1.5">
Expand Down
4 changes: 2 additions & 2 deletions packages/trueforge-ui/test/atoms/AgentsLibrary.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ describe('AgentsLibrary', () => {
await waitFor(() => {
expect(screen.getByText('gpt-5-5')).toBeInTheDocument();
});
expect(screen.getByLabelText('1 skills')).toBeInTheDocument();
expect(screen.getByLabelText('1 MCP servers')).toBeInTheDocument();
expect(screen.getByLabelText('Connectors: github')).toBeInTheDocument();
expect(screen.getByLabelText('Skills: paint')).toBeInTheDocument();
expect(screen.getByRole('button', { name: 'Try agent bare' })).toBeInTheDocument();
expect(screen.queryByLabelText('0 skills')).not.toBeInTheDocument();
});
Expand Down