feat: HQ-wide Toast + Confirm — no more browser alert()/confirm() popups
Deploy to VPS / deploy (push) Has been cancelled

The Inbox panel got the polished Toast + Confirm primitives a few
commits back. This commit propagates them across every other panel in
HQ Command so the editor experience is uniformly on-brand. No more
1990s browser dialogs interrupting the dark CMS look.

NINE PANELS, ELEVEN CALL SITES UPGRADED
- health/page.tsx       — DB export errors → toast
- network/page.tsx      — Delete deployment → confirm + toast
- heritage/page.tsx     — Delete section → confirm + toast
- users/page.tsx        — Revoke architect → confirm + error toast
- news/page.tsx         — Delete article → confirm + toast
- applications/page.tsx — Save error toast + delete-app confirm
- parts/page.tsx        — Delete component → confirm + toast
- hero/page.tsx         — Delete slide → confirm + toast
- timeline/page.tsx     — Delete milestone → confirm + toast

Each destructive confirm now spells out what it does ('Permanently
remove this case from the global map. The asset folder on disk is
kept for safety') instead of a generic 'Delete?' prompt — much
clearer for editors who aren't sure whether files get nuked too.

Each success toast names the action ('Component deleted', 'Slide
deleted', 'Architect access revoked') so the editor sees exactly
what fired. Errors come in as red toasts with the actual error text.

NO BACKEND CHANGES. Pure UX layer on top of existing actions.
The HqUiProvider was already mounted in src/app/hq-command/layout.tsx,
so wiring up was just useHqUi() per page + the replacement calls.
This commit is contained in:
2026-05-05 21:16:02 -05:00
parent e177bca92f
commit 59a146ef10
9 changed files with 109 additions and 14 deletions
+3 -1
View File
@@ -7,8 +7,10 @@ import {
DownloadCloud, ShieldAlert, UploadCloud, Loader2, CheckCircle2
} from "lucide-react";
import { getSystemMetrics, exportDatabase, restoreDatabase } from "./actions";
import { useHqUi } from "@/components/hq/Toast";
export default function SystemHealth() {
const ui = useHqUi();
const [metrics, setMetrics] = useState<any>(null);
const [isExporting, setIsExporting] = useState(false);
@@ -54,7 +56,7 @@ export default function SystemHealth() {
document.body.removeChild(a);
URL.revokeObjectURL(url);
} else {
alert(res.error || "Export failed.");
ui.toast(res.error || "Export failed.", "error");
}
setIsExporting(false);
};