Berichten: status boven bericht, ongelezen-bolletje, 'markeer als ongelezen' en dashboardtegel met aantal ongelezen (CMS-U12)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-11 13:37:18 +01:00
co-authored by Claude Sonnet 5.5
parent 705f6e34d7
commit daccc6a227
10 changed files with 210 additions and 9 deletions
@@ -168,3 +168,15 @@
**Context**: Phase 2, one commit, nothing pushed.
---
## CMS-U12 built (unread UX)
**Timestamp**: 2026-11-11
**User Input**: Request via the lead session (owner's wish): status above the message in the detail, a visual unread indication in the list, a dashboard tile with the unread count (only when the contact module is on); first find out what "unread" means in the model.
**AI Response**: Model already has New/Read and marks read on open, so no backend change; added the dot, status placement, mark-as-unread button and dashboard tile with tests (frontend 482/482).
**Context**: Compact change, one commit.
---
@@ -0,0 +1,6 @@
# CMS-U12 — Unread indication, status placement and dashboard tile (summary)
- Model (unchanged, no backend work): `ContactMessageStatus` New/Read/Archived/Spam. New = unread; the detail dialog already marks a new message read when opened; `unreadCount` (status New, spam excluded) is part of every list answer; `PATCH /contact-messages/{id}` already accepts `new`.
- Frontend: status row moved above the message text in the detail; "Mark as unread" button for read messages (closes the dialog, so it is not marked read again); dot before the name for unread rows (`role="img"`, accessible name "Unread", plus the existing bold row and status badge); `MessagesTile` on the dashboard (unread count, link to /messages), shown only where the sidebar entry is shown (module loaded, role Owner/Administrator, management API answers); nl/en.
- Tests: dot with accessible name only for unread, status above body, mark-as-unread round trip (counter + dot), tile count + link, tile hidden without module and on 404. Full frontend suite 482/482, eslint and tsc clean.
- Decisions (small, within the request): dot before the name; the dashboard reads the counter from `GET /contact-messages?page=1&pageSize=1`.