From f3496807a69745fef3106b08bd39e359c4b4649d Mon Sep 17 00:00:00 2001 From: Brainy Bumble <0ed7657b57c0e8a9f5288390dd6c8d5d0a3a06abe9b01b9006814f52077d6cdf@buzz.block.builderlab.xyz> Date: Wed, 12 Aug 2026 11:12:02 -0500 Subject: [PATCH] Adapt delete confirmation to profile redesign Co-authored-by: Atish Patel Signed-off-by: Atish Patel Signed-off-by: Brainy Bumble <0ed7657b57c0e8a9f5288390dd6c8d5d0a3a06abe9b01b9006814f52077d6cdf@buzz.block.builderlab.xyz> --- .../ui/UserProfileAgentManagementRows.tsx | 93 +++++++++++++++---- .../profile/ui/UserProfilePanelSections.tsx | 1 + .../profile/ui/UserProfilePanelTabs.tsx | 3 + desktop/tests/e2e/agents.spec.ts | 37 +++++++- 4 files changed, 112 insertions(+), 22 deletions(-) diff --git a/desktop/src/features/profile/ui/UserProfileAgentManagementRows.tsx b/desktop/src/features/profile/ui/UserProfileAgentManagementRows.tsx index 7b8a586224..6706b0c609 100644 --- a/desktop/src/features/profile/ui/UserProfileAgentManagementRows.tsx +++ b/desktop/src/features/profile/ui/UserProfileAgentManagementRows.tsx @@ -11,6 +11,7 @@ import { import type { IdentityArchiveActions } from "@/features/identity-archive/hooks"; import { ArchiveConfirmDialog } from "@/features/profile/ui/ArchiveConfirmDialog"; +import { useAgentMemoryQuery } from "@/features/agent-memory/hooks"; import type { ManagedAgent } from "@/shared/api/types"; import { AlertDialog, @@ -31,6 +32,7 @@ export function UserProfileAgentManagementRows({ canDeleteAgent, isDeletePending, managedAgent, + channelCount, onCreateCard, onDeleteAgent, onDuplicateAgent, @@ -41,6 +43,7 @@ export function UserProfileAgentManagementRows({ canDeleteAgent: boolean; isDeletePending: boolean; managedAgent?: ManagedAgent; + channelCount: number; /** Mint an agent trading card. Present only for owner-managed personas. */ onCreateCard?: () => void; onDeleteAgent: () => void; @@ -91,9 +94,11 @@ export function UserProfileAgentManagementRows({ ) : null} {canDeleteAgent ? ( ) : null} @@ -194,15 +199,25 @@ function ProfileArchiveAgentRow({ } function ProfileDeleteAgentRow({ + channelCount, isPending, managedAgent, onDelete, + onExport, }: { + channelCount: number; isPending: boolean; managedAgent?: ManagedAgent; onDelete: () => void; + onExport?: () => void; }) { const [confirmOpen, setConfirmOpen] = React.useState(false); + const memoryQuery = useAgentMemoryQuery(managedAgent?.pubkey, { + enabled: confirmOpen && managedAgent !== undefined, + }); + const memoryCount = + memoryQuery.data && + (memoryQuery.data.core ? 1 : 0) + memoryQuery.data.memories.length; return ( <> @@ -223,11 +238,15 @@ function ProfileDeleteAgentRow({ {managedAgent ? ( { setConfirmOpen(false); onDelete(); }} + onExport={onExport} onOpenChange={setConfirmOpen} open={confirmOpen} /> @@ -238,44 +257,82 @@ function ProfileDeleteAgentRow({ function AgentDeleteConfirmDialog({ agent, + channelCount, isPending, + memoryCount, + memoriesLoading, onConfirm, + onExport, onOpenChange, open, }: { agent: ManagedAgent; + channelCount: number; isPending: boolean; + memoryCount?: number; + memoriesLoading: boolean; onConfirm: () => void; + onExport?: () => void; onOpenChange: (open: boolean) => void; open: boolean; }) { const isProviderAgent = agent.backend.type === "provider"; + const showExportRecommendation = + onExport !== undefined && memoryCount !== undefined && memoryCount > 0; return ( - Delete this agent? + Delete {agent.name}? - Deleting this agent stops and removes the agent from this community. + This permanently removes the agent, its saved key, and its channel + access. -
    -
  • Removes the local management record and saved agent key
  • -
  • Removes the agent from every channel it belongs to
  • -
  • - Archives the agent's identity on the relay so it no longer - appears in member lists or mention suggestions -
  • -
  • - {isProviderAgent - ? "Requests remote deletion; if it is online, Buzz first sends a shutdown command when possible. If the deployment cannot be reached through a channel, the remote process may keep running without local management." - : "Stops any local agent process before deleting the record"} -
  • -
-

- Archive this agent if you want to hide it instead of removing it. -

+
+
+

Memories

+

+ {memoriesLoading ? "…" : (memoryCount ?? "—")} +

+
+
+

Channels

+

+ {channelCount} +

+
+
+ {showExportRecommendation ? ( +

+ Want a backup?{" "} + + . +

+ ) : null} + {isProviderAgent ? ( +

+ The remote process may keep running if Buzz can't reach it. +

+ ) : null}