@@ -71,18 +71,33 @@ export function ExtractionReveal({
7171 // with the Extracted panel. (A small reflow at Run is fine; a preview that looks
7272 // like it's mid-extraction is not.)
7373 const running = mode === "running" ;
74+
75+ // Preview: the document alone, centered and a comfortable size (wider than the
76+ // run split's column so it isn't lost in whitespace). Width-driven so it never
77+ // overflows the pane; the card border/shadow stay visible around it.
78+ if ( mode === "preview" ) {
79+ return (
80+ < div
81+ data-testid = "extraction-reveal"
82+ data-status = "preview"
83+ // `border` (not an inset ring) so the frame sits OUTSIDE the canvas and
84+ // isn't painted over by it. No padding — the page meets the frame cleanly.
85+ className = "mx-auto w-full max-w-[680px] overflow-hidden rounded-lg border border-line bg-white shadow-card"
86+ >
87+ < PdfDocument src = { pdfSrc } dim = { false } />
88+ </ div >
89+ ) ;
90+ }
91+
7492 return (
7593 < div
7694 data-testid = "extraction-reveal"
7795 data-status = { mode }
78- className = {
79- mode === "preview"
80- ? "mx-auto max-w-[440px]"
81- : "grid grid-cols-1 gap-3 sm:grid-cols-[1.1fr_1fr]"
82- }
96+ className = "grid grid-cols-1 gap-3 sm:grid-cols-[1.1fr_1fr]"
8397 >
84- { /* The real PDF the model reads */ }
85- < div className = "relative overflow-hidden rounded-lg bg-white shadow-card ring-1 ring-inset ring-line" >
98+ { /* The real PDF the model reads. `border` (not inset ring) so the canvas
99+ doesn't paint over the frame. */ }
100+ < div className = "relative overflow-hidden rounded-lg border border-line bg-white shadow-card" >
86101 { /* scan sweep only while the model is actually reading */ }
87102 { running && (
88103 < div
@@ -93,40 +108,37 @@ export function ExtractionReveal({
93108 < PdfDocument src = { pdfSrc } dim = { running } />
94109 </ div >
95110
96- { /* Extracted structure — only once a run is underway (absent in preview, so
97- the preview is just the document, not a mid-extraction-looking state). */ }
98- { mode !== "preview" && (
99- < div className = "rounded-lg bg-surface p-3 shadow-card ring-1 ring-inset ring-line" >
100- < div className = "mb-2 flex items-center justify-between" >
101- < span className = "text-[11px] font-medium uppercase tracking-wide text-muted" >
102- Extracted
111+ { /* Extracted structure (the run share-the-row panel). */ }
112+ < div className = "rounded-lg bg-surface p-3 shadow-card ring-1 ring-inset ring-line" >
113+ < div className = "mb-2 flex items-center justify-between" >
114+ < span className = "text-[11px] font-medium uppercase tracking-wide text-muted" >
115+ Extracted
116+ </ span >
117+ { done && state ?. matches != null && (
118+ < span
119+ className = { `rounded-full px-2 py-0.5 text-[10px] font-medium ${
120+ state . matches
121+ ? "bg-ok-soft text-ok ring-1 ring-inset ring-ok-line"
122+ : "bg-warn-soft text-warn ring-1 ring-inset ring-warn-line"
123+ } `}
124+ >
125+ { state . matches
126+ ? "reconciled with PO record"
127+ : "differs from record" }
103128 </ span >
104- { done && state ?. matches != null && (
105- < span
106- className = { `rounded-full px-2 py-0.5 text-[10px] font-medium ${
107- state . matches
108- ? "bg-ok-soft text-ok ring-1 ring-inset ring-ok-line"
109- : "bg-warn-soft text-warn ring-1 ring-inset ring-warn-line"
110- } `}
111- >
112- { state . matches
113- ? "reconciled with PO record"
114- : "differs from record" }
115- </ span >
116- ) }
117- </ div >
118- < dl className = "space-y-1.5" >
119- { rows . map ( ( label , i ) => (
120- < FieldRow
121- key = { label }
122- label = { label }
123- value = { fields [ i ] ?. value ?? "" }
124- state = { ! done ? "reading" : i < revealed ? "shown" : "pending" }
125- />
126- ) ) }
127- </ dl >
129+ ) }
128130 </ div >
129- ) }
131+ < dl className = "space-y-1.5" >
132+ { rows . map ( ( label , i ) => (
133+ < FieldRow
134+ key = { label }
135+ label = { label }
136+ value = { fields [ i ] ?. value ?? "" }
137+ state = { ! done ? "reading" : i < revealed ? "shown" : "pending" }
138+ />
139+ ) ) }
140+ </ dl >
141+ </ div >
130142 </ div >
131143 ) ;
132144}
0 commit comments