mirror of
https://github.com/stablyai/orca.git
synced 2026-11-15 10:27:33 +00:00
Record addressed acknowledgement deletions on row drops
This commit is contained in:
+4
@@ -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()
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user