Docs / Data and layout / Bounding Box Citations
Bounding Box Citations
Review extracted values against source bounding box citations with form fields and JSON diffing.
Bounding Box Citations provides field-level cards for comparing extracted values with source PDF bounding boxes. Use it when reviewers need to inspect citations, correct values, and optionally compare against expected output.
Date range covered by the bank statement.
Final account balance at the end of the statement period.
Whether overdraft protection is enabled for the account.
Bounding Box Citations block
The panel composed with the PDF Viewer: focusing a field highlights its bounding box and scrolls the page there; hovering a transaction row highlights its line; clicking a box focuses its field. The sample bank statement and its citations are upstream's block demo data (extend-hq/ui, MIT).
Active citation: none
Useful behaviors
- Actual and expected values displayed side by side for each schema field when
showExpectedis enabled. - Array values rendered as grids, including drill-down for nested arrays and objects, with the Actual and Expected grids kept in sync.
- Input controls selected from the JSON schema property type.
- Object schema properties rendered as nested cards in the scrollable form.
- Per-field undo and Set to NULL actions when
showExpectedis enabled. - Form and JSON diff views for the same reviewed output state when
showExpectedis enabled.
API Reference
HumanReviewPanel
| Prop | Type | Default |
|---|---|---|
fields | ReviewField[] | sample fields |
bind:values | JsonObject | each field's expected |
activeFieldKey | string | - |
class / className | string | - |
onFieldFocus | (field: ReviewField) => void | - |
onLocationHover | (location?: ReviewLocation) => void | - |
resolveLocation | (metadataPath: string) => ReviewLocation | undefined | - |
resolveArrayItemMetadataPath | (path, rowIndex, rowValue) => string | undefined | - |
showExpected | boolean | true |
isDark / onIsDarkChange | boolean / (isDark: boolean) => void | false |
ReviewField
| Prop | Type | Required |
|---|---|---|
key | string | Yes |
schema | ReviewFieldSchema | Yes |
actual | JsonValue | Yes |
expected | JsonValue | Yes |
location | { page: number; area: HighlightArea } | No |
Differences from upstream
themeis replaced by parent-controlledisDark+onIsDarkChange; neither component renders its own theme control.classandclassNameare both accepted and merged.- Array grids are a Svelte DOM table instead of glide-data-grid: same columns, row numbers, double-click / Enter / typing to edit, drill-in and mirrored selection, but single-cell selection only (no range or drag selection). No
#portalelement is needed. - The JSON diff is a built-in line diff instead of
@pierre/diffs: split view with collapsed unchanged lines, no word-level highlights. - Added
bind:valueson the panel to read the edited output (upstream keeps it internal although its usage sample passesvalues). - Panel height comes from the
--human-review-panel-heightCSS variable (default 560px) instead of aclassNameheight utility. - Block (
HumanReviewBlock, exported also asBoundingBoxCitations): every located field gets a faint clickable box, so clicking a box focuses its field (upstream draws only the active box). - Block:
srcis the primary PDF prop and upstream'sfileis an alias; addedbind:activeFieldKey,onActiveFieldChange,onFieldFocus,onLocationHover,bind:values,fileName, andheight. - Block: the PDF renders on the shared PdfViewer; scroll-to-area is computed from the rendered page slots because PdfViewer has no
scrollToPageAreahandle. - Block: the resizable split stacks vertically below 900px instead of switching to a vertical resizable layout.
- Port-only exports: the overlay helpers
boxesForPage,formatCitationValue,getCitationLocation, plus the typesBoundingBoxCitationsProps,HumanReviewPanelProps,CitationBox,ArrayNestedView,ArrayReviewSide. Upstream'sHumanReviewThemetype is not exported becausethemeis replaced byisDark.