From 1d44bbb1bd40c793f54c870d7f33655ca51a9f50 Mon Sep 17 00:00:00 2001 From: Marcel Date: Thu, 23 Apr 2026 22:22:19 +0200 Subject: [PATCH] feat(dashboard): render real document thumbnail in resume strip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces the generic parchment SVG placeholder with an pointing at the backend's thumbnail endpoint when the document has one. The 180×252 container matches DocumentThumbnail's 5:7 A4 convention so the dashboard tile sits visually next to the list/person-sublist tiles instead of looking squatter than they do. dark:mix-blend-multiply keeps paper scans from glaring on a dark page background (#309). Co-Authored-By: Claude Opus 4.7 --- .../components/DashboardResumeStrip.svelte | 33 ++++++++----------- .../DashboardResumeStrip.svelte.spec.ts | 17 ++++++++++ 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/frontend/src/lib/components/DashboardResumeStrip.svelte b/frontend/src/lib/components/DashboardResumeStrip.svelte index 76eade81..fcf16812 100644 --- a/frontend/src/lib/components/DashboardResumeStrip.svelte +++ b/frontend/src/lib/components/DashboardResumeStrip.svelte @@ -44,27 +44,20 @@ function safeColor(color: string): string { {:else}
- + {#if resumeDoc.thumbnailUrl} + + {/if} +

diff --git a/frontend/src/lib/components/DashboardResumeStrip.svelte.spec.ts b/frontend/src/lib/components/DashboardResumeStrip.svelte.spec.ts index 2250ff2e..a7b411c0 100644 --- a/frontend/src/lib/components/DashboardResumeStrip.svelte.spec.ts +++ b/frontend/src/lib/components/DashboardResumeStrip.svelte.spec.ts @@ -21,6 +21,11 @@ const mockResume: DashboardResumeDTO = { collaborators: [] }; +const mockResumeWithThumbnail: DashboardResumeDTO = { + ...mockResume, + thumbnailUrl: '/api/documents/doc-123/thumbnail?v=2026-04-23T09%3A00' +}; + describe('DashboardResumeStrip', () => { it('renders empty state heading when resumeDoc is null', async () => { render(DashboardResumeStrip, { resumeDoc: null }); @@ -52,4 +57,16 @@ describe('DashboardResumeStrip', () => { const label = page.getByText(/4 Abschnitte/i); await expect.element(label).toBeInTheDocument(); }); + + it('renders thumbnail img with expected attrs when thumbnailUrl is set', async () => { + render(DashboardResumeStrip, { resumeDoc: mockResumeWithThumbnail }); + const img = page.getByTestId('resume-thumbnail-img'); + await expect.element(img).toBeInTheDocument(); + await expect + .element(img) + .toHaveAttribute('src', '/api/documents/doc-123/thumbnail?v=2026-04-23T09%3A00'); + await expect.element(img).toHaveAttribute('alt', ''); + await expect.element(img).toHaveAttribute('loading', 'lazy'); + await expect.element(img).toHaveAttribute('decoding', 'async'); + }); });