From 8bece70a61e70eda8d06a996b32a29aad9a60685 Mon Sep 17 00:00:00 2001 From: Lukas May Date: Wed, 18 Feb 2026 17:44:01 +0900 Subject: [PATCH] fix: Wire archive button to updateInitiative mutation The Archive menu item in InitiativeCard had no onClick handler. Added mutation call with confirmation dialog (shift+click to skip). --- packages/web/src/components/InitiativeCard.tsx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/web/src/components/InitiativeCard.tsx b/packages/web/src/components/InitiativeCard.tsx index 32bfb98..6bbeddf 100644 --- a/packages/web/src/components/InitiativeCard.tsx +++ b/packages/web/src/components/InitiativeCard.tsx @@ -36,6 +36,21 @@ export function InitiativeCard({ onSpawnArchitect, onDelete, }: InitiativeCardProps) { + const utils = trpc.useUtils(); + const archiveMutation = trpc.updateInitiative.useMutation({ + onSuccess: () => utils.listInitiatives.invalidate(), + }); + + function handleArchive(e: React.MouseEvent) { + if ( + !e.shiftKey && + !window.confirm(`Archive "${initiative.name}"?`) + ) { + return; + } + archiveMutation.mutate({ id: initiative.id, status: "archived" }); + } + // Each card fetches its own phase stats (N+1 acceptable for v1 small counts) const phasesQuery = trpc.listPhases.useQuery({ initiativeId: initiative.id, @@ -109,7 +124,7 @@ export function InitiativeCard({ - Archive + Archive