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>
This commit is contained in:
JasonFraser 2026-10-13 08:05:55 -04:00
parent ae75c1ff11
commit ca12f2b90d
19 changed files with 541 additions and 182 deletions

122
CLAUDE.md
View File

@ -272,9 +272,18 @@ security only, not the full SaaS-shaped doc — and the judgment call on what co
away in the rewrite. away in the rewrite.
``` ```
/frontend/src /frontend/src
main.js — createApp(App).use(pinia).use(router).mount('#app') main.js — createApp(App).use(pinia).use(router).mount('#app');
App.vue — page chrome (<main> wrapper) around the routed view imports @fortawesome/fontawesome-free's all.min.css once
/assets/main.css — the full original CSS, moved verbatim - same tokens, same rules here (an npm dependency, not a CDN link - keeps the Docker
build offline-reproducible) ahead of main.css
App.vue — the auth gate, then the full app shell: AppHeader +
ProjectSidebar + routed view + AppFooter (see "Enterprise
app-shell redesign" under Key decisions & lessons -
modeled on docs/sample_ui.png, same enterprise-light theme)
/assets/main.css — started as the original CSS moved verbatim; grown
substantially since (table/sidebar/account-bar/app-shell
sections each added for their own stage - see Key
decisions & lessons for which)
/router/index.js — one route today ('/' -> ExtractorView), kept as a real /router/index.js — one route today ('/' -> ExtractorView), kept as a real
router per the standards doc's structure router per the standards doc's structure
/stores (Pinia) /stores (Pinia)
@ -375,10 +384,16 @@ security only, not the full SaaS-shaped doc — and the judgment call on what co
filename —"), useRowEditing (saveEdit() now calls filename —"), useRowEditing (saveEdit() now calls
`documentsService.updateDocument`, best-effort), useImageZoom, `documentsService.updateDocument`, best-effort), useImageZoom,
useAutoGrow useAutoGrow
/components — FileUploadZone (multi-select input), DocumentNavBar /components — AppHeader (sticky top bar — brand mark, active-project
breadcrumb, account menu with email + sign out; added
2026-10-13, see "Enterprise app-shell redesign" under Key
decisions & lessons), AppFooter (slim bottom bar, same
entry), FileUploadZone (multi-select input), DocumentNavBar
(prev/next between completed documents), ProjectSidebar (prev/next between completed documents), ProjectSidebar
(Stage B.3 — project list/select/create/rename/delete, (the app's primary left nav as of 2026-10-13 — project
filters the document list, collapsible), LoginView list/select/create/rename/delete, a client-side project
search box, filters the document list, collapses to an
icon-only rail), LoginView
(Sign In/Sign Up toggle + "Continue with Google"), (Sign In/Sign Up toggle + "Continue with Google"),
ProcessingIndicator, ResultCard (Download + Download All, ProcessingIndicator, ResultCard (Download + Download All,
best-effort persists the export to R2 via best-effort persists the export to R2 via
@ -387,12 +402,17 @@ security only, not the full SaaS-shaped doc — and the judgment call on what co
select), TransactionRow, ResizablePanels. `RestoreBanner` select), TransactionRow, ResizablePanels. `RestoreBanner`
was removed in Stage B.2 (see Key decisions & lessons) — was removed in Stage B.2 (see Key decisions & lessons) —
PocketBase being the real backend left no ambiguity for it PocketBase being the real backend left no ambiguity for it
to explain. to explain. Every button/nav icon site-wide uses
/views/ExtractorView.vue — composes everything above - this IS the whole page, FontAwesome solid icons now (`@fortawesome/fontawesome-free`)
now split into `.page-layout` (ProjectSidebar + a in place of the original vanilla-JS build's unicode
`.page-main` wrapper around what used to be its direct entities (✎/✓/✕/←/→/▶/−/▲▼).
children). `App.vue` gates this behind /views/ExtractorView.vue — the extraction page itself: upload, result, document
`authStore.isAuthenticated`, showing `LoginView` otherwise. navigation, side-by-side review. No longer owns a page-level
layout wrapper or ProjectSidebar (both moved up to App.vue's
shell 2026-10-13 — ProjectSidebar is account-wide chrome, not
specific to this one page). `App.vue` gates the whole shell
behind `authStore.isAuthenticated`, showing `LoginView`
otherwise.
``` ```
**One real bug caught and fixed during this restructure, server-side:** the production **One real bug caught and fixed during this restructure, server-side:** the production
`Dockerfile` serves `frontend/dist` from Flask via a catch-all route `Dockerfile` serves `frontend/dist` from Flask via a catch-all route
@ -943,6 +963,82 @@ direct execution; the UI wiring on top of it follows the same prop/emit-name
cross-checking discipline as the original Vue restructure, but is unconfirmed by an cross-checking discipline as the original Vue restructure, but is unconfirmed by an
actual click until the user tries it in their own browser. actual click until the user tries it in their own browser.
**Enterprise app-shell redesign (header/sidebar/footer) + FontAwesome icon pass,
2026-10-13.** The user's own assessment of the Stage B.3 sidebar: "not impressive at
all" - pointed at `docs/sample_ui.png` (a Cloudflare R2 dashboard screenshot) as the
reference to model the shell on, keeping the existing enterprise-light color theme
(blue `#2563EB` accent, white cards) unchanged, and asked for FontAwesome icons on
buttons and sidebar navigation "so they look professional and enterprise" rather than
hand-drawn ones. This was a real structural change, not just a restyle: `ProjectSidebar`
moved from being a child of `ExtractorView` (page-specific) to a child of `App.vue`
(account-wide chrome, same level as the new header/footer) - reasoned the same way as
the header/footer themselves: which project is active isn't specific to the extraction
page, it's account-level navigation.
New shell, built in `App.vue`: `AppHeader` (sticky, full width - a brand mark, a
breadcrumb showing the active project, and an account menu with email + sign out,
replacing the old plain `.account-bar`) + a body row (`ProjectSidebar` + `.app-content`
holding `<RouterView>`) + `AppFooter` (slim, real content only - app name/phase/
copyright, no fabricated Support/Careers/Status links the reference screenshot has but
this app doesn't actually have pages for). `ProjectSidebar` itself was rebuilt to match
the reference's own left-nav pattern: a project search/filter box (new, client-side
only), an icon-led nav list ("All Documents" + each project, `fa-folder`/
`fa-folder-open` when active), and a collapse toggle anchored at the bottom of the
sidebar rather than floating at its top - collapsed state is a narrow icon-only rail
(same pattern most enterprise dashboards use - Slack, Linear, etc.), not the old "shrink
to just a toggle button" treatment, so project icons stay clickable (with their own
`title` tooltips) even collapsed.
**Deliberately kept page-level scrolling, not nested scroll panes.** The reference
screenshot's own sidebar/content scroll independently of each other (a classic fixed-
viewport dashboard shell). This app's `.review-grid`/`.pdf-col`/`.txn-col` already rely
on `position:sticky` tracking the PAGE's own scroll (confirmed by reading their own
comments - "Sticky on the GROUP... keeps moving together... while the main page
scrolls"). Giving `.app-content` its own independent scroll container would have broken
that sticky behavior outright (sticky positioning needs its nearest scrolling ancestor
to actually be the page, not a nested pane) - not something this request asked to
touch, so `.app-sidebar` instead uses the exact same `position:sticky` pattern already
proven out elsewhere in this file (`top:56px` - the header's own height - instead of
`top:24px`), and the page keeps scrolling as a whole, same as before. This was a
deliberate judgment call to preserve working, already-verified behavior rather than
literally copy the reference's nested-scroll-pane structure.
**FontAwesome, not hand-drawn icons, per explicit request.** Installed as a real npm
dependency (`@fortawesome/fontawesome-free`, imported once in `main.js`) rather than a
CDN `<link>` - keeps the Docker build fully offline-reproducible, same reasoning as
every other dependency in this repo. Every unicode-entity icon left over from the
original vanilla-JS build (✎/✓/✕/←/→/▶/−/▲▼, scattered across `TransactionRow`,
`DocumentNavBar`, `ResultCard`, `TransactionsTable`, `SourceDocumentPanel`,
`FileUploadZone`, `ProjectSidebar`) was replaced with a solid FontAwesome icon of the
same meaning, not just the sidebar - the user's own framing ("the buttons AND the
sidebar navigation") read as the whole app, and leaving half the icons as unicode
glyphs after an icon pass would have been a worse, inconsistent result. Icons were
verified to actually exist in the installed FA7 free solid set by grepping the real
installed `all.min.css` for each class name used (`fa-file-invoice-dollar`,
`fa-cloud-arrow-up`, `fa-folder-open`, etc.) before using any of them, not assumed from
memory of FA's icon library.
**One pre-existing dead CSS rule fixed as a side effect, not touched deliberately:**
`.img-zoom-controls button#imgZoomReset{...}` (fit-to-width zoom button sizing) existed
in `main.css` since the original Vue restructure but matched nothing - the button it
targeted never actually had `id="imgZoomReset"` in `SourceDocumentPanel.vue`'s markup.
Adding the icon to that button was also the moment to add the id it was always supposed
to have, so this rule now applies for the first time.
Verified: `npm run build` passes (FontAwesome's woff2 fonts bundle correctly into
`dist/assets`); every icon class name used was grepped against the real installed
`all.min.css` and confirmed present; the `app` container was rebuilt and `curl`-checked
end-to-end - `/` serves 200, the built CSS/JS bundles serve 200, the referenced
`fa-solid-900-*.woff2` file the CSS points at resolves 200, and the built JS bundle
contains the new component class names/icon classes (`app-sidebar`, `app-header`,
`app-footer`, `fa-file-invoice-dollar`, etc.) - not just that the build didn't error.
`measure.py` re-run, unaffected (no backend touched). **Not machine-verified:** the
actual rendered page - whether the header/sidebar/footer look right, whether the
collapse rail behaves, whether any icon is misaligned - Claude-in-Chrome was not
connected this session either (tried again, same as every prior UI change in this
project); this is the one area of this change the user needs to confirm visually
themselves before considering it done.
**Governing rule: never silently correct or exclude data.** This shows up in several **Governing rule: never silently correct or exclude data.** This shows up in several
concrete places, not just as an abstract principle: concrete places, not just as an abstract principle:
- A row with an unusual status (e.g. HSBC's "Cancelled" wires) stays in the output and is - A row with an unusual status (e.g. HSBC's "Cancelled" wires) stays in the output and is
@ -1125,7 +1221,7 @@ be set explicitly (`/usr/share/tesseract-ocr/5/tessdata`); tesserocr does not re
auto-discover Debian's tessdata location on its own (confirmed for real: failed with auto-discover Debian's tessdata location on its own (confirmed for real: failed with
"invalid tessdata path: ./" without it). "invalid tessdata path: ./" without it).
## Frontend / UI state (as of 2026-10-12) ## Frontend / UI state (as of 2026-10-13)
**Theme is enterprise-light, not the Bettersight brand default.** `UI_DESIGN_THEME.md` **Theme is enterprise-light, not the Bettersight brand default.** `UI_DESIGN_THEME.md`
specifies a dark-first brand system (deep navy base, single lime-green accent) — that's specifies a dark-first brand system (deep navy base, single lime-green accent) — that's

