Admin operational lifecycle and deletion choices
Mermaid flowchart expresses UML activity concepts. This is the normal standalone path with adminWritesEnabled true. Client token presence does not prove server acceptance; route auth remains authoritative. Media has separate client/error handling. No server recycle bin or universal Undo is implemented. Canceling blog confirmation or using media Undo keeps the item without DELETE. Tab storage is independent after duplication; no server-side logout is issued.
flowchart TB
A([Open admin]) --> H["Client-only pages load session plugin"]
H --> S["Restore token/database state"]
S --> G{"Token present for protected page?"}
G -->|No| L["Sign in with shared token"]
L --> V{"Server accepts token?"}
V -->|No| L
V -->|Yes| SAVE["Save token and follow safe redirect"]
SAVE --> NAV["Select feature and backend"]
G -->|Yes| NAV
NAV --> F{"Operation"}
F -->|Blog| B["List / edit / publish / unpublish"]
F -->|Messages| M["List messages"]
F -->|CDN| C["List / upload / sync"]
F -->|Media| D["Separate DAM workflow"]
F -->|Deletion| K{"Feature"}
K -->|Blog| BC["Native confirm then DELETE"]
K -->|Message or CDN| DC["Immediate DELETE"]
K -->|Media| MC["Inline confirm and 8-second Undo before DELETE"]
B --> R{"Response"}
M --> R
C --> R
D --> R
BC --> R
DC --> R
MC --> R
R -->|Success| NAV
R -->|Other error| E["Surface error"]
E --> NAV
R -->|Current-token 401 via adminFetch| EX["Clear token, expired sign-in"]
EX --> L
NAV -->|Clear saved token| OUT["Clear token, preserve database"]
OUT --> L
Source evidence
- packages/web-layer-admin/nuxt.config.ts:21 — ‘/admin’: { ssr: false }
- packages/web-layer-admin/app/middleware/admin-auth.ts:5 — export default defineNuxtRouteMiddleware
- packages/web-layer-admin/app/plugins/admin-session.client.ts:7 — export default defineNuxtPlugin
- packages/web-layer-admin/app/pages/admin/blog/[id].vue:177 — const onDelete
- core/admin/app/pages/admin/messages/index.vue:77 — const onDelete
- core/admin/app/pages/admin/cdn/index.vue:163 — const onDelete
- core/admin/app/pages/admin/media/index.vue:196 — deleteCommitTimer
- packages/web-layer-admin/app/composables/useAdminSession.ts:30 — signOut: