GRI-2143: add a panel-wide notification stack for action results #280

Merged
vivy merged 2 commits from feature/GRI-2143-notification-stack into dev 2026-11-16 10:46:35 +00:00
Member

Forge issue: #279

Summary

  • New NotificationsProvider/useNotifications() (frontend-web/src/notifications/): one stack, top right, success/error/info. Newest at the bottom; a dismissed entry drops out of the accessibility tree at once while its box fades and collapses, so the ones below animate up into its place. Respects prefers-reduced-motion (global rule already zeroes transition durations).
  • Success/info auto-dismiss after 4s; error follows #236's rule (closable, auto-dismiss paused while the pointer is on it, 10s otherwise).
  • Mounted once in App.tsx, above both the dashboard and the pre-dashboard screens (setup/login), so every write-action screen can report through it.
  • Reused for: Devices (approve/block/rename/assign/unassign/refresh), Media (upload/delete/move), Campus playback settings (save), Campuses (rename/delete), Playlist settings (rename/delete) and playlist device assignment/refresh — replacing their own inline DismissibleError/notice state.
  • Left as inline, field-level feedback (not migrated): client-side form validation shown next to the field itself (add-campus/add-playlist-URL/rename forms, and the full-screen "could not load" states before a screen has anything to show). Those aren't the result of a write action resolving; they're validation or "nothing loaded yet".

Not done in this pass

A few lower-traffic screens (PlaylistsScreen, IpRulesScreen, NetworkSettingsTab, PlaybackSettingsTab, SetupWizard/SetupScreen/LoginScreen) still use the old DismissibleError for their own action results. Flagged on the forge issue as a likely fast follow-up rather than folded into this PR, to keep this change reviewable.

Test plan

  • frontend-web: npm run check (prettier, oxlint, tsc, vitest) — all green, 172/172 tests.
  • New component tests (NotificationsProvider.test.tsx): stack order (newest at bottom), fade+removal timing, move-up after a sibling clears, close button, pointer-hold pause/resume on errors, error timeout longer than success, accessible roles (status/alert).
  • npm run build succeeds.
  • ./scripts/local-gates.sh --frontend-only — every gate passed.
  • Not verified in an actual browser (no browser/screenshot tooling available in this environment) — verified via component tests, manual code review of the design tokens used (colors/spacing/radius all through @grimoirix/design custom properties, no literals), and the existing global prefers-reduced-motion rule.
