Co-authored-by: Arnaud Dartois <admin@tordais.cc>
3.0 KiB
name, description
| name | description |
|---|---|
| notification-center | Implement and accept the authenticated Heimdall in-app notification center. |
Notification center
The header bell is rendered by Components/Shared/NotificationBadge.razor; it displays the unread count delivered by NotificationsHubClient and must navigate to /notifications. The page reads the signed-in user's list through HeimdallApiClient and the existing GET /api/notifications endpoint. Read actions use the existing per-user POST /api/notifications/{id}/read and POST /api/notifications/mark-all-read endpoints, then refresh the hub count. Keep authorization on the page and user scoping in the API/application handlers; never accept a user id from the browser.
When documenting delivery channels in docs/notifications.md or its summary in docs/specs.md, verify NotificationChannel, SendNotificationJob, NotificationSettingsSection.razor, Profile.razor, the delivery services, and BackgroundJobs/JobSetup.cs. The shipped external channels are SMTP email and ntfy; do not describe Gotify as integrated. /settings owns global SMTP/ntfy settings and test actions, while /profile owns user preferences. Check both digest job implementations and their schedules before documenting cadence. Distinguish source inspection from validation against a real SMTP/ntfy deployment. Remove obsolete channel integrations, editor flows, and test claims from docs/notifications.md and docs/specs.md; if a historical example must remain, label that exact heading/table/snippet locally rather than relying on a broad notice elsewhere in the guide. When the notification guide’s scope or delivered status changes, update both notification summaries in docs/README.md to match it.
When legacy notification designs remain in docs/MASTER_SPECIFICATION.md, put a local dated historical/non-shipped note beside each section, queue example, or UI mockup, and link to docs/notifications.md. A document-level historical header alone is not sufficient for Gotify or template-editor claims.
Acceptance
- Build
Heimdall.Webwith the SDK fromglobal.jsonand run focused Web tests. - In disposable Central + PostgreSQL Compose, create only synthetic notifications for the disposable admin, open
/notificationsfrom the header bell, confirm notification content appears and/eventsis not loaded. - Mark one item read and all items read; verify displayed state and unread badge refresh. Confirm empty and API failure states render.
- Use unique Compose project, generated credentials, loopback port, and project-owned image tag. Follow
compose-disposable-recipeexactly: remove only that project and exact local tag, verify project containers/volumes/networks and image tag are absent, and retain shared images.
The empty and failed API states have focused bUnit coverage in NotificationsPageTests. Simulate the API error with an HTTP 500 response for GET /api/notifications; taking PostgreSQL offline also breaks server-side session validation before the page can handle the notification request.