From 81f86474b6b2a755b46340d09a113987bad86073 Mon Sep 17 00:00:00 2001 From: Marcel Date: Mon, 20 Apr 2026 17:06:33 +0200 Subject: [PATCH] fix(dashboard): retarget feed footer to /chronik + render rollup rows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - "Alle anzeigen" link now goes to /chronik (was /documents — the dead-end bug called out in #285). - Rollup rows (count > 1) render a primary-colored count badge plus a compound timestamp line: "14. Apr. · 14:02–14:32" (en-dash U+2013). - Singleton rows render the existing "14. Apr. 2026" date line. - BLOCK_REVIEWED now has a verb mapping (re-using the annotation verb until the spec pins a distinct copy). - Three new spec cases: rollup count badge + en-dash range, no badge on singletons, /chronik link assertion. Part of #285. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../components/DashboardActivityFeed.svelte | 35 +++++++++++++++++-- .../DashboardActivityFeed.svelte.spec.ts | 29 ++++++++++++++- 2 files changed, 60 insertions(+), 4 deletions(-) diff --git a/frontend/src/lib/components/DashboardActivityFeed.svelte b/frontend/src/lib/components/DashboardActivityFeed.svelte index d24fdd91..2595fd3e 100644 --- a/frontend/src/lib/components/DashboardActivityFeed.svelte +++ b/frontend/src/lib/components/DashboardActivityFeed.svelte @@ -1,6 +1,8 @@
@@ -35,7 +56,7 @@ function formatDate(iso: string): string { {m.feed_caption()} {m.feed_show_all()} @@ -66,6 +87,14 @@ function formatDate(iso: string): string { {item.documentTitle} + {#if item.count > 1} + + {item.count} + + {/if} {#if item.youMentioned} {/if}

-

{formatDate(item.happenedAt)}

+

{timestamp(item)}

{/each} diff --git a/frontend/src/lib/components/DashboardActivityFeed.svelte.spec.ts b/frontend/src/lib/components/DashboardActivityFeed.svelte.spec.ts index b12c682c..51bfd384 100644 --- a/frontend/src/lib/components/DashboardActivityFeed.svelte.spec.ts +++ b/frontend/src/lib/components/DashboardActivityFeed.svelte.spec.ts @@ -17,7 +17,8 @@ const baseItem: ActivityFeedItemDTO = { documentId: 'doc-1', documentTitle: 'Brief 1920', happenedAt: '2026-04-19T10:00:00Z', - youMentioned: false + youMentioned: false, + count: 1 }; describe('DashboardActivityFeed', () => { @@ -39,4 +40,30 @@ describe('DashboardActivityFeed', () => { const section = page.getByText('Kommentare & Aktivität'); await expect.element(section).toBeInTheDocument(); }); + + it('renders count badge and en-dash time range for rollup rows (count > 1)', async () => { + const rollup: ActivityFeedItemDTO = { + ...baseItem, + count: 20, + happenedAtUntil: '2026-04-19T10:32:00Z' + }; + render(DashboardActivityFeed, { feed: [rollup] }); + const badge = page.getByTestId('feed-rollup-count'); + await expect.element(badge).toHaveTextContent('20'); + // "–" is U+2013 en-dash + const stamp = page.getByText(/\u2013/); + await expect.element(stamp).toBeInTheDocument(); + }); + + it('does not render count badge for singleton rows (count === 1)', async () => { + render(DashboardActivityFeed, { feed: [baseItem] }); + const badge = page.getByTestId('feed-rollup-count'); + await expect.element(badge).not.toBeInTheDocument(); + }); + + it('links the "show all" footer to /chronik, not /documents', async () => { + render(DashboardActivityFeed, { feed: [] }); + const link = page.getByRole('link', { name: /alle anzeigen/i }); + await expect.element(link).toHaveAttribute('href', '/chronik'); + }); });