diff --git a/CLAUDE.md b/CLAUDE.md index 4f78942..2553d29 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -749,6 +749,18 @@ restructure; the behavior itself predates it and is unchanged: Transactions table, the Source Document preview, and the visible document name together as one unit - all three read `extractionStore.activeDocument`/`activeIndex`, so `DocumentNavBar` is the only component that needs to know navigation exists at all. + Picking/dropping ADDS to the staged list (`useFileUpload.js`'s `chosenFiles`) rather + than replacing it (fixed 2026-10-13 - the first version replaced it, so picking a + second file after a first lost the first entirely, reported by the user as "I select + one document and start again to select another, the first one is replaced") - a batch + can be built up across several separate picks/drops, not just one multi-select dialog. + Each staged file shows with an × to remove it before Extract is ever clicked + (`FileUploadZone.vue`'s `.staged-files` list); an exact duplicate (same name+size as + something already staged) is silently skipped rather than appearing twice. The staging + list is cleared the moment Extract is clicked (not after the batch finishes) so an + already-handed-off file can't sit there and get accidentally re-processed (and + duplicated in `extractionStore.documents`, which has no dedup of its own) by a later + click. - PDF/image ("Source Document") and Transactions sit side-by-side with a draggable resizer (`ResizablePanels.vue`, the handle styled as a vertical grip-knob), both wrapped in one sticky flex row so they scroll as one unit (not the source-doc column alone). `.txn-col` diff --git a/frontend/src/assets/main.css b/frontend/src/assets/main.css index 4f64bdf..3679462 100644 --- a/frontend/src/assets/main.css +++ b/frontend/src/assets/main.css @@ -66,7 +66,18 @@ h1{ font-family:var(--fd); font-weight:800; font-size:30px; letter-spacing:-.01e .file-zone-label{ font-size:13.5px; color:var(--t2); } .file-zone-label strong{ color:var(--blue); font-weight:600; } .file-zone-sub{ font-size:11.5px; color:var(--t4); margin-top:5px; } -.file-zone-sub.file-chosen-name{ font-family:var(--fm); font-size:12px; color:var(--blue); margin-top:5px; } + +.staged-files{ list-style:none; margin:0 0 14px; padding:0; display:flex; flex-direction:column; gap:6px; } +.staged-files li{ + 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; +} +.staged-file-name{ font-family:var(--fm); font-size:12px; color:var(--t1); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; } +.staged-file-remove{ + background:transparent; border:none; cursor:pointer; color:var(--t4); font-size:11px; + padding:4px 6px; border-radius:5px; flex-shrink:0; line-height:1; +} +.staged-file-remove:hover{ color:var(--red); background:rgba(16,24,40,.06); } /* .fields-row pairs the balance inputs with the Recheck Balance button - the button sits at the row's own right edge, lining up under the diff --git a/frontend/src/components/FileUploadZone.vue b/frontend/src/components/FileUploadZone.vue index 5af84a4..90356fc 100644 --- a/frontend/src/components/FileUploadZone.vue +++ b/frontend/src/components/FileUploadZone.vue @@ -13,24 +13,18 @@ * from ExtractorView (which owns useFileUpload/useBatchExtraction once, * since SourceDocumentPanel also needs the active document's preview). */ -import { computed } from 'vue' import { useExtractionStore } from '../stores/extractionStore' import ProcessingIndicator from './ProcessingIndicator.vue' -const props = defineProps({ +defineProps({ chosenFiles: { type: Array, default: () => [] }, isDragOver: { type: Boolean, default: false }, isProcessing: { type: Boolean, required: true }, phaseText: { type: String, required: true }, }) -const emit = defineEmits(['file-input-change', 'drag-over', 'drag-leave', 'drop', 'extract']) +const emit = defineEmits(['file-input-change', 'drag-over', 'drag-leave', 'drop', 'remove-file', 'extract']) const extractionStore = useExtractionStore() -const fileZoneSubText = computed(() => { - if (!props.chosenFiles.length) return '.pdf, .jpg, or .png files' - if (props.chosenFiles.length === 1) return props.chosenFiles[0].name - return `${props.chosenFiles.length} files selected` -})