MOTIR-995Done
2.9.6 Archived banner on the work-item detail page (+ Restore)
Estimate: 30m · Type: code
When an archived work item's detail page is viewed, show an "Archived" banner (with a Restore action) so the archived state is legible — today the detail page renders an archived item with no indication it's archived.
- Precondition (verified rung 2):
/issues/[key]already loads archived items —getIssueDetail → workItemRepository.findByIdentifierdoes NOT filterarchivedAt, so the page renders; it just lacks any archived signal. No read change needed. - Render a full-width banner at the top of the detail main column — the SAME placement the shipped ready/blocked readiness banner uses (
design/work-items/design-notes.md~L826;app/(authed)/issues/[key]/page.tsx~L317) — whenitem.archivedAt != null. Content: an "Archived" treatment reusing the archived-mark / muted vocabulary + a status chip in theBuildingInPublicBadgemold (components/projects/BuildingInPublicBadge.tsx), the when/who archived (from thearchivedrevision), and a Restore action. - Restore reuses
unarchiveWorkItem(components/issues/actions/workItemActionsClient.ts→DELETE /api/work-items/[id]/archive, gatedcanEdit). Do NOT add a new path. - Page state after restore:
router.refresh()/ refetch so the banner clears and the item rejoins active views. Wait on the unarchive 200.
Design: reuse the shipped detail-page banner PLACEMENT/treatment + the archived-mark vocabulary + the badge-chip pattern — match them, no new primitive. (If a bespoke archived-banner visual is later wanted, that's a small design pass.)
Acceptance criteria
- Viewing an archived item's detail shows the Archived banner (with archived-by/at) + a Restore action; an active item shows NO banner.
- Restore from the banner unarchives (
canEdit), clears the banner, returns the item to active views (waits on the 200). - Component test covers archived-vs-active render + restore; coverage gate holds.
Context refs
app/(authed)/issues/[key]/page.tsx(detail page; ~L317 readiness-banner placement),app/(authed)/issues/[key]/_components/WorkItemDetailActions.tsxlib/repositories/workItemRepository.tsfindByIdentifier(noarchivedAtfilter — archived items reachable),workItemsService.getIssueDetailcomponents/issues/actions/workItemActionsClient.tsunarchiveWorkItem;components/projects/BuildingInPublicBadge.tsx(chip pattern)design/work-items/design-notes.md(readiness banner placement);motir-core/CLAUDE.md§ "Page state after a mutation"