FN-8929: dismiss accepted chat attachments
Clear staged chat attachments immediately when the server accepts a direct or room message.
- Add stream and room delivery acceptance callbacks for attachment cleanup.
- Preserve staged files on pre-acceptance failures and block destructive clear commands.
- Cover direct, room, mobile, and stream acceptance behavior with tests.
Files changed:
.changeset/fn-8929-chat-attachment-dismiss.md | 7 ++
docs/dashboard-guide.md | 2 +-
.../app/api/__tests__/legacy-chat-stream.test.ts | 34 ++++++
packages/dashboard/app/api/chat/chat.ts | 7 ++
packages/dashboard/app/components/ChatView.tsx | 86 +++++++++------
.../__tests__/ChatView.core-interactions.test.tsx | 117 ++++++++++++++++++++-
.../components/__tests__/ChatView.core.test.tsx | 6 +-
.../__tests__/ChatView.mobile-render.test.tsx | 21 ++++
.../components/__tests__/ChatView.mobile.test.tsx | 2 +-
.../components/__tests__/ChatView.rooms.test.tsx | 64 ++++++++---
.../dashboard/app/hooks/__tests__/useChat.test.ts | 54 ++++++++++
.../app/hooks/__tests__/useChatRooms.test.ts | 33 +++++-
packages/dashboard/app/hooks/useChat.ts | 11 +-
packages/dashboard/app/hooks/useChatRooms.ts | 13 ++-
14 files changed, 393 insertions(+), 64 deletions(-)
Fusion-Task-Id: FN-8929
Fusion-Task-Lineage: 3f39d1aa-a4f9-4a71-a7a8-3522d7c3c83e
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>