diff --git a/CLAUDE.md b/CLAUDE.md index 455da55..1eb9958 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -2614,6 +2614,35 @@ library two independent users' matching mappings promote into automatically, or a real PocketBase superuser can push there directly after reviewing it against the actual source document. +**"Show on source" extended to every row's own click, not just the flag panel's +dedicated button, 2026-10-30.** Previously this highlight (R.1's `source_bbox`/ +`showHighlight`, R.2's "Show on source" button) was only reachable by opening a +flagged row's flag-detail panel first - an unflagged row (the common case on most +statements) had no way to see its own position on the source document at all. +`TransactionRow.vue` now calls the same `showOnSource()` on a click anywhere in the +row OUTSIDE its own `.row-actions` cell (`handleRowClick`) - clicking Edit/Save/ +Cancel/the flag toggle/the "more actions" menu all keep their exact existing +behavior, since those live inside `.row-actions` and are excluded by that same +check. A no-op for a row with no real `source_bbox` (an OCR-sourced row), same as +the existing button's own `disabled` state. `tr.has-position td:not(.row-actions)` +(`main.css`) gives the clickable area `cursor:pointer` plus a `title` tooltip. + +Deliberately did NOT touch `toggleFlags()`'s own `uiStore.clearHighlightRequest()` +call (fires when the flag-detail panel closes) - that click originates on the +flag-toggle button, which lives inside `.row-actions`, so `handleRowClick`'s guard +already excludes it; the two behaviors don't collide. + +Verified: `npm run build` passes; the built bundle confirmed to contain the new +`has-position`/`handleRowClick`-driven title string (`"Click to highlight this row +on the source document"`); the `app` container rebuilt and the new bundle confirmed +served at `/`. No backend Python was touched - this is pure frontend presentation +over position data R.1 already captures - so `backend/measure.py` doesn't apply +(the standing per-stage rule only covers changes to `table_extract.py`/ +`extraction_service.py`/`pipeline_service.py`); `git status` confirms the only +files touched are `TransactionRow.vue` and `main.css`. **Not machine-verified:** +the actual click-through in a real browser - same standing limitation as every +other UI-only change this project. + **Governing rule: never silently correct or exclude data.** This shows up in several 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 @@ -2982,12 +3011,21 @@ restructure; the behavior itself predates it and is unchanged: nothing re-measured the textarea height when that happened (only an actual edit/save did) — now `uiStore.layoutVersion` bumps on that toggle (and on a resize-drag ending) and every row's own textarea watches it to re-measure. +- **Every row, not just a flagged one, highlights its own printed position on the + source document when clicked (added 2026-10-30)** - clicking anywhere in a + `TransactionRow` outside its own action buttons (`handleRowClick`, which excludes + `.row-actions` so Edit/Save/Cancel/the flag toggle/the "more actions" menu all keep + their existing behavior untouched) calls the same `showOnSource()` the flag panel's + dedicated button already called - one definition either path uses. A no-op for a + row with no real `source_bbox` (an OCR-sourced row). `tr.has-position td:not(.row- + actions)` gets `cursor:pointer` plus a `title` tooltip as the visual affordance. - A flagged row (added 2026-10-13, review screen R.2) gets its own amber flag-icon toggle in the row-actions cell, opening a second table row beneath it with a plain-language explanation for every check that flagged it (what/why/what-to-do - - `flagCatalogService.js`) and a "Show on source" button that boxes the row's own - printed position on the source document (disabled when no position data exists for - that row - see R.1's `source_bbox`). `TransactionsTable.vue`'s own header gets + `flagCatalogService.js`) and its OWN "Show on source" button (same highlight, now + one of two ways to trigger it) that boxes the row's own printed position on the + source document (disabled when no position data exists for that row - see R.1's + `source_bbox`). `TransactionsTable.vue`'s own header gets "Flagged only" (filters the table to just flagged rows) and "Next flagged" (cycles through flagged rows, scrolling each into view) once anything is actually flagged. A `running_balance`-flagged row may also show a suggested fix (added 2026-10-13, diff --git a/frontend/src/assets/main.css b/frontend/src/assets/main.css index 424a560..029261c 100644 --- a/frontend/src/assets/main.css +++ b/frontend/src/assets/main.css @@ -214,6 +214,13 @@ td.amt, th.amt{ text-align:right; font-family:var(--fm); } tr.flagged td{ background:rgba(217,119,6,.08); } tr.flagged td:first-child{ border-left:2px solid var(--amber); } +/* A row with real source position data highlights on the source + document when clicked anywhere outside its own action buttons + (TransactionRow.vue's handleRowClick, which excludes .row-actions) - + cursor:pointer signals that on every OTHER cell, not the actions one, + which already has its own per-button pointer cursor. */ +tr.has-position td:not(.row-actions){ cursor:pointer; } + /* Sort arrows sit inline next to each sortable header's own label - a muted up/down pair that turns the accent blue for whichever column + direction is currently active, rather than a single toggle arrow, so diff --git a/frontend/src/components/TransactionRow.vue b/frontend/src/components/TransactionRow.vue index b14c294..9e334bd 100644 --- a/frontend/src/components/TransactionRow.vue +++ b/frontend/src/components/TransactionRow.vue @@ -14,6 +14,12 @@ * SourceDocumentPanel are siblings three-deep apart, not ancestor/ * descendant). * + * Every row - flagged or not - also highlights on the source document + * the moment it's clicked anywhere outside its own action buttons + * (handleRowClick, below), not just via the flag panel's dedicated + * button - the same showOnSource() either path calls, so there's one + * definition of "what highlighting this row means," not two. + * * A running_balance-flagged row may also carry a suggested fix * (suggested_fixes_service.py, embedded in currentResult.suggestions) - * shown in the same expanded panel with its own evidence and an "Apply @@ -97,6 +103,12 @@ function showOnSource() { uiStore.requestHighlight(props.transaction.source_page, props.transaction.source_bbox) } } +const hasPosition = computed(() => !!props.transaction.source_bbox) +/** Clicking anywhere in the row except its own action buttons (edit/save/cancel/flag/more-menu, all inside .row-actions) highlights this row's position on the source document - a plain no-op when there's none (e.g. an OCR-sourced row). Deliberately NOT filtered on isEditing - seeing the source while mid-edit is useful, not disruptive. */ +function handleRowClick(event) { + if (event.target.closest('.row-actions')) return + showOnSource() +} // ── Suggested fix (review screen R.3) ─────────────────────────────── // Matched by flag_index (the row running_balance's own mismatch is @@ -266,7 +278,12 @@ async function confirmDeleteRow() {