From d5bf401085134104baa58d535d11d4d8b4296e49 Mon Sep 17 00:00:00 2001 From: Marcel Date: Mon, 1 Jun 2026 20:07:20 +0200 Subject: [PATCH] feat(document): stop surfacing the raw cell in the detail drawer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The detail drawer's date cell rendered DocumentDate whenever a date OR a raw cell was present (`{#if documentDate || metaDateRaw}`). For an undated, raw-only document that meant the verbatim import text leaked into the view. Tighten the guard to `{#if documentDate}` so such a document shows "—". The raw prop is still passed through for the SEASON word on dated documents. Covered by a new test. Co-Authored-By: Claude Opus 4.8 --- .../src/lib/document/DocumentMetadataDrawer.svelte | 2 +- .../document/DocumentMetadataDrawer.svelte.test.ts | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/document/DocumentMetadataDrawer.svelte b/frontend/src/lib/document/DocumentMetadataDrawer.svelte index 4b8081e9..19505265 100644 --- a/frontend/src/lib/document/DocumentMetadataDrawer.svelte +++ b/frontend/src/lib/document/DocumentMetadataDrawer.svelte @@ -113,7 +113,7 @@ function getFullName(person: Person): string {
{m.doc_details_field_date()}
- {#if documentDate || metaDateRaw} + {#if documentDate} { expect(dashTexts.length).toBeGreaterThan(0); }); + it('shows an em-dash and never the raw cell for an undated, raw-only document', async () => { + render(DocumentMetadataDrawer, { + props: { ...baseProps, documentDate: null, metaDateRaw: 'Sommer 1916' } + }); + + await expect.element(page.getByText('Sommer 1916')).not.toBeInTheDocument(); + const dashTexts = Array.from(document.querySelectorAll('dd, p')) + .map((el) => el.textContent?.trim()) + .filter((t) => t === '—'); + expect(dashTexts.length).toBeGreaterThan(0); + }); + it('renders the no-persons placeholder when sender and receivers are empty', async () => { render(DocumentMetadataDrawer, { props: baseProps });