From b6ebac07bbe973afa5fd8f342d1c3fe2cfc13e5d Mon Sep 17 00:00:00 2001 From: klopez4212 Date: Thu, 25 Jun 2026 14:21:04 +0100 Subject: [PATCH] Restore card model and error affordances --- .../features/agents/ui/AgentIdentityCard.tsx | 20 ++++++++++++++++--- .../agents/ui/IdentityInitialsAvatar.tsx | 4 ++-- .../agents/ui/UnifiedAgentsSection.tsx | 10 ++++++++++ 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/desktop/src/features/agents/ui/AgentIdentityCard.tsx b/desktop/src/features/agents/ui/AgentIdentityCard.tsx index 8dea118cb1..5c27d54518 100644 --- a/desktop/src/features/agents/ui/AgentIdentityCard.tsx +++ b/desktop/src/features/agents/ui/AgentIdentityCard.tsx @@ -10,6 +10,8 @@ type AgentIdentityCardProps = { avatarUrl?: string | null; dataTestId: string; label: string; + errorLabel?: string | null; + modelControl?: ReactNode; modelLabel: string; onClick: () => void; status?: ReactNode; @@ -20,7 +22,9 @@ export function AgentIdentityCard({ ariaLabel, avatarUrl, dataTestId, + errorLabel, label, + modelControl, modelLabel, onClick, status, @@ -68,9 +72,19 @@ export function AgentIdentityCard({ {label} - - {modelLabel} - + {modelControl ?? ( + + {modelLabel} + + )} + {errorLabel ? ( + + {errorLabel} + + ) : null} ); diff --git a/desktop/src/features/agents/ui/IdentityInitialsAvatar.tsx b/desktop/src/features/agents/ui/IdentityInitialsAvatar.tsx index 71fa310656..0381ebc03b 100644 --- a/desktop/src/features/agents/ui/IdentityInitialsAvatar.tsx +++ b/desktop/src/features/agents/ui/IdentityInitialsAvatar.tsx @@ -34,16 +34,16 @@ export function IdentityInitialsAvatar({ IDENTITY_INITIAL_AVATAR_CLASS_NAMES[ paletteIndex % IDENTITY_INITIAL_AVATAR_CLASS_NAMES.length ]; - const fontSize = Math.round(Math.min(40, Math.max(22, size * 0.28))); + const textSizeClassName = size >= 80 ? "text-3xl" : "text-xl"; return ( {initials.length > 0 ? initials : } diff --git a/desktop/src/features/agents/ui/UnifiedAgentsSection.tsx b/desktop/src/features/agents/ui/UnifiedAgentsSection.tsx index 22d6b0d180..7c95dadebd 100644 --- a/desktop/src/features/agents/ui/UnifiedAgentsSection.tsx +++ b/desktop/src/features/agents/ui/UnifiedAgentsSection.tsx @@ -16,8 +16,10 @@ import { import { toast } from "sonner"; import { useActiveAgentTurns } from "@/features/agents/activeAgentTurnsStore"; +import { friendlyAgentLastError } from "@/features/agents/lib/friendlyAgentLastError"; import { isManagedAgentActive } from "@/features/agents/lib/managedAgentControlActions"; import { AgentStatusBadge } from "@/features/agents/ui/AgentStatusBadge"; +import { ModelPicker } from "@/features/agents/ui/ModelPicker"; import { useUserProfileQuery } from "@/features/profile/hooks"; import type { AgentPersona, @@ -390,6 +392,9 @@ function AgentPersonaCard({ const avatarUrl = agent ? firstAvatarUrl(profileQuery.data?.avatarUrl, persona.avatarUrl) : persona.avatarUrl; + const friendlyError = agent + ? friendlyAgentLastError(agent.lastError)?.copy + : null; return ( : undefined} modelLabel={modelLabel} onClick={() => { if (agent && onOpenAgentProfile) { @@ -441,6 +448,7 @@ function StandaloneAgentCard({ }) { const title = agent.name; const profileQuery = useUserProfileQuery(agent.pubkey); + const friendlyError = friendlyAgentLastError(agent.lastError)?.copy; return ( } modelLabel={formatAgentModelLabel(agent.model)} onClick={() => { if (onOpenAgentProfile) {