From cd1e0ec73be7257d57c451d64ddfcdc3a5e58fe3 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Fri, 13 Nov 2026 23:18:10 -0800 Subject: [PATCH] Record addressed acknowledgement deletions on row drops --- .../activity/use-worktree-agent-rows-subscriptions.test.tsx | 4 ++++ .../store/slices/agent-status/agent-status-drop-actions.ts | 3 ++- .../store/slices/agent-status/agent-status-drop-reducer.ts | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/components/sidebar/workspace-card/activity/use-worktree-agent-rows-subscriptions.test.tsx b/src/renderer/src/components/sidebar/workspace-card/activity/use-worktree-agent-rows-subscriptions.test.tsx index c86cd8212c8..2fd5beab2d2 100644 --- a/src/renderer/src/components/sidebar/workspace-card/activity/use-worktree-agent-rows-subscriptions.test.tsx +++ b/src/renderer/src/components/sidebar/workspace-card/activity/use-worktree-agent-rows-subscriptions.test.tsx @@ -346,6 +346,10 @@ it.each([100, 1000])( })) ) act(() => useAppStore.getState().acknowledgeAgents([other])) + act(() => useAppStore.getState().dropAgentStatus(other)) + act(() => useAppStore.getState().setAgentStatuses([update(other, 'other')])) + act(() => useAppStore.getState().acknowledgeAgents([other])) + act(() => useAppStore.getState().dropAgentStatusByTabPrefix('tab-other')) expect(rootReads()).toBe(0) expect(commits).toBe(committed) statusReads.mockRestore() diff --git a/src/renderer/src/store/slices/agent-status/agent-status-drop-actions.ts b/src/renderer/src/store/slices/agent-status/agent-status-drop-actions.ts index d5fc3b914c4..82820da32b4 100644 --- a/src/renderer/src/store/slices/agent-status/agent-status-drop-actions.ts +++ b/src/renderer/src/store/slices/agent-status/agent-status-drop-actions.ts @@ -1,3 +1,4 @@ +import { linkRecordWrite } from '../../keyed-record-transitions' import type { DropAgentStatusByTabPrefixOptions, DropAgentStatusOptions @@ -22,7 +23,7 @@ function removeAcknowledgement( } const next = { ...acknowledgements } delete next[paneKey] - return next + return linkRecordWrite(next, acknowledgements, [paneKey]) } export function createAgentStatusDropActions( diff --git a/src/renderer/src/store/slices/agent-status/agent-status-drop-reducer.ts b/src/renderer/src/store/slices/agent-status/agent-status-drop-reducer.ts index e1581ce2632..40c43ab4af4 100644 --- a/src/renderer/src/store/slices/agent-status/agent-status-drop-reducer.ts +++ b/src/renderer/src/store/slices/agent-status/agent-status-drop-reducer.ts @@ -1,3 +1,4 @@ +import { linkRecordWrite } from '../../keyed-record-transitions' import type { AppState } from '../../types' import type { DropAgentStatusByTabPrefixOptions } from './agent-status-contract' import { pruneMigrationUnsupportedEntries } from './agent-status-migration-unsupported-entries' @@ -67,6 +68,7 @@ export function buildAgentStatusTabPrefixDropPatch( for (const k of ackKeys) { delete nextAck[k] } + linkRecordWrite(nextAck, s.acknowledgedAgentsByPaneKey, ackKeys) } const nextClosedTabs = opts?.paneKeys ? s.recentlyClosedAgentStatusTabIds