Commit Graph

17 Commits

Author SHA1 Message Date
JasonFraser 87b978f837 Add the Google logo to the Continue with Google button
Same official 4-color "G" logomark PocketBase itself serves (the exact
SVG confirmed from the live /api/collections/users/auth-methods
response while verifying the OAuth2 setup) - same button on both the
sign-in and sign-up views, since they're the same form with a mode
toggle, not separate pages.
2026-10-13 01:24:16 -04:00
JasonFraser 35b378751f Fix oversized gap between login form fields
.fields > div's flex:1 1 180px is a WIDTH basis meant for the
horizontal balance-fields row - in LoginView's column layout that same
180px became a HEIGHT basis instead, stretching each email/password
wrapper to ~180px tall. Not padding/margin, a flex-basis axis mismatch.
2026-10-13 00:33:04 -04:00
JasonFraser 94096554e9 Add PocketBase: accounts (password + Google) + schema for R2-backed docs
New third service alongside app/docling - a deliberate, revisited
decision from the documented "no DB" architecture, not an oversight.

pocketbase/Dockerfile - official minimal pattern (no official image
exists), pinned binary, migrations+hooks copied in and run on startup.

pb_migrations/1_create_collections.js - schema as code: users (auth,
self-registration open), projects (owner-scoped), documents (owner-
AND project-scoped - project is REQUIRED, not optional, since a
planned future per-project category-mapping feature needs every
document scoped from day one), with a sourceFile field for the
original PDF/image (stored in R2 once configured).

pb_hooks/ensure_default_project.pb.js - auto-creates each new user's
"General" project (isDefault:true) the moment their account exists -
covers password and Google signup uniformly, guarantees the required
documents.project relation always has somewhere to point.

configure-secrets.sh - the only place R2/Google secrets are handled,
reading from a gitignored .env and PATCHing PocketBase's own REST API.
Never in a migration (those are committed to git).

