AstrBot-Desktop/src
YokiiroBW 49dccc5eac fix(chat): scope draft, attachments, and errors per slot
The composer draft, the pending attachment list and the error banner
were single values shared by both slots. Uploading on companion and
then switching to operations routed the companion instance's
attachment ids into the operations instance, the operations error
banner stayed visible on the companion tab, and a half-typed message
followed the user across tabs.

Make all three Record<ChatSlot, ...>, mirroring the sending,
unreadCounts and storedSessions state that was already per slot. Every
asynchronous action now pins its slot at the start, so an upload or a
send that resolves after the user switched tabs still lands on the slot
it belonged to.

Splitting the error state is required rather than incidental. refresh()
runs every 500ms and wrote the shared error on failure and cleared it on
success, so any send or upload error was silently wiped within half a
second. The polling failure describes the IPC channel rather than a
slot, so it keeps its own runtimeError; slotError is owned solely by
user actions and takes precedence when both are present.

All three new tests were checked against a mutation that reads the
companion slot regardless of selection, and all three fail under it.

Refs: F-16 (audit P1-11).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-27 00:28:27 +08:00
..
features fix(chat): scope draft, attachments, and errors per slot 2026-07-27 00:28:27 +08:00
lib refactor(ui): share ipc error formatting 2026-07-26 22:31:16 +08:00
pages refactor(ui): share ipc error formatting 2026-07-26 22:31:16 +08:00
test fix(ui): release tauri event listeners on unmount 2026-07-27 00:23:42 +08:00
types feat(desktop): complete Q9 chat and stability increment 2026-07-21 14:43:14 +08:00
App.test.tsx refactor(ui): complete desktop frontend redesign 2026-07-22 00:27:06 +08:00
App.tsx fix(ui): release tauri event listeners on unmount 2026-07-27 00:23:42 +08:00
main.tsx feat(p00): add Tauri desktop spike foundation 2026-07-18 20:34:47 +08:00
styles.css chore(roadmap): sync roadmap status and acceptance gate 2026-07-22 03:09:35 +08:00
vite-env.d.ts feat(p00): add Tauri desktop spike foundation 2026-07-18 20:34:47 +08:00