Commit Graph

3 Commits

Author SHA1 Message Date
gsxdsm
fc56161c9d FN-9014: add chat and mailbox message archiving
Add archived-message lifecycle support across chat and mailbox views.

- Persist archive state with a PostgreSQL migration and message-store APIs.
- Expose archive, restore, and permanent-delete messaging endpoints.
- Add archived-message views and archive-by-default actions with regression coverage.
- Document storage behavior and add a release changeset.

Files changed:
 .changeset/fn-9014-message-archive.md              |   7 ++
 docs/dashboard-guide.md                            |   7 +-
 docs/storage.md                                    |   2 +-
 .../__tests__/postgres/message-store.pg.test.ts    |  34 +++++++
 .../src/__tests__/postgres/schema-applier.test.ts  |   9 +-
 .../core/src/async-stores/async-message-store.ts   |  73 +++++++++++---
 .../migrations/0058_fn_9014_message_archive.sql    |  13 +++
 packages/core/src/postgres/schema-applier.ts       |  14 ++-
 packages/core/src/postgres/schema/project.ts       |   2 +
 packages/core/src/stores/message-store.ts          |  68 ++++++++++---
 packages/core/src/types/messaging/messages.ts      |   9 ++
 packages/dashboard/app/api/chat/messaging.ts       |  37 +++++--
 packages/dashboard/app/api/legacy.ts               |   2 +
 packages/dashboard/app/components/ChatView.tsx     |  21 +++-
 packages/dashboard/app/components/MailboxModal.tsx |  74 ++++++++++++--
 packages/dashboard/app/components/MailboxView.tsx  | 108 +++++++++++++++++++--
 .../__tests__/ChatView.core-contracts.test.tsx     |  24 +++++
 .../components/__tests__/ChatView.test-harness.tsx |   3 +
 .../app/components/__tests__/MailboxModal.test.tsx |   6 +-
 .../app/components/__tests__/MailboxView.test.tsx  |  10 +-
 .../dashboard/app/hooks/__tests__/useChat.test.ts  |  35 ++++++-
 packages/dashboard/app/hooks/useChat.ts            |  38 +++++++-
 .../__tests__/messaging-archive-routes.test.ts     |  86 ++++++++++++++++
 .../src/routes/register-messaging-scripts.ts       |  33 ++++++-
 24 files changed, 635 insertions(+), 80 deletions(-)

Fusion-Task-Id: FN-9014

Fusion-Task-Lineage: 1dbd02c3-1180-4d72-8cbc-9594e5f355dc

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-12 16:03:30 -07:00
gsxdsm
a48594f128 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>
2026-08-09 23:21:02 -07:00
gsxdsm
cb57093d03 refactor: domain folder layout (types, API, core, engine) (#2398)
## Summary

Wave 17 organizes Fusion into **domain folders** (stacks on #2397).

### Layout
- **core/types/** — board, task, agents, settings, merge, workflow,
mesh, …
- **core/src/** — agents, ai, async-stores, workflows, tasks, config,
db, …
- **dashboard/app/api/** — client, tasks, agents, git, missions,
planning, …
- **engine/src/** — agents, auth, execution, merge, missions, overseer,
worktree, …

Root keepers retained for large entrypoints (`store.ts`, `executor.ts`,
`merger.ts`, …).

Public barrels (`@fusion/core`, `@fusion/engine`, `app/api.ts` → legacy)
stay stable.

## Test plan
- [x] `@fusion/core` typecheck
- [x] `@fusion/engine` typecheck (pre-existing playwright-core noise
only)
- [ ] CI merge gate

**Stack:** #2394 → #2397 → **this PR**
2026-08-03 00:20:53 -07:00