Reported: a newly loaded document didn't show up under its project in
the sidebar, with the same gap correctly anticipated for a document
moved from the transactions view.
Root cause: ProjectSidebar.vue's own per-project document list was a
reactive({}) local to that one component, lazy-loaded once per project
on first expand and cached indefinitely - nothing else in the app had
any way to tell it something changed.
Moved the cache into projectsStore.js (documentsByProject, keyed by
project id) - the natural shared owner. Four new actions:
loadProjectDocuments (the same lazy-fetch-once behavior, just
relocated), addDocumentToCache/removeDocumentFromCache/
moveDocumentInCache, each a no-op if that project was never expanded
so call sites don't need to know or care. All three real mutation
sites now call the relevant action right after their own successful
backend call: useBatchExtraction.js (new document), TransactionsTable's
"Move to project" (called before the document's own project field is
mutated, so the old project id is still readable), and
DocumentNavBar's delete (which didn't even import projectsStore
before). ProjectSidebar's own per-document delete now calls the same
shared action instead of mutating local state.
Verified end-to-end against the real running PocketBase: created a
project, loaded its cache, created a document and confirmed it
appeared immediately, moved it to a second project and confirmed it
left the first project's cache and entered the second's, deleted it
and confirmed it cleared - then re-fetched directly from PocketBase
and confirmed server-side state matched the client cache exactly at
every step. measure.py unaffected (no backend touched). Not
machine-verified: the sidebar UI itself reflecting this without a
manual collapse/re-expand - Claude-in-Chrome did not connect this
session.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
ProjectSidebar: each project now expands (chevron toggle) into its own
lazy-loaded document list - click a document to open it in the main
view, or delete it via the same two-step ConfirmModal pattern already
used elsewhere (Move to project, DocumentNavBar's own delete). Deleting
from here keeps both the sidebar's cached list and the main workspace
(extractionStore) in sync.
Also fixes a real reported bug: the Results dropdown closed when the
mouse moved slowly from the toggle down to the checks list, but stayed
open on a fast drag. Root cause: the panel's 8px gap was a `top`
positioning offset, which doesn't extend its relatively-positioned
parent's own hoverable box - that gap sat outside the hover zone
entirely, so crossing it slowly let a genuine mouseleave fire first.
Fixed by moving the gap into padding on an invisible wrapper instead of
a positioning offset, so the whole hover path - button, gap, and panel
- is one continuous box with no dead zone.
Verified: npm run build passes; the served bundle contains the new
class names. The two new Vue reactivity patterns (a reactive Set via
ref(new Set()), and dynamic keys on a reactive({}) object) were each
executed directly against real Vue reactivity, not assumed - both
correct. measure.py 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>
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>
The dropdown worked but gave zero feedback - no confirmation, nothing
visibly changed - so a successful move looked identical to a no-op
(reported directly by the user). Adds a generic ConfirmModal.vue
(reusable beyond this one call site) triggered on select instead of a
second button next to the dropdown, per request. Switches the select
from a bare :value binding to its own v-model so a cancelled move can
actually revert the visible selection (a plain :value can't re-sync a
<select>'s displayed option). Adds a transient "Moved to {project}"
note and clarifies the label from "Project" to "Move to project".
Verified: npm run build passes; the built bundle contains the new
modal/label/note strings; the app container rebuilt and serves 200.
measure.py unaffected. Not machine-verified: the actual modal
interaction - Claude-in-Chrome still isn't connected this session.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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>
Completes the three-stage PocketBase plan: project CRUD with delete
guard rails (refuses the default project and any non-empty project),
a collapsible sidebar to select/filter/rename/create/delete projects,
and a "Move to project" control on the transactions table. useFileUpload
is split back into a pure staging concern; loadDocuments moves out to
a new useDocuments composable shared by the sidebar and the initial
page load.
Verified at both the service layer and the Pinia store layer against
the real running PocketBase + app stack (signup, every delete guard,
move-to-project, filtered listing, store state sync) - all correct.
measure.py re-run, unaffected. Caught and fixed one binding bug before
any build/test: the "Move to project" select was reading result.project
(the raw backend blob, no such field) instead of the store's own
activeDocument.project.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
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.
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.
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.
- 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.
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.
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>
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>
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>
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>