feat(dashboard): fall back to document-text heroicon when no thumbnail yet
Uses the same heroicon as DocumentThumbnail so the "no thumbnail yet" signal reads identically across the app: one shape, one meaning. The parchment SVG still lives on in the fully-empty state (no resume doc at all), where it represents a different thing — we removed it only from the "document exists, thumbnail not generated yet" branch (#309). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -56,6 +56,27 @@ function safeColor(color: string): string {
|
|||||||
loading="lazy"
|
loading="lazy"
|
||||||
decoding="async"
|
decoding="async"
|
||||||
/>
|
/>
|
||||||
|
{:else}
|
||||||
|
<div
|
||||||
|
data-testid="resume-thumbnail-fallback"
|
||||||
|
class="flex h-full w-full items-center justify-center text-ink-3"
|
||||||
|
aria-hidden="true"
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
fill="none"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
stroke-width="1.5"
|
||||||
|
stroke="currentColor"
|
||||||
|
class="h-16 w-16"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
d="M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z M9 12.75h6M9 15.75h6M9 18.75h3"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -69,4 +69,11 @@ describe('DashboardResumeStrip', () => {
|
|||||||
await expect.element(img).toHaveAttribute('loading', 'lazy');
|
await expect.element(img).toHaveAttribute('loading', 'lazy');
|
||||||
await expect.element(img).toHaveAttribute('decoding', 'async');
|
await expect.element(img).toHaveAttribute('decoding', 'async');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('renders fallback icon when thumbnailUrl is null', async () => {
|
||||||
|
render(DashboardResumeStrip, { resumeDoc: mockResume });
|
||||||
|
const fallback = page.getByTestId('resume-thumbnail-fallback');
|
||||||
|
await expect.element(fallback).toBeInTheDocument();
|
||||||
|
await expect.element(page.getByTestId('resume-thumbnail-img')).not.toBeInTheDocument();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user