Files
familienarchiv/frontend/src/lib/notification
Marcel 89860403f6
Some checks failed
CI / Unit & Component Tests (pull_request) Failing after 1m50s
CI / OCR Service Tests (pull_request) Successful in 18s
CI / Backend Unit Tests (pull_request) Successful in 4m12s
CI / fail2ban Regex (pull_request) Successful in 38s
CI / Compose Bucket Idempotency (pull_request) Failing after 10s
CI / Unit & Component Tests (push) Failing after 2m5s
CI / OCR Service Tests (push) Successful in 17s
CI / Backend Unit Tests (push) Successful in 4m14s
CI / fail2ban Regex (push) Successful in 39s
CI / Compose Bucket Idempotency (push) Failing after 12s
nightly / deploy-staging (push) Failing after 2m36s
fix(notification): remove role=link from view-all button — restores semantically honest button role
The role=link override on a <button> creates a WCAG 4.1.2 keyboard-contract
mismatch: ARIA role=link tells AT users "press Enter to activate (Space does
nothing)", but the native <button> responds to both Enter and Space. Removes
the override so the element is announced as "button" (accurate).

Test selectors updated from getByRole('link') to getByRole('button')
accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 18:01:38 +02:00
..

notification (frontend)

Bell-icon dropdown and real-time SSE connection for in-app notifications.

What this domain owns

Components: NotificationBell.svelte, NotificationDropdown.svelte. Utilities: notifications.svelte.ts (Svelte 5 reactive store), notifications.ts (API helpers).

What this domain does NOT own

  • SSE infrastructure — the backend's SseEmitterRegistry manages the server-side emitter. The frontend establishes one EventSource connection per session. Connection management lives in notifications.svelte.ts.
  • Notification content rendering — notification payloads contain a contextUrl; the frontend navigates there on click.

Key design: SSE connection

The SSE path is backend → browser directly (not proxied through SvelteKit SSR). The EventSource connects to /api/notifications/stream. On receive, the reactive store updates the unread count and the bell dropdown in real time.

Backend SseEmitterRegistry → /api/notifications/stream → EventSource in browser

Key components

Component Used in Notes
NotificationBell.svelte global nav (+layout.svelte) Bell icon with unread badge; opens NotificationDropdown
NotificationDropdown.svelte global nav Scrollable list of recent notifications with mark-read

Cross-domain imports

  • shared/primitives/ — icon, button primitives only

Backend counterpart

backend/src/main/java/org/raddatz/familienarchiv/notification/README.md