Admin Berichten: toggle-switch, statusicoon, archiveren/terugzetten (CMS-U10)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-10 23:20:05 +01:00
co-authored by Claude Sonnet 5.5
parent 5378c21799
commit 787131002f
10 changed files with 245 additions and 78 deletions
@@ -0,0 +1,9 @@
# CMS-U10 — Berichten UX (summary)
Frontend only, `frontend/src/features/contact` + nl/en texts (`contact.switch.on|off`, `contact.detail.archive|restore`).
- **Form switch**: new `ToggleSwitch` (native button, `role="switch"`, `aria-checked`, label as accessible name, state as visible text "Aan"/"Uit", `min-h-11 min-w-11` target, Space/Enter, disabled while saving). Existing error handling, toast and first-time hint unchanged.
- **Status**: new `StatusIcon` (envelope = new, open envelope = read, archive box = archived, shield = spam) with the name as visible text and `title`; the same component in the list and the detail dialog. The status select is gone.
- **Detail actions**: opening an unread message still marks it read automatically (no button). Buttons: Archiveren (new/read), Terugzetten (archived -> read), Geen spam (spam), Verwijderen, Opnieuw mailen.
- **Subject**: shown literally as the site sent it (no transformation); mock data now uses capitalised labels ('Website', 'Onderhoudspakket', 'Overig'). The local dev database was re-seeded with such labels (not part of the repo).
- Tests: switch (role, name, state text, 44px classes, Space/Enter, disabled while saving), no select, status icon with text in list and detail, archive/restore flow, literal subject. Lint and `tsc -b` clean, vitest 59 files / 470 tests.