BIN
docs/sample_ui.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 407 KiB

View File

@ -8,6 +8,7 @@
"name": "frontend", "name": "frontend",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"@fortawesome/fontawesome-free": "^7.3.1",
"pinia": "^4.0.3", "pinia": "^4.0.3",
"pocketbase": "^0.28.1", "pocketbase": "^0.28.1",
"vue": "^3.5.42", "vue": "^3.5.42",
@ -64,6 +65,15 @@
"node": ">=6.9.0" "node": ">=6.9.0"
} }
}, },
"node_modules/@fortawesome/fontawesome-free": {
"version": "7.3.1",
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-7.3.1.tgz",
"integrity": "sha512-wmglKKPDIkgV3aWlZzWECCPoGIkYCulzBwxG9+w7rc5BGapZ6cPMpoPOT8k36J0Ni7PPX6c/rsoMWfS4d1MUMg==",
"license": "(CC-BY-4.0 AND OFL-1.1 AND MIT)",
"engines": {
"node": ">=6"
}
},
"node_modules/@jridgewell/gen-mapping": { "node_modules/@jridgewell/gen-mapping": {
"version": "0.3.13", "version": "0.3.13",
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",

View File

@ -9,6 +9,7 @@
"preview": "vite preview" "preview": "vite preview"
}, },
"dependencies": { "dependencies": {
"@fortawesome/fontawesome-free": "^7.3.1",
"pinia": "^4.0.3", "pinia": "^4.0.3",
"pocketbase": "^0.28.1", "pocketbase": "^0.28.1",
"vue": "^3.5.42", "vue": "^3.5.42",

View File

@ -1,17 +1,22 @@
<script setup> <script setup>
/** /**
* App.vue - the auth gate: shows LoginView until authStore.isAuthenticated, * App.vue - the auth gate: shows LoginView until authStore.isAuthenticated,
* then the routed app (unchanged otherwise) with a small account bar * then the full app shell (AppHeader + ProjectSidebar + routed content +
* (email + sign out) above it. syncWithAuthStore() is registered here, * AppFooter - see docs/sample_ui.png, the reference this shell is modeled
* once, since App.vue itself only ever renders once for the app's * on). ProjectSidebar lives here, not inside ExtractorView, since it's
* lifetime - it mirrors the PocketBase SDK's own auth state (which * account-wide chrome (same reasoning as the header/footer), not specific
* persists/restores the session token itself) into the Pinia store * to any one page. syncWithAuthStore() is registered here, once, since
* every other component reads. * App.vue itself only ever renders once for the app's lifetime - it
* mirrors the PocketBase SDK's own auth state (which persists/restores
* the session token itself) into the Pinia store every other component
* reads.
*/ */
import { onMounted } from 'vue' import { onMounted } from 'vue'
import { useAuthStore } from './stores/authStore' import { useAuthStore } from './stores/authStore'
import * as authService from './services/authService'
import LoginView from './views/LoginView.vue' import LoginView from './views/LoginView.vue'
import AppHeader from './components/AppHeader.vue'
import AppFooter from './components/AppFooter.vue'
import ProjectSidebar from './components/ProjectSidebar.vue'
const authStore = useAuthStore() const authStore = useAuthStore()
onMounted(authStore.syncWithAuthStore) onMounted(authStore.syncWithAuthStore)
@ -19,11 +24,14 @@ onMounted(authStore.syncWithAuthStore)
<template> <template>
<LoginView v-if="!authStore.isAuthenticated" /> <LoginView v-if="!authStore.isAuthenticated" />
<main v-else> <div v-else class="app-shell">
<div class="account-bar"> <AppHeader />
<span class="account-email">{{ authStore.user?.email }}</span> <div class="app-body">
<button type="button" class="account-logout" @click="authService.logout()">Sign out</button> <ProjectSidebar />
<main class="app-content">
<RouterView />
</main>
</div> </div>
<RouterView /> <AppFooter />
</main> </div>
</template> </template>

View File

@ -72,7 +72,12 @@ h1{ font-family:var(--fd); font-weight:800; font-size:30px; letter-spacing:-.01e
display:flex; align-items:center; justify-content:space-between; gap:10px; display:flex; align-items:center; justify-content:space-between; gap:10px;
background:var(--navy); border:1px solid var(--border-2); border-radius:7px; padding:7px 8px 7px 11px; background:var(--navy); border:1px solid var(--border-2); border-radius:7px; padding:7px 8px 7px 11px;
} }
.staged-file-name{ font-family:var(--fm); font-size:12px; color:var(--t1); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; } .staged-file-name{
display:flex; align-items:center; gap:7px; font-family:var(--fm); font-size:12px; color:var(--t1);
white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.staged-file-name i{ color:var(--t4); font-size:11px; flex-shrink:0; }
.file-zone-icon{ display:block; font-size:26px; color:var(--border-b); margin-bottom:10px; }
.staged-file-remove{ .staged-file-remove{
background:transparent; border:none; cursor:pointer; color:var(--t4); font-size:11px; background:transparent; border:none; cursor:pointer; color:var(--t4); font-size:11px;
padding:4px 6px; border-radius:5px; flex-shrink:0; line-height:1; padding:4px 6px; border-radius:5px; flex-shrink:0; line-height:1;
@ -169,6 +174,7 @@ h1{ font-family:var(--fd); font-weight:800; font-size:30px; letter-spacing:-.01e
.checks-list strong{ font-family:var(--fd); font-weight:700; color:var(--t1); text-transform:capitalize; } .checks-list strong{ font-family:var(--fd); font-weight:700; color:var(--t1); text-transform:capitalize; }
.tag{ .tag{
display:inline-flex; align-items:center; gap:4px;
font-family:var(--fm); font-size:9.5px; font-weight:600; text-transform:uppercase; letter-spacing:.06em; font-family:var(--fm); font-size:9.5px; font-weight:600; text-transform:uppercase; letter-spacing:.06em;
padding:3px 9px; border-radius:20px; white-space:nowrap; flex-shrink:0; margin-top:1px; padding:3px 9px; border-radius:20px; white-space:nowrap; flex-shrink:0; margin-top:1px;
} }
@ -272,6 +278,7 @@ tr.editing td{ background:rgba(37,99,235,.03); }
.doc-nav-arrow:hover:not(:disabled){ border-color:var(--blue); color:var(--blue); } .doc-nav-arrow:hover:not(:disabled){ border-color:var(--blue); color:var(--blue); }
.doc-nav-arrow:disabled{ opacity:.35; cursor:not-allowed; } .doc-nav-arrow:disabled{ opacity:.35; cursor:not-allowed; }
.doc-nav-label{ display:flex; align-items:baseline; gap:8px; font-size:13px; min-width:0; } .doc-nav-label{ display:flex; align-items:baseline; gap:8px; font-size:13px; min-width:0; }
.doc-nav-file-icon{ color:var(--t4); font-size:11px; align-self:center; }
.doc-nav-name{ font-weight:600; color:var(--t1); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:360px; } .doc-nav-name{ font-weight:600; color:var(--t1); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:360px; }
.doc-nav-position{ color:var(--t4); font-family:var(--fm); font-size:11.5px; flex-shrink:0; } .doc-nav-position{ color:var(--t4); font-family:var(--fm); font-size:11.5px; flex-shrink:0; }
@ -378,6 +385,7 @@ tr.editing td{ background:rgba(37,99,235,.03); }
.txn-col-head h2{ margin-bottom:0; } .txn-col-head h2{ margin-bottom:0; }
.txn-col .fields, .txn-col .note{ flex-shrink:0; } .txn-col .fields, .txn-col .note{ flex-shrink:0; }
.btn-toggle{ .btn-toggle{
display:inline-flex; align-items:center; gap:7px;
background:var(--blue); border:none; color:var(--navy-2); font-family:var(--fd); font-weight:700; background:var(--blue); border:none; color:var(--navy-2); font-family:var(--fd); font-weight:700;
font-size:12px; padding:7px 15px; border-radius:8px; cursor:pointer; transition:all .15s; flex-shrink:0; font-size:12px; padding:7px 15px; border-radius:8px; cursor:pointer; transition:all .15s; flex-shrink:0;
box-shadow:0 2px 10px rgba(37,99,235,.18); box-shadow:0 2px 10px rgba(37,99,235,.18);
@ -435,6 +443,7 @@ tr.editing td{ background:rgba(37,99,235,.03); }
.login-page{ min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px; } .login-page{ min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px; }
.login-card{ width:100%; max-width:360px; margin-bottom:0; } .login-card{ width:100%; max-width:360px; margin-bottom:0; }
.login-card h2{ display:flex; align-items:center; gap:9px; }
/* .fields > div's own flex:1 1 180px is a WIDTH basis, meant for the /* .fields > div's own flex:1 1 180px is a WIDTH basis, meant for the
horizontal balance-fields row - in this column layout that same horizontal balance-fields row - in this column layout that same
180px becomes a HEIGHT basis instead, stretching each field wrapper 180px becomes a HEIGHT basis instead, stretching each field wrapper
@ -451,56 +460,118 @@ tr.editing td{ background:rgba(37,99,235,.03); }
} }
.login-mode-toggle:hover{ color:var(--blue); } .login-mode-toggle:hover{ color:var(--blue); }
.account-bar{ /* ── App shell: header (full-width, sticky) + body (sidebar + content,
display:flex; align-items:center; justify-content:flex-end; gap:12px; page-level scroll like the rest of this app - no nested scroll panes,
margin-bottom:18px; font-size:12.5px; color:var(--t3); so .review-grid/.pdf-col/.txn-col's own position:sticky behavior keeps
} working unchanged) + footer. Modeled on docs/sample_ui.png's own
.account-email{ font-family:var(--fm); } chrome - see App.vue. ───────────────────────────────────────────── */
.account-logout{ .app-shell{ display:flex; flex-direction:column; min-height:100vh; }
background:transparent; border:1px solid var(--border-2); color:var(--t3); font-family:var(--fb); .app-body{ flex:1 1 auto; display:flex; align-items:flex-start; }
font-size:11.5px; padding:5px 10px; border-radius:7px; cursor:pointer; .app-content{ flex:1 1 auto; min-width:0; max-width:none; margin:0; padding:32px 28px 70px; }
}
/* The sidebar sits beside the rest of the page (not inside .app-header{
ResizablePanels - this is page-level chrome, one level up), so it position:sticky; top:0; z-index:20; height:56px; flex-shrink:0;
gets its own flex row rather than nesting into .review-grid's own background:var(--navy-2); border-bottom:1px solid var(--border);
sticky group. .page-main absorbs the remaining width; everything that display:flex; align-items:center; justify-content:space-between; padding:0 24px;
used to be direct children of <main> moved one level in, under it. */
.page-layout{ display:flex; align-items:flex-start; gap:24px; }
.page-main{ flex:1 1 auto; min-width:0; }
/* Reuses .card for background/border/shadow/h2 styling - collapsed,
it shrinks to just its own toggle rather than disappearing outright
(unlike Hide Source Doc, there's no sibling component left to host a
toggle button if this one vanished entirely, so it owns its own
collapse/expand state start to finish). */
.project-sidebar{
flex-shrink:0; width:220px; position:sticky; top:24px; padding:18px 16px;
} }
.project-sidebar.collapsed{ width:auto; padding:10px; } .app-header-left{ display:flex; align-items:center; gap:14px; min-width:0; }
.project-sidebar-toggle{ .app-logo{
background:transparent; border:1px solid var(--border-2); color:var(--t3); width:24px; height:24px; flex-shrink:0; width:32px; height:32px; border-radius:8px; background:var(--blue); color:var(--navy-2);
border-radius:6px; cursor:pointer; font-size:11px; line-height:1; display:block; display:flex; align-items:center; justify-content:center; font-size:14px;
box-shadow:0 2px 8px rgba(37,99,235,.25);
} }
.project-sidebar-toggle:hover{ border-color:var(--blue); color:var(--blue); } .app-breadcrumb{ display:flex; align-items:center; gap:9px; font-size:13.5px; color:var(--t3); min-width:0; overflow:hidden; }
.project-sidebar-body{ margin-top:14px; } .app-breadcrumb-root{ font-family:var(--fd); font-weight:700; color:var(--t1); flex-shrink:0; }
.project-sidebar-body h2{ margin-bottom:14px; } .app-breadcrumb i{ font-size:8px; color:var(--t4); flex-shrink:0; }
.app-breadcrumb-current{ color:var(--blue); font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.app-header-right{ display:flex; align-items:center; gap:10px; flex-shrink:0; }
.project-list{ list-style:none; margin:0 0 16px; padding:0; display:flex; flex-direction:column; gap:2px; } .app-account{ position:relative; }
.app-account-trigger{
display:flex; align-items:center; gap:9px; background:transparent; border:1px solid transparent;
cursor:pointer; padding:4px 10px 4px 4px; border-radius:20px; transition:all .15s;
}
.app-account-trigger:hover{ background:var(--navy); border-color:var(--border-2); }
.app-avatar{
flex-shrink:0; width:26px; height:26px; border-radius:50%; background:rgba(37,99,235,.12); color:var(--blue);
display:flex; align-items:center; justify-content:center; font-size:11px;
}
.app-account-email{ font-size:12.5px; color:var(--t2); font-family:var(--fm); }
.app-account-caret{ font-size:9px; color:var(--t4); transition:transform .15s; }
.app-account-caret.open{ transform:rotate(180deg); }
.app-account-menu{
position:absolute; top:calc(100% + 8px); right:0; min-width:220px; z-index:30;
background:var(--navy-2); border:1px solid var(--border); border-radius:10px; box-shadow:var(--shadow-h); padding:6px;
}
.app-account-menu-email{
padding:8px 10px 10px; margin-bottom:4px; border-bottom:1px solid var(--border);
font-family:var(--fm); font-size:11.5px; color:var(--t4); word-break:break-all;
}
.app-account-menu-item{
width:100%; display:flex; align-items:center; gap:9px; text-align:left; background:transparent; border:none;
cursor:pointer; padding:8px 10px; border-radius:6px; font-size:13px; color:var(--t2); font-family:var(--fb);
}
.app-account-menu-item:hover{ background:var(--red-l); color:var(--red); }
.app-footer{
flex-shrink:0; display:flex; align-items:center; gap:8px; padding:13px 24px;
background:var(--navy-2); border-top:1px solid var(--border); font-size:11.5px; color:var(--t4);
}
.app-footer-sep{ color:var(--border-2); }
.app-footer-spacer{ flex:1 1 auto; }
/* ── Sidebar: the account's primary left nav (projects) - full height
under the header, sticky so it tracks page scroll the same way
.pdf-col/.txn-col already do. Collapses to a narrow icon-only rail
(same pattern as most enterprise dashboards) rather than vanishing. */
.app-sidebar{
flex-shrink:0; width:240px; position:sticky; top:56px; height:calc(100vh - 56px);
background:var(--navy-2); border-right:1px solid var(--border);
display:flex; flex-direction:column; padding:16px 14px; transition:width .15s;
}
.app-sidebar.collapsed{ width:60px; padding:16px 8px; align-items:center; }
.app-sidebar-search{ position:relative; flex-shrink:0; margin-bottom:12px; }
.app-sidebar-search i{ position:absolute; left:10px; top:50%; transform:translateY(-50%); font-size:11px; color:var(--t4); }
.app-sidebar-search input{
width:100%; height:32px; padding:0 10px 0 28px; background:var(--navy); border:1px solid var(--border-2);
border-radius:7px; font-size:12px; color:var(--t1); font-family:var(--fb); outline:none; transition:border-color .2s;
}
.app-sidebar-search input:focus{ border-color:var(--blue); }
.app-sidebar.collapsed .app-sidebar-search{ display:none; }
.app-sidebar-scroll{ flex:1 1 auto; min-height:0; overflow-y:auto; width:100%; }
.app-sidebar-section-label{
font-family:var(--fm); font-size:10px; font-weight:600; letter-spacing:.08em; text-transform:uppercase;
color:var(--t4); padding:10px 8px 6px;
}
.app-sidebar.collapsed .app-sidebar-section-label{ display:none; }
.app-sidebar-toggle{
flex-shrink:0; margin-top:10px; width:100%; display:flex; align-items:center; justify-content:center; gap:8px;
background:transparent; border:1px solid var(--border-2); color:var(--t3); border-radius:7px; padding:8px;
cursor:pointer; font-size:12px; font-family:var(--fb);
}
.app-sidebar-toggle:hover{ border-color:var(--blue); color:var(--blue); }
.project-list{ list-style:none; margin:0 0 10px; padding:0; display:flex; flex-direction:column; gap:2px; width:100%; }
.project-list li{ .project-list li{
display:flex; align-items:center; gap:2px; border-radius:7px; padding:2px; display:flex; align-items:center; gap:2px; border-radius:7px; padding:2px;
} }
.project-list li.active{ background:rgba(37,99,235,.08); } .project-list li.active{ background:rgba(37,99,235,.08); }
.project-name{ .project-name{
flex:1 1 auto; min-width:0; text-align:left; background:transparent; border:none; cursor:pointer; flex:1 1 auto; min-width:0; display:flex; align-items:center; gap:9px; text-align:left;
background:transparent; border:none; cursor:pointer;
padding:7px 8px; border-radius:6px; font-size:13px; color:var(--t2); font-family:var(--fb); padding:7px 8px; border-radius:6px; font-size:13px; color:var(--t2); font-family:var(--fb);
white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
} }
.project-name i{ flex-shrink:0; width:14px; text-align:center; color:var(--t4); font-size:12px; }
.project-name-text{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.project-list li.active .project-name{ color:var(--blue); font-weight:600; } .project-list li.active .project-name{ color:var(--blue); font-weight:600; }
.project-list li.active .project-name i{ color:var(--blue); }
.project-name:hover{ color:var(--blue); } .project-name:hover{ color:var(--blue); }
.project-row-btn{ .project-row-btn{
flex-shrink:0; background:transparent; border:none; cursor:pointer; color:var(--t4); flex-shrink:0; background:transparent; border:none; cursor:pointer; color:var(--t4);
font-size:11px; padding:5px; border-radius:5px; line-height:1; font-size:11px; padding:6px; border-radius:5px; line-height:1;
} }
.project-row-btn:hover{ color:var(--t1); background:rgba(16,24,40,.06); } .project-row-btn:hover{ color:var(--t1); background:rgba(16,24,40,.06); }
.project-rename-input{ .project-rename-input{
@ -508,6 +579,11 @@ tr.editing td{ background:rgba(37,99,235,.03); }
border:1px solid var(--blue); border-radius:6px; font-size:13px; color:var(--t1); font-family:var(--fb); border:1px solid var(--blue); border-radius:6px; font-size:13px; color:var(--t1); font-family:var(--fb);
outline:none; outline:none;
} }
.app-sidebar.collapsed .project-name{ justify-content:center; padding:9px 0; }
.app-sidebar.collapsed .project-name-text,
.app-sidebar.collapsed .project-row-btn,
.app-sidebar.collapsed .project-new,
.app-sidebar.collapsed .app-sidebar-toggle span{ display:none; }
.project-new{ display:flex; gap:6px; } .project-new{ display:flex; gap:6px; }
.project-new input{ .project-new input{
@ -518,19 +594,30 @@ tr.editing td{ background:rgba(37,99,235,.03); }
.project-new input:focus{ border-color:var(--blue); } .project-new input:focus{ border-color:var(--blue); }
.project-new button{ .project-new button{
flex-shrink:0; width:34px; height:34px; background:var(--blue); color:var(--navy-2); border:none; flex-shrink:0; width:34px; height:34px; background:var(--blue); color:var(--navy-2); border:none;
border-radius:7px; cursor:pointer; font-weight:700; font-size:15px; border-radius:7px; cursor:pointer; font-weight:700; font-size:13px;
} }
.project-new button:disabled{ opacity:.4; cursor:not-allowed; } .project-new button:disabled{ opacity:.4; cursor:not-allowed; }
.project-sidebar .error-note{ margin-top:12px; } .app-sidebar .error-note{ margin-top:12px; width:100%; }
/* Lets the active document be reassigned to a different project even /* Lets the active document be reassigned to a different project even
with just one document loaded (independent of DocumentNavBar's own with just one document loaded (independent of DocumentNavBar's own
>1-document visibility gate) - sits right below it, above the >1-document visibility gate) - sits right below it, above the
Transactions/Hide Source Doc row. */ Transactions/Hide Source Doc row. */
.move-to-project{ display:flex; align-items:center; gap:8px; margin-bottom:14px; } .move-to-project{ display:flex; align-items:center; gap:8px; margin-bottom:14px; }
.move-to-project label{ font-size:11.5px; color:var(--t3); flex-shrink:0; } .move-to-project label{ display:inline-flex; align-items:center; gap:6px; font-size:11.5px; color:var(--t3); flex-shrink:0; }
.move-to-project select{ .move-to-project select{
height:32px; padding:0 8px; background:var(--navy); border:1px solid var(--border-2); height:32px; padding:0 8px; background:var(--navy); border:1px solid var(--border-2);
border-radius:7px; font-size:12.5px; color:var(--t1); font-family:var(--fb); outline:none; cursor:pointer; border-radius:7px; font-size:12.5px; color:var(--t1); font-family:var(--fb); outline:none; cursor:pointer;
} }
.account-logout:hover{ color:var(--t1); border-color:var(--border-b); }
/* Icon-prefixed inputs (LoginView's email/password fields). */
.input-icon-wrap{ position:relative; }
.input-icon-wrap i{ position:absolute; left:11px; top:50%; transform:translateY(-50%); font-size:12px; color:var(--t4); pointer-events:none; }
.input-icon-wrap input{ padding-left:34px; }
@media (max-width:860px){
.app-body{ flex-direction:column; }
.app-sidebar{ position:static; width:100%; height:auto; border-right:none; border-bottom:1px solid var(--border); }
.app-sidebar.collapsed{ width:100%; }
.app-account-email{ display:none; }
}

View File

@ -0,0 +1,21 @@
<script setup>
/**
* AppFooter.vue
*
* Slim chrome bar at the bottom of the shell, matching docs/sample_ui.png's
* own footer band visually (thin border-top, muted small text). Content is
* kept to what's actually real about this app - no fabricated links to
* pages (Careers/Terms/Status) that don't exist here.
*/
const year = new Date().getFullYear()
</script>
<template>
<footer class="app-footer">
<span>Bettersight Statement Extractor</span>
<span class="app-footer-sep">&middot;</span>
<span>Phase 1</span>
<span class="app-footer-spacer"></span>
<span>&copy; {{ year }} Bettersight</span>
</footer>
</template>

View File

@ -0,0 +1,78 @@
<script setup>
/**
* AppHeader.vue
*
* Top app bar, full width, above the sidebar/content row - modeled on
* docs/sample_ui.png's own header (brand mark + breadcrumb on the left,
* an account menu on the right). Only real, functional elements are
* included (no decorative "Ask AI"/"Support" buttons that do nothing) -
* the account menu is the one piece of chrome this app actually has to
* offer there (email + sign out), same as the account-bar it replaces.
*/
import { ref, onMounted, onUnmounted } from 'vue'
import { useAuthStore } from '../stores/authStore'
import { useProjectsStore } from '../stores/projectsStore'
import * as authService from '../services/authService'
const authStore = useAuthStore()
const projectsStore = useProjectsStore()
const menuOpen = ref(false)
const menuRef = ref(null)
function toggleMenu() {
menuOpen.value = !menuOpen.value
}
function handleOutsideClick(e) {
if (menuOpen.value && menuRef.value && !menuRef.value.contains(e.target)) {
menuOpen.value = false
}
}
onMounted(() => window.addEventListener('click', handleOutsideClick))
onUnmounted(() => window.removeEventListener('click', handleOutsideClick))
function handleSignOut() {
menuOpen.value = false
authService.logout()
}
</script>
<template>
<header class="app-header">
<div class="app-header-left">
<div class="app-logo">
<i class="fa-solid fa-file-invoice-dollar"></i>
</div>
<nav class="app-breadcrumb" aria-label="Breadcrumb">
<span class="app-breadcrumb-root">Bettersight</span>
<i class="fa-solid fa-chevron-right"></i>
<span>Statement Extractor</span>
<template v-if="projectsStore.activeProjectId">
<i class="fa-solid fa-chevron-right"></i>
<span class="app-breadcrumb-current">
{{ projectsStore.projects.find((p) => p.id === projectsStore.activeProjectId)?.name }}
</span>
</template>
</nav>
</div>
<div class="app-header-right">
<div ref="menuRef" class="app-account">
<button type="button" class="app-account-trigger" @click="toggleMenu">
<span class="app-avatar"><i class="fa-solid fa-user"></i></span>
<span class="app-account-email">{{ authStore.user?.email }}</span>
<i class="fa-solid fa-chevron-down app-account-caret" :class="{ open: menuOpen }"></i>
</button>
<div v-if="menuOpen" class="app-account-menu">
<div class="app-account-menu-email">{{ authStore.user?.email }}</div>
<button type="button" class="app-account-menu-item" @click="handleSignOut">
<i class="fa-solid fa-arrow-right-from-bracket"></i>
Sign out
</button>
</div>
</div>
</div>
</header>
</template>

View File

@ -26,8 +26,9 @@ const positionText = computed(
title="Previous document" title="Previous document"
:disabled="extractionStore.activeIndex === 0" :disabled="extractionStore.activeIndex === 0"
@click="extractionStore.prev()" @click="extractionStore.prev()"
>&#8592;</button> ><i class="fa-solid fa-chevron-left"></i></button>
<div class="doc-nav-label"> <div class="doc-nav-label">
<i class="fa-solid fa-file-lines doc-nav-file-icon"></i>
<span class="doc-nav-name">{{ extractionStore.activeDocument?.fileName }}</span> <span class="doc-nav-name">{{ extractionStore.activeDocument?.fileName }}</span>
<span class="doc-nav-position">({{ positionText }})</span> <span class="doc-nav-position">({{ positionText }})</span>
</div> </div>
@ -37,6 +38,6 @@ const positionText = computed(
title="Next document" title="Next document"
:disabled="extractionStore.activeIndex === extractionStore.documents.length - 1" :disabled="extractionStore.activeIndex === extractionStore.documents.length - 1"
@click="extractionStore.next()" @click="extractionStore.next()"
>&#8594;</button> ><i class="fa-solid fa-chevron-right"></i></button>
</div> </div>
</template> </template>

View File

@ -43,6 +43,7 @@ const extractionStore = useExtractionStore()
accept=".pdf,application/pdf,.jpg,.jpeg,.png,image/jpeg,image/png" accept=".pdf,application/pdf,.jpg,.jpeg,.png,image/jpeg,image/png"
@change="emit('file-input-change', $event)" @change="emit('file-input-change', $event)"
> >
<i class="fa-solid fa-cloud-arrow-up file-zone-icon"></i>
<div class="file-zone-label"><strong>Drop one or more statement PDFs or photos here</strong> or browse</div> <div class="file-zone-label"><strong>Drop one or more statement PDFs or photos here</strong> or browse</div>
<div class="file-zone-sub">.pdf, .jpg, or .png files - add as many as you like, one at a time or together</div> <div class="file-zone-sub">.pdf, .jpg, or .png files - add as many as you like, one at a time or together</div>
</div> </div>
@ -52,12 +53,15 @@ const extractionStore = useExtractionStore()
pulled back out before Extract is ever clicked. --> pulled back out before Extract is ever clicked. -->
<ul v-if="chosenFiles.length" class="staged-files"> <ul v-if="chosenFiles.length" class="staged-files">
<li v-for="(f, i) in chosenFiles" :key="f.name + ':' + f.size"> <li v-for="(f, i) in chosenFiles" :key="f.name + ':' + f.size">
<span class="staged-file-name">{{ f.name }}</span> <span class="staged-file-name"><i class="fa-solid fa-file-lines"></i>{{ f.name }}</span>
<button type="button" class="staged-file-remove" title="Remove this file" @click="emit('remove-file', i)">&#10005;</button> <button type="button" class="staged-file-remove" title="Remove this file" @click="emit('remove-file', i)">
<i class="fa-solid fa-xmark"></i>
</button>
</li> </li>
</ul> </ul>
<button class="btn btn-primary" type="button" :disabled="!chosenFiles.length || isProcessing" @click="emit('extract')"> <button class="btn btn-primary" type="button" :disabled="!chosenFiles.length || isProcessing" @click="emit('extract')">
<i class="fa-solid fa-bolt"></i>
Extract{{ chosenFiles.length > 1 ? ` (${chosenFiles.length})` : '' }} Extract{{ chosenFiles.length > 1 ? ` (${chosenFiles.length})` : '' }}
</button> </button>
<ProcessingIndicator :is-processing="isProcessing" :phase-text="phaseText" /> <ProcessingIndicator :is-processing="isProcessing" :phase-text="phaseText" />

View File

@ -15,5 +15,5 @@ defineProps({
</script> </script>
<template> <template>
<span v-if="isProcessing" class="spinner">{{ phaseText }}</span> <span v-if="isProcessing" class="spinner"><i class="fa-solid fa-spinner fa-spin"></i>{{ phaseText }}</span>
</template> </template>

View File

@ -2,15 +2,20 @@
/** /**
* ProjectSidebar.vue * ProjectSidebar.vue
* *
* Lists the logged-in user's projects; selecting one FILTERS the * The app's primary left nav (full height, beside AppHeader/AppFooter -
* document list (documentsService.listDocuments({project})) rather than * see App.vue's shell) - modeled on docs/sample_ui.png's own left nav:
* gating anything - "All" (the default) shows every document, same as * a search/filter box, an icon-led nav list, and a collapse toggle
* before projects existed at all. Collapses to a slim strip with just * anchored at the bottom. Selecting a project FILTERS the document list
* its own toggle (never fully disappears - unlike Hide Source Doc, * (documentsService.listDocuments({project})) rather than gating
* there's no sibling component to host a toggle button when this one is * anything - "All Documents" (the default) shows every document, same
* gone entirely, so it owns its own collapse/expand). * as before projects existed at all.
*
* Collapsed state shrinks to a narrow icon-only rail (same pattern as
* Slack/most enterprise dashboards) rather than nearly vanishing - the
* search box, section label, and inline rename/delete controls hide;
* icons + the expand toggle stay reachable via their own title tooltips.
*/ */
import { ref } from 'vue' import { ref, computed } from 'vue'
import { useProjectsStore } from '../stores/projectsStore' import { useProjectsStore } from '../stores/projectsStore'
import { useUiStore } from '../stores/uiStore' import { useUiStore } from '../stores/uiStore'
import { useDocuments } from '../composables/useDocuments' import { useDocuments } from '../composables/useDocuments'
@ -19,6 +24,13 @@ const projectsStore = useProjectsStore()
const uiStore = useUiStore() const uiStore = useUiStore()
const { loadDocuments } = useDocuments() const { loadDocuments } = useDocuments()
const searchQuery = ref('')
const filteredProjects = computed(() => {
const q = searchQuery.value.trim().toLowerCase()
if (!q) return projectsStore.projects
return projectsStore.projects.filter((p) => p.name.toLowerCase().includes(q))
})
const newProjectName = ref('') const newProjectName = ref('')
const creating = ref(false) const creating = ref(false)
const errorMessage = ref('') const errorMessage = ref('')
@ -81,21 +93,26 @@ async function confirmRename(project) {
</script> </script>
<template> <template>
<div class="card project-sidebar" :class="{ collapsed: uiStore.sidebarHidden }"> <nav class="app-sidebar" :class="{ collapsed: uiStore.sidebarHidden }" aria-label="Projects">
<button <div class="app-sidebar-search">
class="project-sidebar-toggle" <i class="fa-solid fa-magnifying-glass"></i>
type="button" <input v-model="searchQuery" type="text" placeholder="Search projects…">
:title="uiStore.sidebarHidden ? 'Show projects' : 'Hide projects'" </div>
@click="uiStore.toggleSidebar"
>{{ uiStore.sidebarHidden ? '▸' : '◂' }}</button>
<div v-if="!uiStore.sidebarHidden" class="project-sidebar-body"> <div class="app-sidebar-scroll">
<h2>Projects</h2>
<ul class="project-list"> <ul class="project-list">
<li :class="{ active: projectsStore.activeProjectId === null }"> <li :class="{ active: projectsStore.activeProjectId === null }">
<button type="button" class="project-name" @click="selectProject(null)">All</button> <button type="button" class="project-name" title="All Documents" @click="selectProject(null)">
<i class="fa-solid fa-inbox"></i>
<span class="project-name-text">All Documents</span>
</button>
</li> </li>
<li v-for="p in projectsStore.projects" :key="p.id" :class="{ active: projectsStore.activeProjectId === p.id }"> </ul>
<div class="app-sidebar-section-label">Projects</div>
<ul class="project-list">
<li v-for="p in filteredProjects" :key="p.id" :class="{ active: projectsStore.activeProjectId === p.id }">
<input <input
v-if="renamingId === p.id" v-if="renamingId === p.id"
v-model="renameDraft" v-model="renameDraft"
@ -104,17 +121,24 @@ async function confirmRename(project) {
@keyup.enter="confirmRename(p)" @keyup.enter="confirmRename(p)"
@blur="confirmRename(p)" @blur="confirmRename(p)"
> >
<button v-else type="button" class="project-name" @click="selectProject(p.id)" @dblclick="startRename(p)"> <template v-else>
{{ p.name }} <button type="button" class="project-name" :title="p.name" @click="selectProject(p.id)" @dblclick="startRename(p)">
</button> <i class="fa-solid" :class="projectsStore.activeProjectId === p.id ? 'fa-folder-open' : 'fa-folder'"></i>
<button type="button" class="project-row-btn" title="Rename" @click="startRename(p)">&#9998;</button> <span class="project-name-text">{{ p.name }}</span>
<button </button>
v-if="!p.isDefault" <button type="button" class="project-row-btn" title="Rename" @click="startRename(p)">
type="button" <i class="fa-solid fa-pen"></i>
class="project-row-btn" </button>
title="Delete project" <button
@click="handleDelete(p)" v-if="!p.isDefault"
>&#10005;</button> type="button"
class="project-row-btn"
title="Delete project"
@click="handleDelete(p)"
>
<i class="fa-solid fa-trash"></i>
</button>
</template>
</li> </li>
</ul> </ul>
@ -126,10 +150,22 @@ async function confirmRename(project) {
:disabled="creating" :disabled="creating"
@keyup.enter="handleCreate" @keyup.enter="handleCreate"
> >
<button type="button" :disabled="creating || !newProjectName.trim()" @click="handleCreate">+</button> <button type="button" title="Create project" :disabled="creating || !newProjectName.trim()" @click="handleCreate">
<i class="fa-solid fa-plus"></i>
</button>
</div> </div>
<div class="error-note" :class="{ visible: !!errorMessage }">{{ errorMessage }}</div> <div class="error-note" :class="{ visible: !!errorMessage }">{{ errorMessage }}</div>
</div> </div>
</div>
<button
type="button"
class="app-sidebar-toggle"
:title="uiStore.sidebarHidden ? 'Expand sidebar' : 'Collapse sidebar'"
@click="uiStore.toggleSidebar"
>
<i class="fa-solid" :class="uiStore.sidebarHidden ? 'fa-angles-right' : 'fa-angles-left'"></i>
<span v-if="!uiStore.sidebarHidden">Collapse</span>
</button>
</nav>
</template> </template>

View File

@ -19,6 +19,16 @@ const uiStore = useUiStore()
const result = computed(() => extractionStore.currentResult) const result = computed(() => extractionStore.currentResult)
const statusClass = computed(() => 'status-banner ' + (result.value?.status || '').replace(' ', '-')) const statusClass = computed(() => 'status-banner ' + (result.value?.status || '').replace(' ', '-'))
const periodText = computed(() => (result.value?.period ? `Statement period: ${result.value.period}` : '')) const periodText = computed(() => (result.value?.period ? `Statement period: ${result.value.period}` : ''))
const statusIcon = computed(() => {
const s = result.value?.status
if (s === 'Verified') return 'fa-circle-check'
if (s === 'Needs review') return 'fa-triangle-exclamation'
if (s === 'Failed') return 'fa-circle-xmark'
return 'fa-circle-info'
})
const outcomeIcon = {
pass: 'fa-check', fail: 'fa-xmark', needs_review: 'fa-triangle-exclamation', not_available: 'fa-minus',
}
const downloading = ref(false) const downloading = ref(false)
const downloadingAll = ref(false) const downloadingAll = ref(false)
@ -127,24 +137,26 @@ async function handleDownloadAll() {
type="button" type="button"
:aria-expanded="String(uiStore.resultExpanded)" :aria-expanded="String(uiStore.resultExpanded)"
:title="uiStore.resultExpanded ? 'Hide details' : 'Show details'" :title="uiStore.resultExpanded ? 'Hide details' : 'Show details'"
>&#9656;</button> ><i class="fa-solid fa-chevron-right"></i></button>
<h2>Result</h2> <h2>Result</h2>
</div> </div>
<div class="result-head-actions"> <div class="result-head-actions">
<button class="btn-toggle" type="button" :disabled="downloading" @click="handleDownload"> <button class="btn-toggle" type="button" :disabled="downloading" @click="handleDownload">
<i class="fa-solid" :class="downloading ? 'fa-spinner fa-spin' : 'fa-file-excel'"></i>
{{ downloading ? 'Preparing…' : 'Download Excel' }} {{ downloading ? 'Preparing…' : 'Download Excel' }}
</button> </button>
<button v-if="showDownloadAll" class="btn-toggle" type="button" :disabled="downloadingAll" @click="handleDownloadAll"> <button v-if="showDownloadAll" class="btn-toggle" type="button" :disabled="downloadingAll" @click="handleDownloadAll">
<i class="fa-solid" :class="downloadingAll ? 'fa-spinner fa-spin' : 'fa-download'"></i>
{{ downloadingAll ? 'Preparing…' : 'Download All' }} {{ downloadingAll ? 'Preparing…' : 'Download All' }}
</button> </button>
</div> </div>
</div> </div>
<div class="result-details" :class="{ expanded: uiStore.resultExpanded }"> <div class="result-details" :class="{ expanded: uiStore.resultExpanded }">
<div :class="statusClass">{{ result.status }}</div> <div :class="statusClass"><i class="fa-solid" :class="statusIcon"></i>{{ result.status }}</div>
<div class="period-note">{{ periodText }}</div> <div class="period-note">{{ periodText }}</div>
<ul class="checks-list"> <ul class="checks-list">
<li v-for="check in result.checks" :key="check.name"> <li v-for="check in result.checks" :key="check.name">
<span class="tag" :class="check.outcome">{{ check.outcome.replace('_', ' ') }}</span> <span class="tag" :class="check.outcome"><i class="fa-solid" :class="outcomeIcon[check.outcome]"></i>{{ check.outcome.replace('_', ' ') }}</span>
<span><strong>{{ check.name.replace(/_/g, ' ') }}</strong> — {{ check.detail }}</span> <span><strong>{{ check.name.replace(/_/g, ' ') }}</strong> — {{ check.detail }}</span>
</li> </li>
</ul> </ul>

View File

@ -34,10 +34,10 @@ const pdfSrc = computed(() => (props.previewUrl ? props.previewUrl + '#toolbar=1
<div class="pdf-col-head"> <div class="pdf-col-head">
<h2>Source Document</h2> <h2>Source Document</h2>
<div v-if="isImage" class="img-zoom-controls"> <div v-if="isImage" class="img-zoom-controls">
<button type="button" title="Zoom out" @click="zoomOut">&#8722;</button> <button type="button" title="Zoom out" @click="zoomOut"><i class="fa-solid fa-magnifying-glass-minus"></i></button>
<span>{{ zoomLevelText }}</span> <span>{{ zoomLevelText }}</span>
<button type="button" title="Zoom in" @click="zoomIn">+</button> <button type="button" title="Zoom in" @click="zoomIn"><i class="fa-solid fa-magnifying-glass-plus"></i></button>
<button type="button" title="Reset zoom to fit" @click="resetZoom">Fit</button> <button type="button" id="imgZoomReset" title="Reset zoom to fit" @click="resetZoom"><i class="fa-solid fa-compress"></i> Fit</button>
</div> </div>
</div> </div>
<div v-if="!previewUrl" class="empty-panel empty-panel-source"> <div v-if="!previewUrl" class="empty-panel empty-panel-source">

View File

@ -47,10 +47,10 @@ function handleEdit() {
<template> <template>
<tr :class="{ flagged: isFlagged, editing: isEditing }"> <tr :class="{ flagged: isFlagged, editing: isEditing }">
<td class="row-actions"> <td class="row-actions">
<button v-if="!isEditing" class="row-btn edit" title="Edit this row" @click="handleEdit">&#9998;</button> <button v-if="!isEditing" class="row-btn edit" title="Edit this row" @click="handleEdit"><i class="fa-solid fa-pen"></i></button>
<template v-else> <template v-else>
<button class="row-btn save" title="Save this row" @click="saveEdit">&#10003;</button> <button class="row-btn save" title="Save this row" @click="saveEdit"><i class="fa-solid fa-check"></i></button>
<button class="row-btn cancel" title="Discard changes" @click="cancelEdit">&#10005;</button> <button class="row-btn cancel" title="Discard changes" @click="cancelEdit"><i class="fa-solid fa-xmark"></i></button>
</template> </template>
</td> </td>
<td> <td>

View File

@ -142,14 +142,17 @@ async function handleRecheck() {
<template> <template>
<DocumentNavBar /> <DocumentNavBar />
<div v-if="result" class="move-to-project"> <div v-if="result" class="move-to-project">
<label>Project</label> <label><i class="fa-solid fa-folder-open"></i>Project</label>
<select :value="extractionStore.activeDocument?.project" :disabled="movingProject" @change="handleMoveToProject"> <select :value="extractionStore.activeDocument?.project" :disabled="movingProject" @change="handleMoveToProject">
<option v-for="p in projectsStore.projects" :key="p.id" :value="p.id">{{ p.name }}</option> <option v-for="p in projectsStore.projects" :key="p.id" :value="p.id">{{ p.name }}</option>
</select> </select>
</div> </div>
<div class="txn-col-head"> <div class="txn-col-head">
<h2>Transactions</h2> <h2>Transactions</h2>
<button class="btn-toggle" type="button" @click="uiStore.togglePdfCol">{{ toggleLabel }}</button> <button class="btn-toggle" type="button" @click="uiStore.togglePdfCol">
<i class="fa-solid" :class="uiStore.pdfColHidden ? 'fa-eye' : 'fa-eye-slash'"></i>
{{ toggleLabel }}
</button>
</div> </div>
<div class="fields-row"> <div class="fields-row">
<div class="fields"> <div class="fields">
@ -167,6 +170,7 @@ async function handleRecheck() {
<div class="recheck-wrap"> <div class="recheck-wrap">
<label class="recheck-spacer">&nbsp;</label> <label class="recheck-spacer">&nbsp;</label>
<button class="btn-toggle btn-recheck" type="button" :disabled="!result || rechecking" @click="handleRecheck"> <button class="btn-toggle btn-recheck" type="button" :disabled="!result || rechecking" @click="handleRecheck">
<i class="fa-solid" :class="rechecking ? 'fa-spinner fa-spin' : 'fa-rotate'"></i>
{{ rechecking ? 'Checking…' : 'Recheck Balance' }} {{ rechecking ? 'Checking…' : 'Recheck Balance' }}
</button> </button>
</div> </div>
@ -193,42 +197,42 @@ async function handleRecheck() {
<th> <th>
Date Date
<span class="sort-arrows"> <span class="sort-arrows">
<button type="button" class="sort-arrow" :class="{ active: sortKey === 'date' && sortDir === 'asc' }" title="Sort by date, oldest first" @click="setSort('date', 'asc')">&#9650;</button> <button type="button" class="sort-arrow" :class="{ active: sortKey === 'date' && sortDir === 'asc' }" title="Sort by date, oldest first" @click="setSort('date', 'asc')"><i class="fa-solid fa-sort-up"></i></button>
<button type="button" class="sort-arrow" :class="{ active: sortKey === 'date' && sortDir === 'desc' }" title="Sort by date, newest first" @click="setSort('date', 'desc')">&#9660;</button> <button type="button" class="sort-arrow" :class="{ active: sortKey === 'date' && sortDir === 'desc' }" title="Sort by date, newest first" @click="setSort('date', 'desc')"><i class="fa-solid fa-sort-down"></i></button>
</span> </span>
</th> </th>
<th> <th>
Description Description
<span class="sort-arrows"> <span class="sort-arrows">
<button type="button" class="sort-arrow" :class="{ active: sortKey === 'description' && sortDir === 'asc' }" title="Sort A-Z" @click="setSort('description', 'asc')">&#9650;</button> <button type="button" class="sort-arrow" :class="{ active: sortKey === 'description' && sortDir === 'asc' }" title="Sort A-Z" @click="setSort('description', 'asc')"><i class="fa-solid fa-sort-up"></i></button>
<button type="button" class="sort-arrow" :class="{ active: sortKey === 'description' && sortDir === 'desc' }" title="Sort Z-A" @click="setSort('description', 'desc')">&#9660;</button> <button type="button" class="sort-arrow" :class="{ active: sortKey === 'description' && sortDir === 'desc' }" title="Sort Z-A" @click="setSort('description', 'desc')"><i class="fa-solid fa-sort-down"></i></button>
</span> </span>
</th> </th>
<th class="amt"> <th class="amt">
Amount Amount
<span class="sort-arrows"> <span class="sort-arrows">
<button type="button" class="sort-arrow" :class="{ active: sortKey === 'amount' && sortDir === 'asc' }" title="Sort lowest first" @click="setSort('amount', 'asc')">&#9650;</button> <button type="button" class="sort-arrow" :class="{ active: sortKey === 'amount' && sortDir === 'asc' }" title="Sort lowest first" @click="setSort('amount', 'asc')"><i class="fa-solid fa-sort-up"></i></button>
<button type="button" class="sort-arrow" :class="{ active: sortKey === 'amount' && sortDir === 'desc' }" title="Sort highest first" @click="setSort('amount', 'desc')">&#9660;</button> <button type="button" class="sort-arrow" :class="{ active: sortKey === 'amount' && sortDir === 'desc' }" title="Sort highest first" @click="setSort('amount', 'desc')"><i class="fa-solid fa-sort-down"></i></button>
</span> </span>
</th> </th>
<th class="amt"> <th class="amt">
Balance Balance
<span class="sort-arrows"> <span class="sort-arrows">
<button type="button" class="sort-arrow" :class="{ active: sortKey === 'balance' && sortDir === 'asc' }" title="Sort lowest first" @click="setSort('balance', 'asc')">&#9650;</button> <button type="button" class="sort-arrow" :class="{ active: sortKey === 'balance' && sortDir === 'asc' }" title="Sort lowest first" @click="setSort('balance', 'asc')"><i class="fa-solid fa-sort-up"></i></button>
<button type="button" class="sort-arrow" :class="{ active: sortKey === 'balance' && sortDir === 'desc' }" title="Sort highest first" @click="setSort('balance', 'desc')">&#9660;</button> <button type="button" class="sort-arrow" :class="{ active: sortKey === 'balance' && sortDir === 'desc' }" title="Sort highest first" @click="setSort('balance', 'desc')"><i class="fa-solid fa-sort-down"></i></button>
</span> </span>
</th> </th>
<th> <th>
Status Status
<span class="sort-arrows"> <span class="sort-arrows">
<button type="button" class="sort-arrow" :class="{ active: sortKey === 'status' && sortDir === 'asc' }" title="Sort A-Z" @click="setSort('status', 'asc')">&#9650;</button> <button type="button" class="sort-arrow" :class="{ active: sortKey === 'status' && sortDir === 'asc' }" title="Sort A-Z" @click="setSort('status', 'asc')"><i class="fa-solid fa-sort-up"></i></button>
<button type="button" class="sort-arrow" :class="{ active: sortKey === 'status' && sortDir === 'desc' }" title="Sort Z-A" @click="setSort('status', 'desc')">&#9660;</button> <button type="button" class="sort-arrow" :class="{ active: sortKey === 'status' && sortDir === 'desc' }" title="Sort Z-A" @click="setSort('status', 'desc')"><i class="fa-solid fa-sort-down"></i></button>
</span> </span>
</th> </th>
</tr> </tr>
<tr class="filter-row"> <tr class="filter-row">
<th class="row-actions"> <th class="row-actions">
<button v-if="hasActiveFilters" type="button" class="clear-filters-btn" title="Clear all filters" @click="clearFilters">&#10005;</button> <button v-if="hasActiveFilters" type="button" class="clear-filters-btn" title="Clear all filters" @click="clearFilters"><i class="fa-solid fa-filter-circle-xmark"></i></button>
</th> </th>
<th><input v-model="filters.date" type="text" class="filter-input" placeholder="Filter…"></th> <th><input v-model="filters.date" type="text" class="filter-input" placeholder="Filter…"></th>
<th><input v-model="filters.description" type="text" class="filter-input" placeholder="Search description…"></th> <th><input v-model="filters.description" type="text" class="filter-input" placeholder="Search description…"></th>

View File

@ -4,6 +4,7 @@ import { createApp } from 'vue'
import { createPinia } from 'pinia' import { createPinia } from 'pinia'
import App from './App.vue' import App from './App.vue'
import router from './router' import router from './router'
import '@fortawesome/fontawesome-free/css/all.min.css'
import './assets/main.css' import './assets/main.css'
createApp(App).use(createPinia()).use(router).mount('#app') createApp(App).use(createPinia()).use(router).mount('#app')

View File

@ -19,7 +19,6 @@ import ResultCard from '../components/ResultCard.vue'
import ResizablePanels from '../components/ResizablePanels.vue' import ResizablePanels from '../components/ResizablePanels.vue'
import SourceDocumentPanel from '../components/SourceDocumentPanel.vue' import SourceDocumentPanel from '../components/SourceDocumentPanel.vue'
import TransactionsTable from '../components/TransactionsTable.vue' import TransactionsTable from '../components/TransactionsTable.vue'
import ProjectSidebar from '../components/ProjectSidebar.vue'
const extractionStore = useExtractionStore() const extractionStore = useExtractionStore()
const projectsStore = useProjectsStore() const projectsStore = useProjectsStore()
@ -57,58 +56,52 @@ onMounted(async () => {
</script> </script>
<template> <template>
<div class="page-layout"> <div class="eyebrow">Extraction &amp; verification</div>
<ProjectSidebar /> <h1>Bank Statement Extractor</h1>
<div class="sub">
<div class="page-main"> Upload one or more bank statement PDFs or photos. A text PDF structures the transactions and
<div class="eyebrow">Extraction &amp; verification</div> proves the arithmetic against two independent extraction passes; a scanned or photographed
<h1>Bank Statement Extractor</h1> statement is read via OCR instead, with no second pass to cross-check it against. Multiple
<div class="sub"> files are extracted one at a time.
Upload one or more bank statement PDFs or photos. A text PDF structures the transactions and
proves the arithmetic against two independent extraction passes; a scanned or photographed
statement is read via OCR instead, with no second pass to cross-check it against. Multiple
files are extracted one at a time.
</div>
<FileUploadZone
:chosen-files="chosenFiles"
:is-drag-over="isDragOver"
:is-processing="isProcessing"
:phase-text="batchAwarePhaseText"
@file-input-change="onFileInputChange"
@drag-over="onDragOver"
@drag-leave="onDragLeave"
@drop="onDrop"
@remove-file="removeChosenFile"
@extract="handleExtract"
/>
<ResultCard v-if="extractionStore.documents.length > 0" />
<!--
Source Document and Transactions (and the opening/closing balance
fields that live in the latter) are always visible, even before a
file is chosen - the balance fields need to be enterable BEFORE
clicking Extract, since they're submitted as part of that same
request. Each panel shows its own empty state until there's
something to display - see SourceDocumentPanel.vue/
TransactionsTable.vue. Both read the ACTIVE document
(extractionStore.activeDocument), not the staged-but-unprocessed
chosenFiles. DocumentNavBar (and the "Move to project" control
beside it) lives INSIDE TransactionsTable now (across its own
top, above the Hide Source Doc button), not here.
-->
<ResizablePanels>
<template #source>
<SourceDocumentPanel
:preview-url="extractionStore.activeDocument?.previewUrl ?? null"
:is-image="extractionStore.activeDocument?.isImage ?? false"
/>
</template>
<template #transactions>
<TransactionsTable />
</template>
</ResizablePanels>
</div>
</div> </div>
<FileUploadZone
:chosen-files="chosenFiles"
:is-drag-over="isDragOver"
:is-processing="isProcessing"
:phase-text="batchAwarePhaseText"
@file-input-change="onFileInputChange"
@drag-over="onDragOver"
@drag-leave="onDragLeave"
@drop="onDrop"
@remove-file="removeChosenFile"
@extract="handleExtract"
/>
<ResultCard v-if="extractionStore.documents.length > 0" />
<!--
Source Document and Transactions (and the opening/closing balance
fields that live in the latter) are always visible, even before a
file is chosen - the balance fields need to be enterable BEFORE
clicking Extract, since they're submitted as part of that same
request. Each panel shows its own empty state until there's
something to display - see SourceDocumentPanel.vue/
TransactionsTable.vue. Both read the ACTIVE document
(extractionStore.activeDocument), not the staged-but-unprocessed
chosenFiles. DocumentNavBar (and the "Move to project" control
beside it) lives INSIDE TransactionsTable now (across its own
top, above the Hide Source Doc button), not here.
-->
<ResizablePanels>
<template #source>
<SourceDocumentPanel
:preview-url="extractionStore.activeDocument?.previewUrl ?? null"
:is-image="extractionStore.activeDocument?.isImage ?? false"
/>
</template>
<template #transactions>
<TransactionsTable />
</template>
</ResizablePanels>
</template> </template>

View File

@ -47,19 +47,26 @@ async function handleGoogle() {
<template> <template>
<main class="login-page"> <main class="login-page">
<div class="card login-card"> <div class="card login-card">
<h2>{{ mode === 'signup' ? 'Create account' : 'Sign in' }}</h2> <h2><i class="fa-solid" :class="mode === 'signup' ? 'fa-user-plus' : 'fa-right-to-bracket'"></i>{{ mode === 'signup' ? 'Create account' : 'Sign in' }}</h2>
<form @submit.prevent="handleSubmit"> <form @submit.prevent="handleSubmit">
<div class="fields"> <div class="fields">
<div> <div>
<label>Email</label> <label>Email</label>
<input v-model="email" type="email" required autocomplete="email"> <div class="input-icon-wrap">
<i class="fa-solid fa-envelope"></i>
<input v-model="email" type="email" required autocomplete="email">
</div>
</div> </div>
<div> <div>
<label>Password</label> <label>Password</label>
<input v-model="password" type="password" required autocomplete="current-password" minlength="8"> <div class="input-icon-wrap">
<i class="fa-solid fa-lock"></i>
<input v-model="password" type="password" required autocomplete="current-password" minlength="8">
</div>
</div> </div>
</div> </div>
<button class="btn btn-primary login-submit" type="submit" :disabled="submitting"> <button class="btn btn-primary login-submit" type="submit" :disabled="submitting">
<i class="fa-solid" :class="submitting ? 'fa-spinner fa-spin' : (mode === 'signup' ? 'fa-user-plus' : 'fa-right-to-bracket')"></i>
{{ submitting ? 'Please wait…' : (mode === 'signup' ? 'Create account' : 'Sign in') }} {{ submitting ? 'Please wait…' : (mode === 'signup' ? 'Create account' : 'Sign in') }}
</button> </button>
</form> </form>