Forge issue: https://git.grimoirix.org/Grimoirix/grimoire-of-digital-signage/issues/279 ## Summary - New `NotificationsProvider`/`useNotifications()` (`frontend-web/src/notifications/`): one stack, top right, success/error/info. Newest at the bottom; a dismissed entry drops out of the accessibility tree at once while its box fades and collapses, so the ones below animate up into its place. Respects `prefers-reduced-motion` (global rule already zeroes transition durations). - Success/info auto-dismiss after 4s; error follows #236's rule (closable, auto-dismiss paused while the pointer is on it, 10s otherwise). - Mounted once in `App.tsx`, above both the dashboard and the pre-dashboard screens (setup/login), so every write-action screen can report through it. - Reused for: Devices (approve/block/rename/assign/unassign/refresh), Media (upload/delete/move), Campus playback settings (save), Campuses (rename/delete), Playlist settings (rename/delete) and playlist device assignment/refresh — replacing their own inline `DismissibleError`/notice state. - Left as inline, field-level feedback (not migrated): client-side form validation shown next to the field itself (add-campus/add-playlist-URL/rename forms, and the full-screen "could not load" states before a screen has anything to show). Those aren't the result of a write action resolving; they're validation or "nothing loaded yet". ## Not done in this pass A few lower-traffic screens (`PlaylistsScreen`, `IpRulesScreen`, `NetworkSettingsTab`, `PlaybackSettingsTab`, `SetupWizard`/`SetupScreen`/`LoginScreen`) still use the old `DismissibleError` for their own action results. Flagged on the forge issue as a likely fast follow-up rather than folded into this PR, to keep this change reviewable. ## Test plan - [x] `frontend-web`: `npm run check` (prettier, oxlint, tsc, vitest) — all green, 172/172 tests. - [x] New component tests (`NotificationsProvider.test.tsx`): stack order (newest at bottom), fade+removal timing, move-up after a sibling clears, close button, pointer-hold pause/resume on errors, error timeout longer than success, accessible roles (`status`/`alert`). - [x] `npm run build` succeeds. - [x] `./scripts/local-gates.sh --frontend-only` — every gate passed. - [ ] Not verified in an actual browser (no browser/screenshot tooling available in this environment) — verified via component tests, manual code review of the design tokens used (colors/spacing/radius all through `@grimoirix/design` custom properties, no literals), and the existing global `prefers-reduced-motion` rule.
GRI-2143: add a panel-wide notification stack for action results
All checks were successful
CI / the pre-push hook (pull_request) Successful in 4s
CI / cargo fmt (pull_request) Successful in 3s
CI / install.sh client upgrade (pull_request) Successful in 13s
CI / cargo deny (pull_request) Successful in 44s
CI / cargo deny advisories (pull_request) Successful in 38s
CI / repository boundary (pull_request) Successful in 4s
CI / cargo clippy (pull_request) Successful in 1m8s
CI / frontend-web (pull_request) Successful in 1m2s
CI / cargo test (pull_request) Successful in 4m29s
CI / CI (pull_request) Successful in 2s
CI / Notify gate failed (pull_request) Has been skipped
0f1d15a89f
One stack, top right, reports the result of every write the panel makes —
success, error and info — instead of each screen rolling its own inline
notice/error state. Newest at the bottom; a dismissed entry fades and
collapses so the ones below animate up into its place. Errors follow #236's
rule (closable, auto-dismiss paused while the pointer is on it); success and
info auto-dismiss sooner. Reuses it for devices, media, campuses and
playlists in place of their own DismissibleError/notice state.
Merge remote-tracking branch 'origin/dev' into feature/GRI-2143-notification-stack
All checks were successful
CI / the pre-push hook (pull_request) Successful in 4s
CI / cargo fmt (pull_request) Successful in 4s
CI / install.sh client upgrade (pull_request) Successful in 12s
CI / cargo deny (pull_request) Successful in 19s
CI / cargo deny advisories (pull_request) Successful in 19s
CI / cargo clippy (pull_request) Successful in 1m8s
CI / repository boundary (pull_request) Successful in 4s
CI / frontend-web (pull_request) Successful in 57s
CI / cargo test (pull_request) Successful in 3m35s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 1s
c3b913e69e
# Conflicts:
#	frontend-web/src/screens/MediaLibraryScreen.test.tsx
#	frontend-web/src/screens/MediaLibraryScreen.tsx
#	frontend-web/src/screens/settings/SettingsSectionScreen.test.tsx
vivy approved these changes 2026-11-16 10:46:31 +00:00
vivy left a comment

Approved, and merging. Meets the "done when" of #279: the stack, its tests (order, fade, move-up, pointer hold) and save/delete/upload use it. CI 7/7 green, up to date with dev 4353d22.

#279 stays open for the rest, because the product owner asked for every button. Still inline, not in the stack:

  • PlaylistMediaTab — playlist Save (the save he presses most; not in your not-done list)
  • UsersScreen — add user, set password, edit
  • PlaybackSettingsTab — global default playtime save
  • PlaylistsScreen, IpRulesScreen, NetworkSettingsTab
    Login/setup screens may keep their inline error: there is no action result to report there yet. Field validation next to a field may also stay inline.
    Please do the list above as a second PR on #279.
Approved, and merging. Meets the "done when" of #279: the stack, its tests (order, fade, move-up, pointer hold) and save/delete/upload use it. CI 7/7 green, up to date with dev 4353d22. **#279 stays open** for the rest, because the product owner asked for *every* button. Still inline, not in the stack: - `PlaylistMediaTab` — playlist **Save** (the save he presses most; not in your not-done list) - `UsersScreen` — add user, set password, edit - `PlaybackSettingsTab` — global default playtime save - `PlaylistsScreen`, `IpRulesScreen`, `NetworkSettingsTab` Login/setup screens may keep their inline error: there is no action result to report there yet. Field validation next to a field may also stay inline. Please do the list above as a second PR on #279.
vivy merged commit 40cb6aa590 into dev 2026-11-16 10:46:35 +00:00
vivy deleted branch feature/GRI-2143-notification-stack 2026-11-16 10:46:36 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Grimoirix/grimoire-of-digital-signage!280
No description provided.