feat(inbox): put an archived task's items away in an Archived tab
Merged
CH
2d ago+533+533+012345678901234567890123456789-120-120-012345678901234567890123456789
What was asked
When a task is archived, its inbox items should read as archived rather than vanish, and come back when the task is unarchived ("the inbox items shouldn't be 'hidden' but they should also be 'archived' so they could be brought back").
What changed
The archived state comes from the task's own archive. Nothing is stored on items and there is no migration, so unarchiving brings each item back exactly as it was.
Wire / service
GET /api/inboxtakesarchived=include(ACCOUNT_INBOX_QUERY, the same shape the task and agent lists use). With it,plansalso lists archived tasks that hold items.itemsnever carries an archived task's open item, so the Dock badge, toasts and counts are unchanged, and older desktops (which never ask) see exactly what they saw before. No value is added toINBOX_STATUS.- Answering an item on an archived task is refused with
TASK_ARCHIVED(inboxItemArchived). Clients already map that error.
Desktop
- The window's Inbox gets an Archived tab beside Needs you / Unread / All open / Everything. It lists archived tasks' items and counts them from main's per-task totals. Their items are read only while the tab is shown, and the tab is never saved as where the Inbox opens. No other tab lists or counts these items, and Mark all as read leaves them alone.
- An archived task's item is read-only. Its options are drawn disabled, its status line says "Archived", and the answer box is replaced by the archived-task note with Unarchive, which uses the existing
TASK_MARK.UNARCHIVE. A plan's own Inbox tab draws an archived plan's items the same way, and Needs you never counts them.
Tests
coding-agents-app.test.ts: the archived opt-in, theTASK_ARCHIVEDrefusal, and unarchive bringing the item back.desktop-inbox.test.ts: the Archived tab, its count, the read-only pane, and Unarchive. The existing tab-row expectations gainArchived 0.inbox-model.test.ts: an archived task's open item never needs you.
pnpm check:affected passes. I ran it in pieces because the sandbox ran out of memory. app-menu.test.ts only passed after installing Electron's binary in the sandbox.
Independent of #3270 (agent archiving is untouched).
Made with Luke