From 461b399d74fee80e20d1a437c03162f22ffb8a7e Mon Sep 17 00:00:00 2001 From: JasonFraser Date: Tue, 13 Oct 2026 09:13:17 -0400 Subject: [PATCH] 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 --- CLAUDE.md | 205 +++++++++++++++--- frontend/src/assets/main.css | 129 ++++++++--- frontend/src/components/ConfirmModal.vue | 37 ++-- frontend/src/components/DocumentNavBar.vue | 100 ++++++++- .../src/components/DocumentOptionsModal.vue | 72 ++++++ .../src/components/DownloadChoiceModal.vue | 49 +++++ frontend/src/components/FileUploadZone.vue | 6 +- frontend/src/components/ResultCard.vue | 165 -------------- frontend/src/components/TransactionsTable.vue | 192 +++++++++++++++- .../src/composables/useBatchExtraction.js | 2 +- frontend/src/composables/useModalFocus.js | 18 ++ frontend/src/services/documentsService.js | 11 +- frontend/src/stores/extractionStore.js | 26 ++- frontend/src/stores/uiStore.js | 13 +- frontend/src/views/ExtractorView.vue | 9 +- 15 files changed, 755 insertions(+), 279 deletions(-) create mode 100644 frontend/src/components/DocumentOptionsModal.vue create mode 100644 frontend/src/components/DownloadChoiceModal.vue delete mode 100644 frontend/src/components/ResultCard.vue create mode 100644 frontend/src/composables/useModalFocus.js diff --git a/CLAUDE.md b/CLAUDE.md index 0dc9646..a8ee1fc 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -319,8 +319,18 @@ security only, not the full SaaS-shaped doc — and the judgment call on what co `setActiveDocumentProject(projectId)` (added for Stage B.3) updates just the active document entry's `project` field locally after a successful "Move to project" call, rather - than reloading the whole list. - uiStore.js — resultExpanded, pdfColHidden, pdfColWidthPct, + than reloading the whole list. `setActiveDocumentFileName`/ + `removeDocument(pbId)` (NEW 2026-10-13, for + DocumentNavBar's rename/delete) - `removeDocument` also + re-settles `activeIndex` to keep pointing at the right + document after a splice, see "Document delete/rename..." + under Key decisions & lessons for the exact rules. + uiStore.js — `resultsOpen`/`toggleResultsOpen()`/`closeResultsOpen()` + (renamed from `resultExpanded`/`toggleResultExpanded` - + 2026-10-13, now drives TransactionsTable's own Results + dropdown, kept in the store rather than a component-local + ref so useBatchExtraction.js can still reset it closed + after every fresh extraction), pdfColHidden, pdfColWidthPct, layoutVersion (an incrementing counter every TransactionRow's own description textarea watches to re-measure its height - replaces the original's global @@ -383,33 +393,45 @@ security only, not the full SaaS-shaped doc — and the judgment call on what co composable just prefixes its text with "Extracting N/M: filename —"), useRowEditing (saveEdit() now calls `documentsService.updateDocument`, best-effort), useImageZoom, - useAutoGrow + useAutoGrow, useModalFocus (NEW 2026-10-13 — shared by every + modal component below: focuses the overlay the instant it + becomes visible, so Esc closes it immediately) /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 + (the active document's filename — click to rename/delete + it via DocumentOptionsModal below — plus prev/next; renders + for ANY loaded document as of 2026-10-13, not just once + there's more than one, so delete is reachable with just one + document loaded), ProjectSidebar (the app's primary left nav as of 2026-10-13 — project 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"), - ConfirmModal (NEW 2026-10-13 — generic confirm/cancel - dialog over a dimmed backdrop; built for "Move to project" - but reusable elsewhere), ProcessingIndicator, ResultCard - (Download + Download All, best-effort persists the export - to R2 via `documentsService.saveExportFile`), - SourceDocumentPanel, TransactionsTable (now also hosts the - "Move to project" select + its ConfirmModal, see "Move to - project confirm modal" under Key decisions & lessons), - TransactionRow, ResizablePanels. `RestoreBanner` - was removed in Stage B.2 (see Key decisions & lessons) — - PocketBase being the real backend left no ambiguity for it - to explain. Every button/nav icon site-wide uses - FontAwesome solid icons now (`@fortawesome/fontawesome-free`) - in place of the original vanilla-JS build's unicode - entities (✎/✓/✕/←/→/▶/−/▲▼). + ConfirmModal (generic confirm/cancel dialog over a dimmed + backdrop; `danger`/`busy` props added 2026-10-13 for the + delete-document flow — red confirm button, stays open with + a spinner mid-request), DocumentOptionsModal (NEW + 2026-10-13 — inline rename + hands off to a second + ConfirmModal for delete), DownloadChoiceModal (NEW + 2026-10-13 — "current document" vs. "all N documents", + replacing a separate always-visible Download All button), + ProcessingIndicator, SourceDocumentPanel, TransactionsTable + (now also hosts its own top bar — a Results dropdown, + DocumentNavBar, and the Download button; this is + ResultCard.vue's old content, merged in and that file + deleted outright, 2026-10-13 — see "Document delete/ + rename..." under Key decisions & lessons — plus the "Move + to project" select + its own ConfirmModal), TransactionRow, + ResizablePanels. `RestoreBanner` was removed in Stage B.2 + (see Key decisions & lessons) — PocketBase being the real + backend left no ambiguity for it to explain. Every button/ + nav icon site-wide uses FontAwesome solid icons + (`@fortawesome/fontawesome-free`) in place of the original + vanilla-JS build's unicode entities. /views/ExtractorView.vue — the extraction page itself: upload, result, document navigation, side-by-side review. No longer owns a page-level layout wrapper or ProjectSidebar (both moved up to App.vue's @@ -1082,6 +1104,115 @@ touched). **Not machine-verified:** the actual modal interaction (open/confirm/c Esc/backdrop-click, the dropdown correctly reverting on cancel) - same standing limitation as every other UI change this session, Claude-in-Chrome did not connect. +**Document delete/rename, consistent button heights, Download-choice modal, and +ResultCard merged into TransactionsTable's top bar - all 2026-10-13, one combined +request.** Five distinct asks landed together: + +1. **A way to delete a loaded document before downloading it**, with "a better visual + UI clue that it's possible." `DocumentNavBar.vue`'s filename is a real `