perf(activity): save activity history incrementally through an activity store and sync queue

The renderer no longer sends the whole history on every change. Domain
actions on an external activity store update the list and queue the matching
contract changes; activity-sync.ts flushes them every 250 ms via
activityHistory.update (<= 20,000 per call), keeps failed changes queued in
order with backoff retry, and flushes on quit and unmount. replace remains
only for the legacy localStorage migration; clearing uses the new
activityHistory.clear IPC. App's activity state is gone; ActivityPanel reads
a selector. update is now required in the desktop API.
This commit is contained in:
mesalogo
2026-10-03 20:45:51 +08:00
parent 2adee13638
commit 6aab78b9fa
16 changed files with 987 additions and 263 deletions
+3
View File
@@ -1293,6 +1293,9 @@ const desktopApi: DesktopApi = {
},
update: async (update: ActivityHistoryUpdate) => {
await ipcRenderer.invoke(ipcChannels.activityHistoryUpdate, update)
},
clear: async () => {
await ipcRenderer.invoke(ipcChannels.activityHistoryClear)
}
},
usage: {