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:
@@ -8,6 +8,7 @@ import DocumentTopBarTitle from './DocumentTopBarTitle.svelte';
|
||||
import DocumentTopBarActions from './DocumentTopBarActions.svelte';
|
||||
import DocumentMobileMenu from './DocumentMobileMenu.svelte';
|
||||
import BackButton from '$lib/shared/primitives/BackButton.svelte';
|
||||
import type { DatePrecision } from '$lib/shared/utils/documentDate';
|
||||
|
||||
type Person = { id: string; firstName?: string | null; lastName: string; displayName: string };
|
||||
type Tag = { id: string; name: string };
|
||||
@@ -17,6 +18,9 @@ type Doc = {
|
||||
title?: string | null;
|
||||
originalFilename?: string | null;
|
||||
documentDate?: string | null;
|
||||
metaDatePrecision?: DatePrecision | null;
|
||||
metaDateEnd?: string | null;
|
||||
metaDateRaw?: string | null;
|
||||
sender?: Person | null;
|
||||
receivers?: Person[] | null;
|
||||
filePath?: string | null;
|
||||
@@ -81,6 +85,9 @@ const overflowPersons = $derived(receivers.slice(2));
|
||||
title={doc.title}
|
||||
originalFilename={doc.originalFilename}
|
||||
documentDate={doc.documentDate}
|
||||
metaDatePrecision={doc.metaDatePrecision}
|
||||
metaDateEnd={doc.metaDateEnd}
|
||||
metaDateRaw={doc.metaDateRaw}
|
||||
/>
|
||||
|
||||
<!-- Chip row — desktop only, hidden on small screens to make room for buttons -->
|
||||
@@ -151,6 +158,9 @@ const overflowPersons = $derived(receivers.slice(2));
|
||||
<div transition:slide={{ duration: 200 }}>
|
||||
<DocumentMetadataDrawer
|
||||
documentDate={doc.documentDate ?? null}
|
||||
metaDatePrecision={doc.metaDatePrecision ?? null}
|
||||
metaDateEnd={doc.metaDateEnd ?? null}
|
||||
metaDateRaw={doc.metaDateRaw ?? null}
|
||||
location={doc.location ?? null}
|
||||
status={doc.status ?? 'PLACEHOLDER'}
|
||||
sender={doc.sender ?? null}
|
||||
|
||||
Reference in New Issue
Block a user