Files
OpenVPN-Monitoring-Simple/DOCS/Changes/2026-10-04_Toast_Notifications.md
T
ayurishchevandClaude Sonnet 5.5 dcc3d7f2d5 UI: shared toast notifications in the bottom-right corner
- 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>
2026-10-04 21:05:41 +03:00

29 lines
1.8 KiB
Markdown

# Toast notifications (2026-10-04)
Goal: pop-up notifications in the bottom-right corner of the screen, readable in the light and the dark theme. Plan: [Toast_Notifications_PLAN](2026-10-04_Toast_Notifications_PLAN.md). UI only.
## Changes
| Area | Change |
|---|---|
| `composables/useToast.js` | Shared state: `show(text, type, timeout)`, `dismiss`, `pause`, `resume`; types `success`, `warning`, `error`, `info`; 5 s (errors 8 s); at most 4 on screen |
| `components/ToastContainer.vue` | Mounted once in `App.vue` (also on the Login page): icon, text, close button, progress bar; slide-in from the right; hover pauses the timer; `role="alert"` for errors, `role="status"` otherwise |
| `assets/main.css` | Fixed bottom-right stack above modals; surface from the theme variables, coloured stripe/icon/progress bar per type; separate colour tokens for the light and the dark theme; full width on phones; reduced motion supported. Old `.toast-message` styles removed |
| Views | `PKIConfig.vue`, `VPNConfig.vue`, `ServerManagement.vue`, `Certificates.vue` use the shared toast; their `showMessage` / `showToast` helpers are one-line wrappers, call sites unchanged; inline markup and local timers removed |
Not changed: SweetAlert2 dialogs in `Account.vue` and inline alerts on the Login page.
## Verification
`app-ui` image builds (Vite), the toast styles are in the bundle and the old ones are gone; appearance and behaviour (both themes, several toasts, hover pause, narrow window, toast over a modal) are checked manually.
## Notes
- Durations are unified: 5 s, errors 8 s (was 3 to 5 s).
- Toasts are global, so a message raised right before a route change stays visible after it.
- Touch devices have no hover: toasts there simply time out.
## Existing installations
Rebuild the UI image (`app-ui`); no configuration or data changes.