Commit Graph

3 Commits

Author SHA1 Message Date
JasonFraser 461b399d74 Add document delete/rename, merge Result into the transactions top bar
Five related UX fixes from one request:

- DocumentNavBar's filename is now clickable (hover state + a trailing
  ellipsis-icon hint) and renders for any loaded document, not just
  once there's more than one - opens DocumentOptionsModal to rename, or
  hands off to a ConfirmModal to delete (now with danger/busy props:
  red confirm button, stays open with a spinner mid-request). Lets a
  user delete a document they don't want before downloading.
- Every .btn-toggle button (Hide/Show, Recheck, Download, Results) is a
  consistent 36px tall by construction now, not by each call site
  matching a number.
- The separate "Download All" button is gone - the single Download
  button opens DownloadChoiceModal (current vs. all) once more than one
  document is loaded, same as before with exactly one.
- ResultCard.vue is deleted; its content (status banner, checks list,
  Download) merges into TransactionsTable's own top bar: a Results
  toggle (left) opens a hover-sticky dropdown - stays open while the
  mouse is over the trigger or panel, closes the moment it leaves both,
  via one shared @mouseleave rather than separate hover-tracking state
  - DocumentNavBar sits truly centered (CSS Grid, not flex
  space-between) in the middle, Download on the right.
- New shared useModalFocus composable, factored out once three modals
  needed the same "focus on open so Esc works" logic.

Verified: npm run build passes; every new icon class confirmed against
the installed FontAwesome CSS; the app container rebuilt and the served
bundle confirmed to contain the new component/class names.
extractionStore.removeDocument/setActiveDocumentFileName executed
directly against a real Pinia instance across five scenarios (earlier
removal, active-document removal mid-list and as the last entry,
emptying to zero, a plain rename) - all correct.
documentsService.updateDocument(id,{fileName})/deleteDocument executed
directly against the real running PocketBase container - rename
persisted and re-fetched correctly, delete correctly 404s afterward.
measure.py re-run, unaffected. Not machine-verified: the actual
interactive behavior - Claude-in-Chrome did not connect this session.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-13 09:13:17 -04:00
JasonFraser ca12f2b90d Rebuild the app shell as an enterprise header/sidebar/footer layout
The project sidebar was "not impressive" per direct feedback, pointed
at docs/sample_ui.png (a Cloudflare R2 dashboard) as the reference.
Adds AppHeader (brand + breadcrumb + account menu) and AppFooter, and
rebuilds ProjectSidebar into the reference's own left-nav pattern
(search box, icon-led list, bottom-anchored collapse-to-rail toggle).
ProjectSidebar moves from ExtractorView into App.vue's shell, since
it's account-wide chrome, not page-specific - same reasoning as the
new header/footer.

Every unicode-entity icon left over from the original vanilla-JS build
is replaced with a FontAwesome solid icon (installed as a real npm
dependency, not a CDN link, to keep the Docker build offline-
reproducible) - not just in the sidebar, across every button site-wide,
per the explicit ask. Color theme is untouched.

Verified: npm run build passes with the fonts bundled correctly; every
icon class used was grepped against the installed FontAwesome CSS and
confirmed to exist; the app container was rebuilt and curl-checked
end-to-end (bundle, CSS, and font asset all serve correctly, and the
new component/icon class names are present in the built JS). measure.py
re-run, unaffected. Not machine-verified: the actual rendered page -
Claude-in-Chrome did not connect this session, same as every prior UI
change in this project.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-13 08:05:55 -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