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-795

2.8.4 UI — delete action + confirm dialog (detail/list/board), permission-gated

Done
Description

Estimate: 95m · Type: code · Depends on: 2.8.1, 2.8.2, 2.8.3, 2.8.7

The full work-item ⋯ actions menu + the Delete UI, in one card (Archive folded in per Yue 2026-06-15; ex-2.8.8/2.8.9 cancelled). Build the shared Popover ⋯ actions menu on the work-item detail header, the issues-list row, and the board card (none has one today), per 2.8.1 panels 0–1: Edit details (→ existing edit route) · Copy link (clipboard) · — · Archive · Delete…. Permission-gate per the design: Edit/Archive need canEdit, Delete needs canManage (canDelete) — a user without a capability does not see that row.

Delete → opens the 2.8.1 confirm dialog (alertdialog Modal) reading the cascade count + per-kind breakdown from GET /api/work-items/[id]/delete-preview (2.8.7); confirm → DELETE /api/work-items/[id] (2.8.3); optimistic removal of the item + subtree from the list/board/tree island and navigate away from a deleted detail page.

Archive → reversible single-node (archive/unarchive already exist as service+MCP, PR #1191, but have NO web affordance). Add a thin web archive route over archiveWorkItem (canEdit); lightweight optimistic archive + toast with Undo (→ unarchive); the archived item drops out of active list/board (already filtered). The Delete dialog's "Archive instead" link triggers this. NOTE: the Archive flow + archived-state were NOT designed in 2.8.1 — design gate waived by Yue; keep minimal/standard (Jira/Linear mirror), document decisions in the PR. A full archived-items browser / restore page is OUT OF SCOPE.

Acceptance criteria

  • Shared ⋯ menu on detail/list/board: Edit details · Copy link · Archive · Delete, matching 2.8.1; permission-gated (Archive=canEdit, Delete=canManage); non-permitted rows hidden.
  • Delete: confirm shows cascade count (from delete-preview); after delete the item+subtree disappear and a deleted detail page redirects; non-permitted users see no Delete.
  • Archive: optimistic archive + Undo toast; item leaves active views; surfaces update (server vs client-island rule).
  • --el-*/shape tokens; "How to test" + an Archive design-decisions note in the PR.

Context refs

  • design/work-items/delete-confirm.mock.html + design-notes (2.8.1); GET delete-preview (2.8.7) + DELETE route (2.8.3) + deleteWorkItem/archiveWorkItem services; app/(authed)/issues/[key]/page.tsx, issues/_components/*, boards/_components/BoardCard.tsx; projectAccessService.getManageCapabilities/getCapabilities; CreateIssueProvider.issuesChangedAt; CLAUDE.md "Page state after a mutation".