Commit Graph

4 Commits

Author SHA1 Message Date
JasonFraser 8a99254d28 Add QBO/Xero/CSV exports, consolidated Download dropdown, per-row exclude checkbox
Three new export formats, all reusing this pipeline's existing
transactions data with no new extraction logic:
- QBO (QuickBooks Web Connect / Quicken): qbo_service.py writes OFX 1.x
  SGML directly, including <INTU.BID>3000 so it actually qualifies as a
  real QBO/QFX file (corrected same day from an initial build that
  produced plain generic OFX with a .qbo extension slapped on - see
  CLAUDE.md for the research trail). Needs a reusable, project-scoped
  bankAccountProfiles record (pb_migrations/14) so a user isn't re-typing
  routing/account numbers on every export of the same real account.
- Xero (import CSV): xero_csv_service.py, no bank-account concept at all
  (Xero's own CSV import has none) - genuinely simpler than QBO.
- A plain, generic transactions CSV (csv_service.py) - distinct from
  Xero's import-specific shape, writes every row regardless of a missing
  date/amount since a plain dump has no structural requirement to violate.

The three original separate download buttons were consolidated into one
Download trigger + hover dropdown (QuickBooks/Xero/CSV/Excel), reusing
the Results dropdown's own zero-dead-zone hover structure. Excel's and
the new CSV's single/all download logic was generalized behind one
DOWNLOAD_FORMATS lookup rather than duplicated.

Also adds a per-transaction "include in downloads" checkbox - a lighter,
reversible alternative to permanently deleting a row: excludedFromExport
lives on the document's own result, read only at download time, with
zero effect on the live review screen's own data/checks.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-24 08:16:17 -04:00
JasonFraser 326b43ba11 Add layout-mapper backend contract: fingerprinting + forced-mapping extraction (L.2)
Lays the backend groundwork for the layout mapper (no UI/PocketBase yet): when both
the keyword detector and the layout_quirks fallback fail on every page,
extraction_service.run() now raises LayoutMappingRequired with a computed fingerprint
instead of a dead-end error; routes/extraction.py returns this as a 422 with
{needs_mapping, fingerprint, fingerprintHash}. run()/pipeline_service.run() gained a
forced_mapping parameter that extracts directly from given column positions, bypassing
auto-detection entirely - the entry point a future manual mapping screen will use.

Two real gaps surfaced by testing against the actual problem statement, not assumed:
header_candidate_geometry() scans every page for the best candidate rather than just
page 1 (this statement's own page 1 is a pure cover page); a forced mapping had no
page-boundary concept, so a cover page's own letterhead merged into the first real
transaction - fixed with a new start_page field.

Verified: a synthetic unrecognizable PDF correctly triggers the 422 contract through
the real running container; the real problem statement, forced through a hand-built
mapping, now extracts 36/36 transactions with every check passing, matching the
auto-detected L.1 result exactly; measure.py byte-identical on HSBC/RBC throughout.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-14 08:09:34 -04:00
JasonFraser 6913d45d20 Add review screen R.5: edit log, acknowledge/accept workflow, Excel Edits sheet
Completes the R.1-R.5 review screen plan. editLog/acknowledgedFlags/accepted all
live on the existing result JSON blob, no new PocketBase migration needed. Every
row mutation (manual edit, suggested-fix apply, structural edits) now logs a
field-level edit log entry; flags can be individually acknowledged; a document
can be Accepted once Verified or fully acknowledged; exports gain an optional
Edits sheet when edit_log is non-empty.

Verified: measure.py byte-identical to the pre-R.5 baseline, real curl round trip
through the rebuilt container confirming the Edits sheet appears/omits correctly,
extractionStore's new getters/actions run directly against real Pinia, and
useRowEditing's edit-log capture confirmed against a document actually persisted
on the live PocketBase container.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-13 20:41:13 -04:00
JasonFraser 01cd607728 Fix edit-icon color, description autogrow, and add image zoom controls
Three small UI fixes from earlier testing, never committed:

- Pencil edit icon now uses the same blue accent token the Save button
  already does (.row-btn.edit), instead of the default muted gray.
- Description textarea boxes left stale blank space after hiding the
  Source Document panel - the drag-resizer already re-measures box
  height on resize (autoGrowAll()), but the Hide/Show toggle never did,
  so widening the transactions column left every description box at its
  old height until something else happened to trigger a re-measure.
  Added the missing call.
- Images shown in the Source Document panel had no zoom controls at all
  (unlike PDFs, which get the browser's native viewer toolbar for free).
  Added a dedicated zoomable/scrollable image panel with -/+/Fit
  controls, width-based zoom (not CSS transform, so the panel's
  overflow:auto actually produces real scrollbars when zoomed in),
  opening at fit-width by default.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-11 23:44:06 -04:00