Skip to content

Commit af76ce7

Browse files
DylanMerigaudclaude
andcommitted
Show the invoice document on select, not the graph
On idle, selecting an invoice now shows that invoice's document (the extraction reveal) with the Run button, instead of the bare graph + centered Run. You see the bill first, then run it and watch it route. The lit graph still takes over once the run is past intake, and the document stays one click away in the trace drawer. Replay still lands on the graph (it's past intake), so no PDF flash. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent cf55d48 commit af76ce7

1 file changed

Lines changed: 20 additions & 25 deletions

File tree

components/dashboard.tsx

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -637,39 +637,34 @@ export const Dashboard = ({
637637
</button>
638638
)}
639639

640-
{/* Idle: the graph IS the hero (the workflow this invoice will route
641-
through), with a centered Run over it. No PDF, that's the run's moment. */}
642-
{state.status === "idle" && selected && (
643-
<div className="pointer-events-none absolute inset-0 z-10 grid place-items-center">
644-
<div className="pointer-events-auto grid place-items-center gap-2 rounded-2xl bg-surface/80 px-6 py-5 shadow-lift ring-1 ring-inset ring-line backdrop-blur">
645-
<p className="text-[12px] text-muted">
646-
Run {selected.invoiceNumber} through the workflow
647-
</p>
648-
<Button data-testid="run-btn" onClick={() => run(selected.id)}>
649-
<PlayIcon />
650-
Run pipeline
651-
</Button>
652-
</div>
653-
</div>
654-
)}
655-
656-
{/* Reading: while the run is scanning the PDF (before matching starts), the
657-
extraction reveal owns a centered card, the MOMENT the agent reads a real
658-
PDF. Once past intake it's gone and the lit graph is the whole story. */}
659-
{state.status === "running" && !pastIntake && previewId && (
640+
{/* Before the run is past intake, the INVOICE owns the pane: the selected
641+
document on idle (with Run), then the live scan as the agent reads it.
642+
Once past intake it's gone and the lit graph is the whole story (the
643+
document stays one click away in the trace drawer). */}
644+
{!pastIntake && previewId && (
660645
<div className="absolute inset-0 z-10 grid place-items-center bg-canvas/70 p-5 backdrop-blur-sm">
661646
<div className="max-h-full w-full max-w-2xl overflow-y-auto">
662647
<ExtractionReveal
663648
pdfSrc={API_ROUTES.pdf(previewId)}
664649
state={
665-
intake?.state ?? {
666-
status: "running",
667-
extracted: null,
668-
matches: false,
669-
}
650+
intake?.state ??
651+
(state.status === "running"
652+
? { status: "running", extracted: null, matches: false }
653+
: null)
670654
}
671655
extractedInvoice={intake?.document ?? null}
672656
/>
657+
{state.status === "idle" && selected && (
658+
<div className="mt-4 grid place-items-center">
659+
<Button
660+
data-testid="run-btn"
661+
onClick={() => run(selected.id)}
662+
>
663+
<PlayIcon />
664+
Run pipeline
665+
</Button>
666+
</div>
667+
)}
673668
</div>
674669
</div>
675670
)}

0 commit comments

Comments
 (0)