Skip to content

feat(notifications): preference delivery preview before save - #1199

Merged
llinsss merged 1 commit into
DogStark:mainfrom
sunred-liu:fix/1112-notification-preference-preview
Oct 30, 2026
Merged

llinsss merged 1 commit into
DogStark:mainfrom
sunred-liu:fix/1112-notification-preference-preview

Conversation

@sunred-liu

Copy link
Copy Markdown
Contributor

closes #1112

Summary

Adds an accessible delivery preview to the notification preferences screen (issue #1112) so an owner can see exactly what they will receive before saving — the channels a message travels on, and the precise event categories that will trigger delivery.

What changed (all additive; the panel only gains a preview section)

  • src/utils/notificationPreview.ts — pure, dependency-free helper buildNotificationPreview(prefs) that derives, from the current selections: enabled channels (in-app is always available; sound / vibration / browser push reflect the toggles), the list of event categories that will trigger delivery, a privacy-mode note when Do Not Disturb quiet hours are on, and an isEmpty flag when no event type is enabled.
  • src/components/Notifications/NotificationPreferencePreview.tsx — a keyboard- and screen-reader-friendly panel (<section> + real <ul> lists, a live role="status" summary, status text that does not rely on colour alone) rendered above the Save button, updating live as the owner toggles channels and categories.
  • src/components/Notifications/NotificationPreferencesPanel.tsx — mounts the preview; no existing toggle or behaviour was changed.
  • Unit tests: notificationPreview.test.ts (channel/category derivation, DND quiet-hours summary, empty/denied state, single-category boundary) and NotificationPreferencePreview.test.tsx (render + jest-axe accessibility, no violations).

Privacy & scope

  • Authorization and consent remain server-side: this PR only reflects the owner's local selections and never sends or enforces anything. It surfaces what the backend will do once saved.
  • No PII is shown; channel samples are illustrative text only.

Verification

  • jest (ts-jest): 16/16 new tests passing across the two suites; full suite failure count unchanged vs baseline (104 pre-existing, environment-related) — zero regression.
  • tsc --noEmit: no type errors in the added/changed files.

@llinsss
llinsss merged commit f26dea8 into DogStark:main Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Frontend] Add notification preference preview before save

2 participants