- useToast composable and ToastContainer (mounted once in App.vue): stacked toasts with icon, close button and progress bar, hover pause, slide-in animation, aria roles, full width on phones. - Light and dark theme colour tokens; old .toast-message styles removed. - PKIConfig, VPNConfig, ServerManagement and Certificates use the shared toast through thin showMessage/showToast wrappers. - Docs: plan and summary in DOCS/Changes, README, Index. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2.5 KiB
2.5 KiB
Toast notifications: implementation plan (2026-10-04)
Goal: pop-up notifications appear in the bottom-right corner of the screen, are not lost, and look good in the light and dark themes. UI only.
Current state
- Four views implement their own notification:
PKIConfig.vue,VPNConfig.vue,ServerManagement.vuerender.toast-messageinside the page card (top of the page, scrolls away, one message at a time);Certificates.vuehas its own fixed bottom-right copy with inline styles. - Styles (
assets/main.css,.toast-message,.toast-success|warning|error) use fixed light colours, no dark theme. Account.vueuses SweetAlert2 dialogs andLogin.vueinline alerts: these are dialogs, not toasts, and stay as they are.
Steps
src/composables/useToast.js: shared reactive list of toasts;show(text, type = 'success', timeout)with typessuccess | warning | error | info;dismiss(id). Default timeout 5 s (errors 8 s); max 4 on screen (oldest dropped).src/components/ToastContainer.vue, mounted once inApp.vue: fixed bottom-right (z-indexabove modals), stacked column,TransitionGroupslide-in from the right and fade-out; each toast has an icon, text, close button, thin progress bar; the timer pauses on hover;role="status"(role="alert"for errors) witharia-live; on phones full width at the bottom.- Design (
main.css): card surface from existing variables (--bg-card,--border-color,--text-main), a coloured accent stripe and icon per type, soft shadow; separate colour tokens for the light and the dark theme ([data-theme="dark"]) so contrast stays readable in both. Old.toast-messagestyles are removed. - Views:
PKIConfig.vue,VPNConfig.vue,ServerManagement.vue,Certificates.vuecalluseToast().show(...)(theirshowMessage/showToasthelpers stay as thin wrappers, call sites are not changed); inline toast markup and local timers are removed. - Tests: none (no UI test infrastructure; no logic on the server side).
- Verification: rebuild
app-uion the stand (port 8089) and check manually: all four pages, success / warning / error, several toasts at once, hover pause, close button, light and dark theme, narrow window, toast above an open modal (Certificates note save). - Documentation: summary
DOCS/Changes/2026-10-04_Toast_Notifications.md, row inREADME.md, link inDOCS/General/Index.md.
Out of scope
SweetAlert2 dialogs in Account.vue, inline login alerts, sound, persistent notification history.