Frontend: pocketbaseRepository.js (the one SDK instance),
authService.js (login/signup/Google/logout), authStore.js (Pinia,
synced to the SDK's own authStore), LoginView.vue, and App.vue's new
auth gate - talks to PocketBase directly, not proxied through Flask.

Verified via real REST API calls against the running container (not
just read): migrations create the expected collections/rules; a fresh
signup gets exactly one auto-created "General" project; a second
user's token can't see the first user's data; a document created with
no project correctly fails validation (confirming the frontend must
resolve one itself); authService's actual functions exercised via a
live Node script against the real container (signup, hook-created
project visible, logout, re-login). npm run build passes. measure.py
unaffected (no backend code touched).

Not yet verified - needs real R2/Google credentials this session
doesn't have: configure-secrets.sh itself, and the Google OAuth popup
flow (needs a real browser + real Google Cloud OAuth client, both
outside this repo's control - documented as setup prerequisites in
README.md).

This is Stage B.1 of 3 (schema + auth gate). B.2 (document persistence
moves from localStorage to PocketBase) and B.3 (the project sidebar
UI) are not started yet.
2026-10-13 00:26:41 -04:00
JasonFraser 84261c25ef Move document nav into the transactions card; raise panel height 25%
DocumentNavBar no longer sits in its own standalone div above both
panels - it's now rendered inside TransactionsTable.vue, across the
top of the transactions card, above the Hide/Show Source Doc row, with
no border/background box of its own (already inside the card's). Still
disappears via the same v-if once there's nothing to navigate between.

.pdf-col/.txn-col height raised from 82vh to 102.5vh (25% more), both
panels still matching each other exactly.
2026-10-12 21:19:54 -04:00
JasonFraser ec58a956e9 Accumulate staged files across picks instead of replacing them
Picking/dropping a file replaced whatever was already staged (reported:
"I select one document and start again to select another, the first
one is replaced"). setFiles now appends instead, deduping exact
name+size repeats, so a batch can be built up across several separate
picks/drops, not just one multi-select dialog.

Each staged file gets an x to remove it before Extract is clicked.
The staging list is cleared the moment Extract runs (not after it
resolves), so an already-handed-off file can't linger and get
re-processed - and duplicated, since extractionStore.documents has no
dedup of its own - by a later click.

Also resets the native file input after each pick so re-selecting the
same file (e.g. after removing it) still fires a change event.
2026-10-12 21:06:53 -04:00
JasonFraser 2081bc574b Multi-file upload, sequential extraction, prev/next navigation, Download All
extractionStore restructured from a single currentResult into a list
of documents + activeIndex, so a batch of files can be extracted
sequentially (useBatchExtraction.js replaces useExtraction.js) with
"Extracting N/M: filename" progress, and browsed afterward via
DocumentNavBar's prev/next. currentResult/currentDocKey/
flaggedIndexes/effectiveOpeningBalance/effectiveClosingBalance stay
getters with their exact old names (now derived from activeDocument),
so ResultCard.vue and most of TransactionsTable.vue needed no changes
beyond the balance-input v-model bindings.

Two choices from the plan were revised after user review before any
code was written: focus never moves on its own except to show the
very first result (a later file finishing mid-batch never yanks the
user away from whatever they're reviewing or editing), and a Download
All button sits beside Download Excel, shown once a multi-file batch
has actually finished.

Restore-on-reload generalized from one document to a whole batch
(lastBatchKeys/appendToLastBatch replace lastDocKey; persistResult now
saves {fileName, result} with a backward-compatible fallback for the
old bare-result shape).

Two real bugs caught in review before ever reaching a browser:
TransactionRow was keyed only by row index (could reuse a stale
component's draft across documents sharing an index - fixed by keying
on docKey+index too), and addDocument called recomputeFlags() which
only ever targets the active document (a document added while focus
stayed elsewhere would never get its own flaggedIndexes computed -
fixed by computing flags directly for whichever document was just
added, not just the active one).

Verified: npm run build; every new/changed store action and getter
executed directly against real Pinia with synthetic multi-document
scenarios; the real Docker container rebuilt and hit with sequential
/api/process calls confirming identical results to the pre-change
baseline; measure.py unaffected (no backend code touched). No backend
changes anywhere - /api/process|recheck|export already each take
exactly one file/document per call.
2026-10-12 21:00:07 -04:00
JasonFraser 16da683551 Remove the seam between the header row and the filter row
Both sticky rows kept their own border-bottom (inherited from the
base th rule), which read as a thin visible gap between them. The
header row no longer draws one - the filter row's own border is the
single line that should separate the whole sticky header block from
the scrolling data beneath it.
2026-10-12 18:13:11 -04:00
JasonFraser 94864273c8 Fix resizer-narrowed transactions column: overflow, not a viewport bug
Dragging the resizer narrow on a wide screen never triggered the
existing @media(max-width:640px) stacked layout, since that only
watches the viewport, not the column itself - so the balance fields
and Recheck Balance button just overflowed the column's right edge
instead. Gave .txn-col container-type:inline-size and replaced that
media query with an equivalent @container rule, which also covers
the genuine-mobile case the old rule handled (the column is just as
narrow as the viewport there too).

Same root cause was squeezing the transactions table's Description
column unreadable: table-layout:fixed + width:100% shrinks every
column proportionally to fit, fixed-pixel ones included. Gave the
table a min-width (fixed columns' sum + a legible floor for
Description) so .table-wrap's overflow-x:auto takes over with a
horizontal scrollbar instead of compressing Description further.
2026-10-12 18:09:16 -04:00
JasonFraser 7af1749887 Fix sticky header/filter-row stacking collision; drop dead-space note
Header row and filter row both stuck to top:0 via one shared rule,
so the filter row (later in the DOM) visually covered the header row
on scroll instead of stacking beneath it. Gave the header row an
explicit height and offset the filter row's own sticky top by that
amount so they stack correctly.

Also removed the now-empty <div class="note"> left over after its
instructional text was deleted - it was still taking up margin-bottom
space above the table for no reason.
2026-10-12 08:07:12 -04:00
JasonFraser 534907626c Give the balance input and Recheck button equal explicit heights
Matching just the top edge (via the label-height spacer) wasn't
enough - the button's own padding made it naturally shorter than a
balance input, so the two boxes still looked slightly off-center
against each other. Both now get the same explicit height with the
button's text flex-centered inside it.
2026-10-12 07:58:03 -04:00
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 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