feat: restore sender/receiver grouping on /documents when sorting by SENDER or RECEIVER #283

Closed
opened 2026-04-20 09:26:11 +02:00 by marcel · 1 comment
Owner

Background

The old home-page document search grouped results by the active sort key:

  • DATE → group by year (current behaviour on /documents)
  • SENDER → group by sender.displayName
  • RECEIVER → group by each receiver.displayName (a document with multiple receivers appears in every receiver's group)

When the search was extracted to /documents in #281, only year-grouping was kept.

Goal

Restore dynamic grouping in DocumentList.svelte so the year-card style is reused for sender and receiver groups.

Acceptance Criteria

  • Sorting by SENDER: documents are grouped under year-card-style headers showing the sender's display name; documents with no sender fall under "Unbekannter Absender"
  • Sorting by RECEIVER: documents are grouped under year-card-style headers showing each receiver's display name; a document with N receivers appears in N groups; documents with no receivers fall under "Unbekannter Empfänger"
  • All other sort modes (DATE, TITLE, RELEVANCE, UPLOAD_DATE): year grouping unchanged
  • documents/+page.svelte passes the active sort value down to DocumentList
  • Fallback labels translated in de / en / es

Files

  • frontend/src/routes/DocumentList.svelte — add sort prop, replace yearGroups with branching groups derived
  • frontend/src/routes/documents/+page.svelte — pass sort to DocumentList
  • frontend/messages/de.json, en.json, es.json — add fallback label keys
## Background The old home-page document search grouped results by the active sort key: - **DATE** → group by year (current behaviour on `/documents`) - **SENDER** → group by `sender.displayName` - **RECEIVER** → group by each `receiver.displayName` (a document with multiple receivers appears in every receiver's group) When the search was extracted to `/documents` in #281, only year-grouping was kept. ## Goal Restore dynamic grouping in `DocumentList.svelte` so the year-card style is reused for sender and receiver groups. ## Acceptance Criteria - Sorting by **SENDER**: documents are grouped under year-card-style headers showing the sender's display name; documents with no sender fall under "Unbekannter Absender" - Sorting by **RECEIVER**: documents are grouped under year-card-style headers showing each receiver's display name; a document with N receivers appears in N groups; documents with no receivers fall under "Unbekannter Empfänger" - All other sort modes (DATE, TITLE, RELEVANCE, UPLOAD_DATE): year grouping unchanged - `documents/+page.svelte` passes the active `sort` value down to `DocumentList` - Fallback labels translated in de / en / es ## Files - `frontend/src/routes/DocumentList.svelte` — add `sort` prop, replace `yearGroups` with branching `groups` derived - `frontend/src/routes/documents/+page.svelte` — pass `sort` to `DocumentList` - `frontend/messages/de.json`, `en.json`, `es.json` — add fallback label keys
marcel added the feature label 2026-04-20 09:26:15 +02:00
Author
Owner

Implemented

Sender/receiver grouping restored on the /documents page.

What was done:

  • DocumentList now accepts a sort prop and dispatches to one of three grouping functions (groupByYear, groupBySender, groupByReceiver) via $derived.by()
  • sort=SENDER: documents group under sender.displayName cards; falls back to "Unbekannter Absender" when sender is absent
  • sort=RECEIVER: documents appear under each receiver's card (a document with N receivers appears N times); falls back to "Unbekannter Empfänger" for documents with no receivers
  • sort=DATE (or anything else): original year grouping preserved unchanged
  • sort={sort} passed from documents/+page.svelte to <DocumentList>
  • i18n keys added for all three languages (de/en/es)
  • 6 new browser tests covering all grouping scenarios (16 total, all green)

Commits:

  • 06ba11a feat(i18n): add unknown sender/receiver fallback labels for document grouping
  • ca3d809 feat(documents): restore sender/receiver grouping in document list

Branch: feat/issue-283-sender-receiver-grouping

## Implemented ✅ Sender/receiver grouping restored on the `/documents` page. **What was done:** - `DocumentList` now accepts a `sort` prop and dispatches to one of three grouping functions (`groupByYear`, `groupBySender`, `groupByReceiver`) via `$derived.by()` - `sort=SENDER`: documents group under `sender.displayName` cards; falls back to "Unbekannter Absender" when sender is absent - `sort=RECEIVER`: documents appear under each receiver's card (a document with N receivers appears N times); falls back to "Unbekannter Empfänger" for documents with no receivers - `sort=DATE` (or anything else): original year grouping preserved unchanged - `sort={sort}` passed from `documents/+page.svelte` to `<DocumentList>` - i18n keys added for all three languages (de/en/es) - 6 new browser tests covering all grouping scenarios (16 total, all green) **Commits:** - `06ba11a` feat(i18n): add unknown sender/receiver fallback labels for document grouping - `ca3d809` feat(documents): restore sender/receiver grouping in document list Branch: `feat/issue-283-sender-receiver-grouping`
Sign in to join this conversation.
No Label feature
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: marcel/familienarchiv#283