A high-performance Human-In-The-Loop (HITL) web interface for Intelligent Document Processing (IDP). LoopDoc minimizes cognitive load and reduces average document handling time by surfacing only low-confidence extractions, maintaining spatial context between extracted values and their source in the document, and supporting keyboard-first navigation for fast verification throughput.
- Minimize Cognitive Load — Only surface what needs attention via confidence-driven workflow
- Reduce Mouse Travel — Keyboard-first navigation and bi-directional spatial mapping
- Spatial Context — Constant, synchronized link between extracted values and their source in the document
- Hybrid PDF and image rendering via
pdfjs-dist - SVG overlay layer with confidence-coded bounding boxes (red/yellow/green)
- Focus Engine that auto-zooms and centers on the active field or table cell
- Multi-page navigation with adaptive zoom (caps at 225%)
- Dynamic field rendering from JSON schema (
text,date,number,boolean) - Confidence-based filtering to show only items that need review
- Inline field editing with rule summary chips
- Spreadsheet-like interface where every cell links to a bounding box in the document
- Bi-directional sync — click a cell to zoom the document; click a region to highlight the grid
- Column drag-and-drop, column resize (persisted per document type), and row deletion with confirmation
- Context-column inference: automatically detects repeated columns (e.g., account numbers) and groups them as table context rather than reviewing each row
- Draggable inline editing card near the selected field or cell
- Row-group popup mode: shows all fields in a horizontal row at once, including context columns
- Keyboard shortcuts:
Enterto accept/verify,Mto mark missing,Ctrl+Zfor undo
- Pluggable rule packs registered per document type:
- Invoice — Total check (line amounts + tax - discount = total), Tax rate validation
- Paystub — Gross/net earnings reconciliation (current + YTD)
- Bank Statement — Balance reconciliation per account (beginning + deposits - withdrawals = ending)
- Auto-confirmation: passed rules can auto-verify related fields and table cells
- Fields, table cells, and rule targets share a single ordered queue
- Queue order is intentional: business rules needing review are visited first, then unverified document fields, then unverified reviewable table cells
- When a business-rule item is first in the queue, the active selection resolves to the first actionable related field or cell so the validation popover opens on a concrete value while preserving rule context
Tab/Shift+Tabto navigate,Enterto accept and advance- Auto-selects the first unverified item on document load
- Per-task lifecycle:
pending→in_progress→completed - Active review timer per task
- Mid-review state persists across page reloads — resume exactly where you left off
- All user preferences (theme, zoom level, focus mode, popup mode) saved to localStorage
- Strategy pattern with auto-detection for plugging in different IDP providers
- Currently supports UiPath Document Understanding out of the box
- All coordinates normalized to
[0, 1]for zoom-independence across file types
- Light/dark color modes, compact/comfortable density
- Font pairing options (system / humanist / technical)
- Accent color selection (blue, teal, violet)
| Layer | Technology |
|---|---|
| Framework | Next.js 14+ (App Router) + TypeScript |
| Styling | Tailwind CSS + Shadcn UI conventions |
| State | Zustand (3 stores: document, queue, preferences) |
| PDF Rendering | pdfjs-dist + HTML5 Canvas |
| Icons | Lucide React |
src/
├── app/ # Next.js pages (/ = dashboard, /review = workspace)
├── components/
│ ├── viewer/ # DocumentViewer, BboxOverlay, ValidationPopover
│ ├── panel/ # ExtractionPanel, FieldItem, BusinessRulesPanel
│ ├── table/ # TableGrid with drag-drop and resize
│ ├── layout/ # SplitPane layout
│ ├── queue/ # TaskList, UserPrompt
│ └── settings/ # SettingsPanel (theme, thresholds)
├── hooks/ # useKeyboardShortcuts, useActiveTimer
├── lib/
│ ├── adapters/ # VendorAdapter interface + UiPath adapter
│ └── businessRules/ # Rule engine core + invoice, paystub, bankStatement packs
├── store/ # Zustand stores (document, queue, preferences)
└── types/ # CanonicalDocument and related TypeScript interfaces
- Node.js 18+
- npm or pnpm
git clone <repo-url>
cd loopdoc
npm installnpm run devOpen http://localhost:3000 in your browser.
npm run build # Production build + type-check
npm run lint # ESLint- Create
src/lib/adapters/<vendor>/index.tsimplementing theVendorAdapterinterface (detect()+normalize()) - Register it in
src/lib/adapters/registry.ts - Important: Normalize all bounding box coordinates to
[0, 1]in your adapter
| Shortcut | Action |
|---|---|
Tab / Shift+Tab |
Navigate next/previous in review queue |
Enter |
Accept and verify current item, advance to next |
Shift+Enter |
Confirm entire table row |
M / Shift+M |
Mark as missing / mark and skip |
Ctrl+Z |
Undo last change (restore original value) |
[ / ] |
Navigate to previous/next page |
F |
Toggle low-confidence filter in extraction panel |
- Canonical types (
src/types/canonical.ts) define a vendor-agnostic model shared by all components - Normalized coordinates (
x, y, w, hin[0, 1]) ensure consistency across zoom levels and file formats - Review queue is built dynamically from rule targets needing review, unverified fields, and unverified table cells — it rebuilds whenever document state changes. Rule targets take priority so cross-field math issues, such as paystub gross/net reconciliation, are reviewed before ordinary table order.
- Table column profiling (
src/lib/reviewProfile.ts) uses heuristics (name patterns, repeated value ratio) to classify columns as context vs. row-fact
Private