From 661b4e82b7fc40728592df7e3522ef763f1df103 Mon Sep 17 00:00:00 2001
From: Jinjing <6427696+AmethystLiang@users.noreply.github.com>
Date: Thu, 3 Sep 2026 17:57:50 -0700
Subject: [PATCH] refactor(activity): silent clear for individual notifications
Clear single notifications without showing a toast. The notification
disappears immediately without user confirmation feedback.
---
.../components/activity/activity-clear-completed.ts | 12 ++++++++++--
.../src/components/activity/activity-thread-row.tsx | 7 ++-----
.../activity/activity-thread-virtual-row.tsx | 2 +-
3 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/src/renderer/src/components/activity/activity-clear-completed.ts b/src/renderer/src/components/activity/activity-clear-completed.ts
index af6a86ae8a3..caa061df73e 100644
--- a/src/renderer/src/components/activity/activity-clear-completed.ts
+++ b/src/renderer/src/components/activity/activity-clear-completed.ts
@@ -97,13 +97,21 @@ function evictPersistedStatuses(identities: readonly AgentStatusCacheIdentity[])
}
/**
- * Clear a single activity thread with an undo window.
+ * Clear a single activity thread silently (no toast notification).
*/
export function clearSingleActivityThread(thread: AgentPaneThread): boolean {
if (!isClearableActivityThread(thread)) {
return false
}
- return clearCompletedActivity([thread])
+ const state = useAppStore.getState()
+ const plan = planClearCompletedActivity([thread], state)
+ if (plan.clearedThreadCount === 0) {
+ return false
+ }
+ state.applyActivityClearedAt(plan.cutoffPatch)
+ state.dismissRetainedAgents(plan.retainedSnapshots.map((retained) => retained.entry.paneKey))
+ evictPersistedStatuses(plan.cacheIdentities)
+ return true
}
/**
diff --git a/src/renderer/src/components/activity/activity-thread-row.tsx b/src/renderer/src/components/activity/activity-thread-row.tsx
index 5e563a0593d..bbc626c7af9 100644
--- a/src/renderer/src/components/activity/activity-thread-row.tsx
+++ b/src/renderer/src/components/activity/activity-thread-row.tsx
@@ -63,7 +63,7 @@ export const ActivityThreadRow = React.memo(function ActivityThreadRow({
aria-label={taskTitle}
aria-current={selected ? 'true' : undefined}
className={cn(
- 'group relative flex w-full cursor-pointer flex-col gap-1.5 rounded-lg border border-transparent px-1.5 py-2.5 text-left transition-[background-color,border-color,opacity,box-shadow] duration-200 outline-none select-none worktree-sidebar-card-hover focus-visible:ring-1 focus-visible:ring-ring',
+ 'group relative flex w-full cursor-pointer flex-col gap-1 rounded-lg border border-transparent px-1.5 py-1.5 text-left transition-[background-color,border-color,opacity,box-shadow] duration-200 outline-none select-none worktree-sidebar-card-hover focus-visible:ring-1 focus-visible:ring-ring',
selected && 'border-transparent'
)}
>
@@ -71,7 +71,7 @@ export const ActivityThreadRow = React.memo(function ActivityThreadRow({