Skip to content

Commit c5cdd4c

Browse files
committed
Address profile panel PR feedback
1 parent 941257a commit c5cdd4c

5 files changed

Lines changed: 55 additions & 27 deletions

File tree

desktop/src/features/agents/ui/ManagedAgentLogPanel.tsx

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,43 @@ export function ManagedAgentLogPanel({
2525
return null;
2626
}
2727

28+
const logDescription = selectedAgent
29+
? `${selectedAgent.name} · ${describeLogFile(selectedAgent.logPath)}`
30+
: "Select a local agent to inspect recent output.";
31+
2832
return (
2933
<section
3034
className={cn(
3135
isInline
32-
? ""
36+
? "space-y-3"
3337
: "rounded-[28px] border border-border/70 bg-card/90 p-5 shadow-xs",
3438
)}
3539
>
36-
<div className="flex flex-col gap-2 sm:flex-row sm:items-end sm:justify-between">
37-
<div>
38-
<h3 className="text-sm font-semibold tracking-tight">Harness log</h3>
39-
<p className="text-sm text-muted-foreground">
40-
{selectedAgent
41-
? `${selectedAgent.name} · ${describeLogFile(selectedAgent.logPath)}`
42-
: "Select a local agent to inspect recent output."}
40+
<div
41+
className={cn(
42+
"flex flex-col gap-2 sm:flex-row sm:items-end sm:justify-between",
43+
isInline && "sm:items-center",
44+
)}
45+
>
46+
{isInline ? (
47+
<p className="min-w-0 truncate text-sm text-muted-foreground">
48+
{logDescription}
4349
</p>
44-
</div>
50+
) : (
51+
<div>
52+
<h3 className="text-sm font-semibold tracking-tight">
53+
Harness log
54+
</h3>
55+
<p className="text-sm text-muted-foreground">{logDescription}</p>
56+
</div>
57+
)}
4558
{selectedAgent ? (
4659
<CopyButton label="Copy log" value={logContent ?? ""} />
4760
) : null}
4861
</div>
4962

5063
{!selectedAgent ? (
51-
<div className="mt-4 rounded-xl border border-dashed border-border/80 bg-background/70 px-6 py-10 text-center">
64+
<div className="rounded-xl border border-dashed border-border/80 bg-background/70 px-6 py-10 text-center">
5265
<p className="text-sm font-semibold tracking-tight">
5366
No local agent selected
5467
</p>
@@ -57,14 +70,14 @@ export function ManagedAgentLogPanel({
5770
</p>
5871
</div>
5972
) : isLoading ? (
60-
<div className="mt-4 rounded-xl border border-border/70 bg-background/80 p-4">
73+
<div className="rounded-xl border border-border/70 bg-background/80 p-4">
6174
<Skeleton className="h-4 w-48" />
6275
<Skeleton className="mt-3 h-4 w-full" />
6376
<Skeleton className="mt-2 h-4 w-full" />
6477
<Skeleton className="mt-2 h-4 w-3/4" />
6578
</div>
6679
) : (
67-
<div className="mt-4 overflow-hidden rounded-xl border border-border/70 bg-[#17171d] text-xs text-zinc-100">
80+
<div className="overflow-hidden rounded-xl border border-border/70 bg-[#17171d] text-xs text-zinc-100">
6881
<div className="flex items-center justify-between border-b border-white/10 px-4 py-2 text-2xs uppercase tracking-[0.18em] text-zinc-400">
6982
<span>{selectedAgent.name}</span>
7083
<span>{selectedAgent.status}</span>
@@ -82,7 +95,7 @@ export function ManagedAgentLogPanel({
8295
)}
8396

8497
{error ? (
85-
<p className="mt-4 inline-flex items-center gap-2 rounded-2xl border border-destructive/30 bg-destructive/10 px-4 py-3 text-sm text-destructive">
98+
<p className="inline-flex items-center gap-2 rounded-2xl border border-destructive/30 bg-destructive/10 px-4 py-3 text-sm text-destructive">
8699
<CircleAlert className="h-4 w-4" />
87100
{error.message}
88101
</p>

desktop/src/features/agents/ui/UnifiedAgentsSection.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ function AgentPersonaCard({
252252
const modelLabel = formatAgentModelLabel(agent?.model ?? persona.model);
253253
const profileQuery = useUserProfileQuery(agent?.pubkey);
254254
const avatarUrl = agent
255-
? (profileQuery.data?.avatarUrl ?? null)
255+
? (profileQuery.data?.avatarUrl ?? agent.avatarUrl ?? persona.avatarUrl)
256256
: persona.avatarUrl;
257257

258258
return (
@@ -286,7 +286,7 @@ function StandaloneAgentCard({
286286
return (
287287
<AgentIdentityCard
288288
ariaLabel={`${title} agent profile`}
289-
avatarUrl={profileQuery.data?.avatarUrl ?? null}
289+
avatarUrl={profileQuery.data?.avatarUrl ?? agent.avatarUrl}
290290
dataTestId={`managed-agent-${agent.pubkey}`}
291291
label={title}
292292
modelLabel={formatAgentModelLabel(agent.model)}

desktop/src/features/profile/ui/UserProfilePanel.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,16 @@ export function UserProfilePanel({
225225
const { onOpenAgentSession } = useAgentSession();
226226
const { goChannel } = useAppNavigation();
227227

228-
const profile =
229-
profileQuery.data ??
230-
(resolvedPersona ? buildPersonaDraftProfile(resolvedPersona) : undefined);
228+
const profile = React.useMemo(() => {
229+
const baseProfile =
230+
profileQuery.data ??
231+
(resolvedPersona ? buildPersonaDraftProfile(resolvedPersona) : undefined);
232+
const fallbackAvatarUrl =
233+
managedAgent?.avatarUrl ?? resolvedPersona?.avatarUrl ?? null;
234+
return baseProfile && !baseProfile.avatarUrl && fallbackAvatarUrl
235+
? { ...baseProfile, avatarUrl: fallbackAvatarUrl }
236+
: baseProfile;
237+
}, [managedAgent?.avatarUrl, profileQuery.data, resolvedPersona]);
231238
const presenceStatus = pubkeyLower
232239
? presenceQuery.data?.[pubkeyLower]
233240
: undefined;
@@ -855,6 +862,7 @@ export function UserProfilePanel({
855862
isLoading={managedAgentLogQuery.isLoading}
856863
logContent={managedAgentLogQuery.data?.content ?? null}
857864
selectedAgent={managedAgent ?? null}
865+
variant="inline"
858866
/>
859867
) : null}
860868
</div>

desktop/src/features/profile/ui/UserProfilePanelFields.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,10 @@ export function useProfileFieldBuckets({
122122
return {
123123
...bucketProfileFields(metadataFields),
124124
diagnosticsSummary:
125-
diagnosticsFields.find((field) => field.label === "Last error")
126-
?.displayValue ??
127125
diagnosticsFields.find((field) => field.label === "Status")
128126
?.displayValue ??
127+
diagnosticsFields.find((field) => field.label === "Last error")
128+
?.displayValue ??
129129
null,
130130
modelLabel: managedAgent?.model ?? persona?.model ?? "Auto",
131131
};

desktop/src/features/profile/ui/UserProfilePanelSections.tsx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ import { cn } from "@/shared/lib/cn";
5353
import { useNow } from "@/shared/lib/useNow";
5454
import { Badge } from "@/shared/ui/badge";
5555
import { Button } from "@/shared/ui/button";
56+
import { Markdown } from "@/shared/ui/markdown";
5657

5758
// ── Summary view ─────────────────────────────────────────────────────────────
5859

@@ -706,7 +707,12 @@ function ProfileIngressRow({
706707
{label}
707708
</span>
708709
{trailing ? (
709-
<span className="text-sm text-muted-foreground">{trailing}</span>
710+
<span
711+
className="max-w-[45%] truncate text-right text-sm text-muted-foreground"
712+
title={trailing}
713+
>
714+
{trailing}
715+
</span>
710716
) : null}
711717
<ChevronRight className="h-4 w-4 shrink-0 text-muted-foreground" />
712718
</button>
@@ -951,12 +957,13 @@ export function AgentInstructionFocusedView({
951957
<div className="space-y-3 pt-4">
952958
<div className="rounded-2xl bg-muted/20 px-4 py-3">
953959
{trimmedInstruction ? (
954-
<p
955-
className="whitespace-pre-wrap text-sm leading-6 text-foreground"
956-
data-testid="user-profile-agent-instruction"
957-
>
958-
{trimmedInstruction}
959-
</p>
960+
<div data-testid="user-profile-agent-instruction">
961+
<Markdown
962+
className="text-sm leading-6"
963+
content={trimmedInstruction}
964+
interactive={false}
965+
/>
966+
</div>
960967
) : (
961968
<p
962969
className="text-sm leading-6 text-muted-foreground"

0 commit comments

Comments
 (0)