From f715f9ce9cded7c7692e07a2fb1a3f913b672e2d Mon Sep 17 00:00:00 2001 From: Marcel Date: Sun, 14 Jun 2026 12:08:13 +0200 Subject: [PATCH] fix(timeline): show EventPill provenance even when the event has no date MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The provenance token (abgeleitet/kuratiert) was nested inside the {#if dateLabel} block, so an undated or UNKNOWN-precision event — e.g. one in the undated bucket — rendered no provenance at all. Compose the subtitle as an optional "{date} · " prefix in front of the always-present provenance instead. Co-Authored-By: Claude Opus 4.8 --- frontend/src/lib/timeline/EventPill.svelte | 7 ++++--- .../src/lib/timeline/EventPill.svelte.spec.ts | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/frontend/src/lib/timeline/EventPill.svelte b/frontend/src/lib/timeline/EventPill.svelte index b30420b2..55f274f3 100644 --- a/frontend/src/lib/timeline/EventPill.svelte +++ b/frontend/src/lib/timeline/EventPill.svelte @@ -21,6 +21,9 @@ const dateLabel = $derived(timelineDateLabel(entry.eventDate, entry.precision, e const provenance = $derived( entry.derived ? m.timeline_provenance_derived() : m.timeline_provenance_curated() ); +// Provenance always shows; the date is an optional prefix so an undated event +// still reads "abgeleitet"/"kuratiert" (REQ-007). +const subtitle = $derived(dateLabel ? `${dateLabel} · ${provenance}` : provenance); const canEdit = $derived(!entry.derived && entry.eventId != null); @@ -46,9 +49,7 @@ const canEdit = $derived(!entry.derived && entry.eventId != null); >{entry.title} {/if} - {#if dateLabel} - {dateLabel} · {provenance} - {/if} + {subtitle} {#if canEdit} { expect(document.body.textContent).not.toContain('persönlich'); expect(document.body.textContent).not.toContain('SEASON'); }); + + it('still shows the provenance token when the event has no date label (REQ-007)', () => { + // An undated / UNKNOWN-precision event (e.g. in the undated bucket) yields a + // null dateLabel; provenance must not be gated behind the date. + const entry = makeEntry({ + kind: 'EVENT', + derived: true, + derivedType: 'BIRTH', + title: 'Geburt: Hans', + senderName: '', + receiverName: '', + precision: 'UNKNOWN', + eventDate: undefined, + documentId: undefined + }); + expect(timelineDateLabel(entry.eventDate, entry.precision, entry.eventDateEnd)).toBeNull(); + render(EventPill, { entry }); + expect(document.body.textContent).toContain(m.timeline_provenance_derived()); + }); });