mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
Address profile panel PR feedback
This commit is contained in:
@@ -25,30 +25,43 @@ export function ManagedAgentLogPanel({
|
||||
return null;
|
||||
}
|
||||
|
||||
const logDescription = selectedAgent
|
||||
? `${selectedAgent.name} · ${describeLogFile(selectedAgent.logPath)}`
|
||||
: "Select a local agent to inspect recent output.";
|
||||
|
||||
return (
|
||||
<section
|
||||
className={cn(
|
||||
isInline
|
||||
? ""
|
||||
? "space-y-3"
|
||||
: "rounded-[28px] border border-border/70 bg-card/90 p-5 shadow-xs",
|
||||
)}
|
||||
>
|
||||
<div className="flex flex-col gap-2 sm:flex-row sm:items-end sm:justify-between">
|
||||
<div>
|
||||
<h3 className="text-sm font-semibold tracking-tight">Harness log</h3>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{selectedAgent
|
||||
? `${selectedAgent.name} · ${describeLogFile(selectedAgent.logPath)}`
|
||||
: "Select a local agent to inspect recent output."}
|
||||
<div
|
||||
className={cn(
|
||||
"flex flex-col gap-2 sm:flex-row sm:items-end sm:justify-between",
|
||||
isInline && "sm:items-center",
|
||||
)}
|
||||
>
|
||||
{isInline ? (
|
||||
<p className="min-w-0 truncate text-sm text-muted-foreground">
|
||||
{logDescription}
|
||||
</p>
|
||||
</div>
|
||||
) : (
|
||||
<div>
|
||||
<h3 className="text-sm font-semibold tracking-tight">
|
||||
Harness log
|
||||
</h3>
|
||||
<p className="text-sm text-muted-foreground">{logDescription}</p>
|
||||
</div>
|
||||
)}
|
||||
{selectedAgent ? (
|
||||
<CopyButton label="Copy log" value={logContent ?? ""} />
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
{!selectedAgent ? (
|
||||
<div className="mt-4 rounded-xl border border-dashed border-border/80 bg-background/70 px-6 py-10 text-center">
|
||||
<div className="rounded-xl border border-dashed border-border/80 bg-background/70 px-6 py-10 text-center">
|
||||
<p className="text-sm font-semibold tracking-tight">
|
||||
No local agent selected
|
||||
</p>
|
||||
@@ -57,14 +70,14 @@ export function ManagedAgentLogPanel({
|
||||
</p>
|
||||
</div>
|
||||
) : isLoading ? (
|
||||
<div className="mt-4 rounded-xl border border-border/70 bg-background/80 p-4">
|
||||
<div className="rounded-xl border border-border/70 bg-background/80 p-4">
|
||||
<Skeleton className="h-4 w-48" />
|
||||
<Skeleton className="mt-3 h-4 w-full" />
|
||||
<Skeleton className="mt-2 h-4 w-full" />
|
||||
<Skeleton className="mt-2 h-4 w-3/4" />
|
||||
</div>
|
||||
) : (
|
||||
<div className="mt-4 overflow-hidden rounded-xl border border-border/70 bg-[#17171d] text-xs text-zinc-100">
|
||||
<div className="overflow-hidden rounded-xl border border-border/70 bg-[#17171d] text-xs text-zinc-100">
|
||||
<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">
|
||||
<span>{selectedAgent.name}</span>
|
||||
<span>{selectedAgent.status}</span>
|
||||
@@ -82,7 +95,7 @@ export function ManagedAgentLogPanel({
|
||||
)}
|
||||
|
||||
{error ? (
|
||||
<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">
|
||||
<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">
|
||||
<CircleAlert className="h-4 w-4" />
|
||||
{error.message}
|
||||
</p>
|
||||
|
||||
@@ -252,7 +252,7 @@ function AgentPersonaCard({
|
||||
const modelLabel = formatAgentModelLabel(agent?.model ?? persona.model);
|
||||
const profileQuery = useUserProfileQuery(agent?.pubkey);
|
||||
const avatarUrl = agent
|
||||
? (profileQuery.data?.avatarUrl ?? null)
|
||||
? (profileQuery.data?.avatarUrl ?? agent.avatarUrl ?? persona.avatarUrl)
|
||||
: persona.avatarUrl;
|
||||
|
||||
return (
|
||||
@@ -286,7 +286,7 @@ function StandaloneAgentCard({
|
||||
return (
|
||||
<AgentIdentityCard
|
||||
ariaLabel={`${title} agent profile`}
|
||||
avatarUrl={profileQuery.data?.avatarUrl ?? null}
|
||||
avatarUrl={profileQuery.data?.avatarUrl ?? agent.avatarUrl}
|
||||
dataTestId={`managed-agent-${agent.pubkey}`}
|
||||
label={title}
|
||||
modelLabel={formatAgentModelLabel(agent.model)}
|
||||
|
||||
@@ -225,9 +225,16 @@ export function UserProfilePanel({
|
||||
const { onOpenAgentSession } = useAgentSession();
|
||||
const { goChannel } = useAppNavigation();
|
||||
|
||||
const profile =
|
||||
profileQuery.data ??
|
||||
(resolvedPersona ? buildPersonaDraftProfile(resolvedPersona) : undefined);
|
||||
const profile = React.useMemo(() => {
|
||||
const baseProfile =
|
||||
profileQuery.data ??
|
||||
(resolvedPersona ? buildPersonaDraftProfile(resolvedPersona) : undefined);
|
||||
const fallbackAvatarUrl =
|
||||
managedAgent?.avatarUrl ?? resolvedPersona?.avatarUrl ?? null;
|
||||
return baseProfile && !baseProfile.avatarUrl && fallbackAvatarUrl
|
||||
? { ...baseProfile, avatarUrl: fallbackAvatarUrl }
|
||||
: baseProfile;
|
||||
}, [managedAgent?.avatarUrl, profileQuery.data, resolvedPersona]);
|
||||
const presenceStatus = pubkeyLower
|
||||
? presenceQuery.data?.[pubkeyLower]
|
||||
: undefined;
|
||||
@@ -855,6 +862,7 @@ export function UserProfilePanel({
|
||||
isLoading={managedAgentLogQuery.isLoading}
|
||||
logContent={managedAgentLogQuery.data?.content ?? null}
|
||||
selectedAgent={managedAgent ?? null}
|
||||
variant="inline"
|
||||
/>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
@@ -122,10 +122,10 @@ export function useProfileFieldBuckets({
|
||||
return {
|
||||
...bucketProfileFields(metadataFields),
|
||||
diagnosticsSummary:
|
||||
diagnosticsFields.find((field) => field.label === "Last error")
|
||||
?.displayValue ??
|
||||
diagnosticsFields.find((field) => field.label === "Status")
|
||||
?.displayValue ??
|
||||
diagnosticsFields.find((field) => field.label === "Last error")
|
||||
?.displayValue ??
|
||||
null,
|
||||
modelLabel: managedAgent?.model ?? persona?.model ?? "Auto",
|
||||
};
|
||||
|
||||
@@ -53,6 +53,7 @@ import { cn } from "@/shared/lib/cn";
|
||||
import { useNow } from "@/shared/lib/useNow";
|
||||
import { Badge } from "@/shared/ui/badge";
|
||||
import { Button } from "@/shared/ui/button";
|
||||
import { Markdown } from "@/shared/ui/markdown";
|
||||
|
||||
// ── Summary view ─────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -706,7 +707,12 @@ function ProfileIngressRow({
|
||||
{label}
|
||||
</span>
|
||||
{trailing ? (
|
||||
<span className="text-sm text-muted-foreground">{trailing}</span>
|
||||
<span
|
||||
className="max-w-[45%] truncate text-right text-sm text-muted-foreground"
|
||||
title={trailing}
|
||||
>
|
||||
{trailing}
|
||||
</span>
|
||||
) : null}
|
||||
<ChevronRight className="h-4 w-4 shrink-0 text-muted-foreground" />
|
||||
</button>
|
||||
@@ -951,12 +957,13 @@ export function AgentInstructionFocusedView({
|
||||
<div className="space-y-3 pt-4">
|
||||
<div className="rounded-2xl bg-muted/20 px-4 py-3">
|
||||
{trimmedInstruction ? (
|
||||
<p
|
||||
className="whitespace-pre-wrap text-sm leading-6 text-foreground"
|
||||
data-testid="user-profile-agent-instruction"
|
||||
>
|
||||
{trimmedInstruction}
|
||||
</p>
|
||||
<div data-testid="user-profile-agent-instruction">
|
||||
<Markdown
|
||||
className="text-sm leading-6"
|
||||
content={trimmedInstruction}
|
||||
interactive={false}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<p
|
||||
className="text-sm leading-6 text-muted-foreground"
|
||||
|
||||
Reference in New Issue
Block a user