feat(console): add in-app destructive-action confirmation

Deleting a route or a group used `window.confirm`, which blocks the page
and ignores the console theme. A promise-based `useConfirm()` now drives
one <ConfirmDialog /> built on the reka-ui AlertDialog that
@elysola/ui ships; reka-ui is pre-bundled so dev keeps a single copy and
the dialog stacks with the Rc dialogs.

A request never outlives its asker: one made after the asking component
unmounted resolves false, and one still open when it unmounts is
cancelled.
This commit is contained in:
翅膀 committed 2026-10-17 00:12:36 +08:00
1 parent d57e5c29c4
commit 24f5d0477c
8 files changed
+239 -7

No files matched your search

+5 -1
View File
@@ -37,11 +37,15 @@ export default defineNuxtConfig({
},
vite: {
plugins: [tailwindcss()],
// App components use reka-ui primitives directly, alongside the copy
// @elysola/ui imports. Pre-bundling it up front keeps both on one
// dev instance; otherwise a mid-session discovery splits them and dialogs
// and popovers stop stacking (Escape / outside clicks reach the wrong layer).
// `debug` and `extend` are CommonJS packages @elysola/ui's markdown stack
// (micromark, unified) imports; served unbundled in dev they lack a default
// export and the console fails to start.
optimizeDeps: {
include: ["debug", "extend"],
include: ["reka-ui", "debug", "extend"],
},
},
devtools: { enabled: false },