feat(frontend): render honest precision dates in detail, list and search

Wires formatDocumentDate/DocumentDate into the read sites: the document
detail top bar + metadata drawer (the drawer shows the visible "Originaltext:"
raw line for UNKNOWN/SEASON/APPROX), the search/list rows (DocumentRow,
mobile + desktop), and the document multi-select dropdown label. A MONTH or
SEASON document now reads "Juni 1916"/"Sommer 1916" everywhere instead of a
fabricated day.

Adds metaDatePrecision to the DocumentRow/DocumentMultiSelect test fixtures
(required on DocumentListItem since #671) and updates the multi-select label
assertion to the honest long date.

Refs #666

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-05-27 11:56:49 +02:00
parent 6538c9e59a
commit b56b9dfa74
8 changed files with 86 additions and 19 deletions

View File

@@ -9,6 +9,7 @@ const docFactory = (id: string, title: string, date = '1880-01-01') => ({
id,
title,
documentDate: date,
metaDatePrecision: 'DAY' as const,
originalFilename: `${title}.pdf`,
receivers: [],
tags: [],
@@ -55,7 +56,8 @@ describe('DocumentMultiSelect — rendering', () => {
selectedDocuments: [docFactory('d1', 'Brief vom 1. Mai', '1882-05-01')]
});
await expect.element(page.getByText(/Brief vom 1\. Mai/)).toBeInTheDocument();
await expect.element(page.getByText(/01\.05\.1882/)).toBeInTheDocument();
// DAY precision renders the honest long date (formatDocumentDate), not 01.05.1882.
await expect.element(page.getByText(/1\. Mai 1882/)).toBeInTheDocument();
});
it('emits a hidden documentIds input for each pre-selected document', async () => {