MotirBuilding in public
MOTIR · moooon
onMotir
You’re viewing a public project. Anyone can view it — no account needed. Sign in to submit, upvote, or comment on requests.View-only — you can’t edit work items
MOTIR-995

2.9.6 Archived banner on the work-item detail page (+ Restore)

Done
Description

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.findByIdentifier does NOT filter archivedAt, 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) — when item.archivedAt != null. Content: an "Archived" treatment reusing the archived-mark / muted vocabulary + a status chip in the BuildingInPublicBadge mold (components/projects/BuildingInPublicBadge.tsx), the when/who archived (from the archived revision), and a Restore action.
  • Restore reuses unarchiveWorkItem (components/issues/actions/workItemActionsClient.tsDELETE /api/work-items/[id]/archive, gated canEdit). 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.tsx
  • lib/repositories/workItemRepository.ts findByIdentifier (no archivedAt filter — archived items reachable), workItemsService.getIssueDetail
  • components/issues/actions/workItemActionsClient.ts unarchiveWorkItem; components/projects/BuildingInPublicBadge.tsx (chip pattern)
  • design/work-items/design-notes.md (readiness banner placement); motir-core/CLAUDE.md § "Page state after a mutation"