multica/apps/web/features/issues/components
LinYushen 09764c5f51
feat(agent): replace hard delete with archive/restore (#346)
* feat(agent): replace hard delete with archive/restore

Replace agent deletion with soft archive pattern. Archived agents
are preserved in the database with all historical references intact
but cannot be assigned, mentioned, or trigger tasks.

Backend:
- Add archived_at/archived_by columns to agent table (migration 031)
- Replace DELETE /api/agents/{id} with POST /api/agents/{id}/archive
- Add POST /api/agents/{id}/restore endpoint
- ListAgents excludes archived by default (?include_archived=true to include)
- Skip archived agents in task triggers (on_assign, on_comment, on_mention)
- Block assignment to archived agents
- Cancel pending tasks on archive
- New events: agent:archived, agent:restored (replacing agent:deleted)

Frontend:
- Agent type includes archived_at/archived_by fields
- Mention autocomplete and assignee picker filter out archived agents
- Agent list shows archived agents with muted styling
- Agent detail shows archive banner with restore button
- Delete button replaced with Archive button and updated confirmation dialog
- API client: archiveAgent/restoreAgent replace deleteAgent

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(agent): self-review fixes for archive feature

- Fix: workspace store now fetches agents with include_archived=true
  so archived agents are actually visible in the frontend (the archived
  UI was dead code before — ListAgents excludes archived by default)
- Fix: add error logging for CancelAgentTasksByAgent in ArchiveAgent
- Fix: add idempotency guards — return 409 Conflict when archiving
  an already-archived agent or restoring a non-archived agent
- Fix: revert unnecessary extra GetAgent query in ReconcileAgentStatus
  (archived agents won't have running tasks after CancelAgentTasksByAgent)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 17:33:52 +08:00
..
pickers feat(agent): replace hard delete with archive/restore (#346) 2026-04-02 17:33:52 +08:00
agent-live-card.tsx feat(web): add skeleton loading, error toasts, and confirmation dialogs 2026-04-02 16:46:56 +08:00
batch-action-toolbar.tsx feat(web): add skeleton loading, error toasts, and confirmation dialogs 2026-04-02 16:46:56 +08:00
board-card.tsx feat(web): add kanban board + list view + filtering to My Issues page 2026-04-01 16:56:22 +08:00
board-column.tsx feat(web): add kanban board + list view + filtering to My Issues page 2026-04-01 16:56:22 +08:00
board-view.tsx feat(web): add kanban board + list view + filtering to My Issues page 2026-04-01 16:56:22 +08:00
comment-card.tsx feat(web): add skeleton loading, error toasts, and confirmation dialogs 2026-04-02 16:46:56 +08:00
comment-input.tsx feat(ui): editor UX improvements — lowlight, upload, emoji, comment editing 2026-03-31 18:37:53 +08:00
index.ts refactor(web): unify assignee dropdowns with ActorAvatar and shared AssigneePicker 2026-04-01 15:37:33 +08:00
issue-detail.tsx feat(web): add skeleton loading, error toasts, and confirmation dialogs 2026-04-02 16:46:56 +08:00
issue-mention-card.tsx feat(issues): render issue mentions as rich cards with status icon 2026-03-31 16:19:32 +08:00
issues-header.tsx fix(web): unify header button text color across Issues and My Issues 2026-04-01 19:05:33 +08:00
issues-page.tsx feat(web): add skeleton loading, error toasts, and confirmation dialogs 2026-04-02 16:46:56 +08:00
list-row.tsx refactor(issues): extract hooks from issue-detail, eliminate dual source of truth 2026-03-31 13:09:17 +08:00
list-view.tsx feat(web): add kanban board + list view + filtering to My Issues page 2026-04-01 16:56:22 +08:00
priority-icon.tsx feat(ui): restyle issue status and priority with colored badges 2026-03-31 03:26:43 +08:00
reply-input.tsx feat(ui): editor UX improvements — lowlight, upload, emoji, comment editing 2026-03-31 18:37:53 +08:00
status-icon.tsx feat(ui): restyle issue status and priority with colored badges 2026-03-31 03:26:43 +08:00