feat(person): show sender/receiver badge on each document #21
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
User Journey
Lena is on Heinrich's person page after issue #1 has been implemented, which shows both sent and received documents. She scrolls through a long mixed list and loses track of which letters Heinrich wrote vs. which he received. She has to open each document to find out.
With this feature, every document card in the list shows a small badge: "Gesendet" (dark) or "Empfangen" (mint). Lena sees the correspondence direction at a glance without opening anything.
High-Level Plan
After issue #1, the page has
data.sentDocumentsanddata.receivedDocumentsarrays. The role context (sender vs. receiver) is already known from which array the document came from — no API change needed. Add a small badge to the document card component in the person page.Depends on: issue #1 (split sent/received document sections).
Detailed Plan
Frontend only
Badge in the document list item (
persons/[id]/+page.svelte):When iterating over
sentDocuments, pass arole="sent"context. When iterating overreceivedDocuments, passrole="received". Render a badge in the top-right of each card:i18n keys — add to
de.json,en.json,es.json:person_role_sender: DE"Gesendet"/ EN"Sent"/ ES"Enviado"person_role_receiver: DE"Empfangen"/ EN"Received"/ ES"Recibido"Badge sits alongside the existing
doc.statusbadge — they serve different purposes and can coexist.Acceptance Criteria