feat(dashboard): wire EnrichmentBlock between Resume strip and Mission Control

Dashboard loader fetches /api/documents/incomplete?size=5 plus the
existing /incomplete-count and surfaces both via data; +page.svelte
renders EnrichmentBlock with the top 5 docs, the total count, and the
bannerCount state bound to DropZone's onUploadComplete callback
(issue #296).

The block returns null when there is nothing to show, so dashboards
without pending uploads stay uncluttered.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-04-20 22:08:09 +02:00
parent 90c9ca8708
commit f548128940
2 changed files with 30 additions and 3 deletions

View File

@@ -4,10 +4,13 @@ import DashboardResumeStrip from '$lib/components/DashboardResumeStrip.svelte';
import MissionControlStrip from '$lib/components/MissionControlStrip.svelte';
import DashboardFamilyPulse from '$lib/components/DashboardFamilyPulse.svelte';
import DashboardActivityFeed from '$lib/components/DashboardActivityFeed.svelte';
import EnrichmentBlock from '$lib/components/EnrichmentBlock.svelte';
import { m } from '$lib/paraglide/messages.js';
let { data } = $props();
let bannerCount = $state(0);
const greetingText = $derived.by(() => {
const name = data?.user?.firstName ?? '';
const h = new Date().getHours();
@@ -32,6 +35,13 @@ const greetingText = $derived.by(() => {
<div class="flex flex-col gap-5">
<DashboardResumeStrip resumeDoc={data.resumeDoc ?? null} />
<EnrichmentBlock
topDocs={data.incompleteDocs ?? []}
totalCount={data.incompleteTotal ?? 0}
bannerCount={bannerCount}
onBannerClose={() => (bannerCount = 0)}
/>
<section aria-label={m.dashboard_mission_caption()}>
<h2 class="mb-3 font-sans text-xs font-bold tracking-widest text-ink-3 uppercase">
{m.dashboard_mission_caption()}
@@ -49,7 +59,7 @@ const greetingText = $derived.by(() => {
<DashboardFamilyPulse pulse={data.pulse ?? null} />
<DashboardActivityFeed feed={data.activityFeed ?? []} />
{#if data.canWrite}
<DropZone />
<DropZone onUploadComplete={(count) => (bannerCount = count)} />
{/if}
</div>
</div>