Commit Graph

8 Commits

Author SHA1 Message Date
JasonFraser 12e18ae235 Align Recheck button with balance inputs; add table sort/filter/search
- Recheck Balance now lines up with the balance input fields on wide
  viewports via an invisible label-height spacer, instead of the row's
  top edge.
- Each transaction column gets its own up/down sort arrows, plus a
  filter row beneath the header (Description doubles as search, Status
  is a dropdown of values actually present). Sorting/filtering never
  disturbs row identity - edits and flags still target the original
  index, not the displayed position.
2026-10-12 07:53:36 -04:00
JasonFraser 37fdd0f235 Surface the "not_available" balance-check reason too, not just "fail"
The mismatch note only handled outcome === 'fail'. A statement with no
typed or auto-detected balance at all returns "not_available" instead,
which was left just as silently grey as "fail" used to be before the
last fix.
2026-10-12 07:41:48 -04:00
JasonFraser 92979f7de7 Show why the balance doesn't match, not just a grey readout
Grey (vs green) on the calc-readouts said something was wrong but never
what - the actual explanation (the statement_balance check's own detail
text, with the full math and "off by \$X") only existed in the checks
list, which starts collapsed by default, with no visible link back to
the readouts near the balance fields.

Surfaces that same detail text directly under the balance fields/Recheck
button when the check outcome is "fail" - no new backend call or logic,
just showing what was already being computed and returned, in the place
the user is actually looking.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-12 07:21:52 -04:00
JasonFraser 15e163267e Add explicit Recheck Balance button for post-extraction balance entry
Typing opening/closing balance AFTER extraction (e.g. the user forgot to
fill it in before clicking Extract) never did anything on its own - the
fields were only ever read by some OTHER trigger (a row Save, or
Download). Confirmed this gap predates the Vue rewrite - the original
vanilla-JS version had the identical behavior.

Adds a "Recheck Balance" button (TransactionsTable.vue) that re-runs the
same recheck-only (no re-extraction) call a row Save already makes,
using whatever's currently in the balance fields - an explicit,
deliberate trigger rather than auto-firing on blur, matching the
existing per-row Save pattern (edits/entries only take effect when
confirmed). Positioned at the row's own right edge, aligned under the
Hide/Show Source Doc toggle above it; drops below the closing-balance
field at mobile widths (a new 640px breakpoint, separate from the
860px one the overall layout already used).

Verified end-to-end against the real backend: uploaded a statement with
no balance supplied (statement_balance: not_available), then called
/api/recheck with balances added afterward - the check correctly
recalculated and reported the result, the same request shape and
endpoint the new button uses.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-12 07:17:51 -04:00
JasonFraser 1ab3d1bb42 Actually fix the height mismatch - .pdf-col itself had no fixed height
The previous commit fixed .txn-col but missed the real asymmetry: only
.pdf-col's CHILD (iframe/img-preview-wrap/empty-panel-source) was pinned
to 82vh - the .pdf-col CARD itself had no height of its own, so its real
total height was 82vh plus pdf-col-head's own height plus the card's
padding, taller than .txn-col's flat 82vh. Visually this is exactly
"transactions panel is shorter."

Applied the identical fixed-height-flex-column pattern to .pdf-col that
.txn-col already had: height:82vh on the card itself, pdf-col-head
flex-shrink:0, and the child (iframe/img-preview-wrap/empty-panel-source)
changed from height:82vh to flex:1 1 auto; min-height:0 so it fills
whatever space remains under the head - both columns are now driven by
the same fixed value through the same structural pattern, which is what
actually guarantees matching heights (one side being content-driven and
the other fixed can't reliably match, regardless of what the fixed value is).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-12 06:55:14 -04:00
JasonFraser 0ec44dd28a Match Transactions panel height to Source Document panel
.pdf-col's height came from its child (iframe/img-preview-wrap/
empty-panel-source, all fixed at 82vh); .txn-col had no height of its
own, just whatever its header+fields+notes+table content needed - the
two columns drifted apart whenever txn-col's content was taller than
82vh on its own.

.txn-col is now flex-column with a fixed height:82vh, matching its
sibling exactly; the table area (table-wrap, or empty-panel-table when
there's no result yet) is the one piece that absorbs whatever space is
left after the header/fields/notes above it (flex:1, min-height:0 so its
own overflow-y:auto scroll still works within that constrained space),
rather than the whole column growing taller than 82vh.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-12 06:53:00 -04:00
JasonFraser bcebc50466 Show Source Document and Transactions panels before upload
The opening/closing balance fields live in TransactionsTable, which was
only rendered after a successful extraction - so there was no way to
type a balance before clicking Extract, even though both fields are
submitted as part of that same request. Confirmed this wasn't introduced
by the Vue rewrite - the original vanilla-JS version had the identical
behavior (#resultSection stayed display:none until renderResult ran).

Both panels are now always visible. Each shows an empty-state message
("No Source Document to Display..."/"No Transactions to Display...")
until there's something real to show instead - SourceDocumentPanel until
a file is chosen, TransactionsTable's table (not the balance fields
above it) until an extraction result exists.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-12 06:50:04 -04:00
JasonFraser 6e4da3f385 Restructure frontend to Vue 3 + Vite (Stage 2 of 2)
Rebuilds templates/index.html (896 lines of vanilla JS, no framework, no
build step) as frontend/, a Vue 3 app per ENTERPRISE_STANDARDS.md's
frontend layering (views -> components -> composables -> services ->
repositories, Pinia for stores) - same agreed scope as Stage 1 (backend):
structure + commenting, not the full SaaS-shaped doc.

The full original file was read in full before starting (every function
enumerated against the plan, not re-derived from memory) to make sure
nothing documented in CLAUDE.md's "Frontend / UI state" section got
simplified away: sticky side-by-side layout with a draggable resizer,
Hide/Show Source Doc, collapsible Result card, per-row pencil-to-edit,
comma-formatted numbers, localStorage persistence with a restore banner,
image zoom controls, the pencil-icon-color and description-autogrow
fixes from earlier this session.

The original ask that started this whole detour - processing-phase text
with an animated ellipsis during /api/process - lands here as the one
genuinely new feature (useProcessingPhases.js + ProcessingIndicator.vue),
honestly simulated rather than claiming real progress (the backend is
one synchronous request with no streaming signal).

backend/app.py now serves frontend/dist (built via a new Dockerfile
multi-stage build: a node stage runs npm ci && npm run build, the Python
stage copies backend/ + that dist/ output) instead of rendering a Jinja
template - a manual SPA-fallback route serves a real static asset if one
exists at the requested path, else index.html. One real bug caught and
fixed before this ever ran: the first version also left Flask's own
automatic static route enabled, registering a duplicate/conflicting rule
against the same /<path:...> pattern as the manual catch-all - fixed by
disabling Flask's own static handling (static_folder=None) entirely.

Verified without a browser (the extension could not connect, tried
repeatedly): npm run build succeeds, formatService.js's pure functions
tested directly in Node, every prop/emit/store reference cross-checked
by hand across all ~20 new files, and full regression through the real
Docker container (SPA serving, static assets, /health, /api/* routing,
dual-engine extraction, measure.py - all unaffected or identical to
baseline). Actual interactive behavior - upload, drag/drop, the
processing-phase animation, editing, zoom, the resizer, persistence/
restore, download - was verified by the user in their own browser, not
by Claude. templates/index.html was kept in place as a fallback until
that confirmation came back, then deleted.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-12 06:32:49 -04:00