From 84938e1bf388bcaa5645bac5d3da64ecac1e020a Mon Sep 17 00:00:00 2001 From: Marcel Date: Sun, 14 Jun 2026 12:17:39 +0200 Subject: [PATCH] refactor(timeline): render the WorldBand historical suffix once MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "· historisch" register was emitted in all three date branches, with the dateless branch dropping the leading separator. Render the span pill or date as a conditional prefix, then a single trailing "· historisch" span — one render site, consistent separator. Co-Authored-By: Claude Opus 4.8 --- frontend/src/lib/timeline/WorldBand.svelte | 8 ++++---- frontend/src/lib/timeline/WorldBand.svelte.spec.ts | 8 ++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/frontend/src/lib/timeline/WorldBand.svelte b/frontend/src/lib/timeline/WorldBand.svelte index 7d71e1fd..5347d352 100644 --- a/frontend/src/lib/timeline/WorldBand.svelte +++ b/frontend/src/lib/timeline/WorldBand.svelte @@ -40,10 +40,10 @@ const historical = $derived(m.timeline_layer_historical_suffix()); > {fromYear}–{toYear} - · {historical} {:else if dateText} - {dateText} · {historical} - {:else} - {historical} + {dateText} {/if} + + · {historical} diff --git a/frontend/src/lib/timeline/WorldBand.svelte.spec.ts b/frontend/src/lib/timeline/WorldBand.svelte.spec.ts index 0218206f..6af574e6 100644 --- a/frontend/src/lib/timeline/WorldBand.svelte.spec.ts +++ b/frontend/src/lib/timeline/WorldBand.svelte.spec.ts @@ -55,6 +55,14 @@ describe('WorldBand', () => { expect(document.body.textContent).toContain(m.timeline_layer_historical_suffix()); }); + it('shows "· historisch" with a leading separator even when the band has no date (#833 REQ-009)', () => { + render(WorldBand, { + entry: historical({ precision: 'UNKNOWN', eventDate: undefined, eventDateEnd: undefined }) + }); + expect(document.querySelector('[data-testid="world-range"]')).toBeNull(); + expect(document.body.textContent).toContain(`· ${m.timeline_layer_historical_suffix()}`); + }); + it('follows the RANGE span pill with inline "· historisch" text, not a second pill (#833 REQ-009)', () => { render(WorldBand, { entry: historical() }); const pill = document.querySelector('[data-testid="world-range"]');