diff --git a/CLAUDE.md b/CLAUDE.md
index 8aa4348..44fb7de 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -616,7 +616,33 @@ restructure; the behavior itself predates it and is unchanged:
"not_available" (its detail — "No opening and/or closing balance available..." — already
reads as a complete sentence) — both outcomes used to leave the readout silently grey with
no explanation; "not_available"'s case was only noticed and fixed 2026-10-12, after "fail"
- already had it.
+ already had it. On wide viewports the button is wrapped in `.recheck-wrap` with an
+ invisible `.recheck-spacer` label above it mirroring `.fields label`'s own box (same
+ font-size/margin-bottom) — this is what lines the button's top edge up with the balance
+ inputs' own top edge rather than the row's labels, without a hardcoded pixel offset that
+ would drift if the label style ever changes. The spacer is hidden at the 640px mobile
+ breakpoint, where the button drops below the fields instead (see above).
+- Sort + filter/search on the transactions table (`TransactionsTable.vue` +
+ `useTransactionFilters.js`, added 2026-10-12) — purely client-side display state, no
+ backend involvement, same scope as `useImageZoom.js`. Each sortable header (Date,
+ Description, Amount, Balance, Status) gets its own up/down arrow pair
+ (`.sort-arrows`/`.sort-arrow`) rather than one toggle arrow, so both directions stay
+ visible; the active column+direction turns blue. A second `
`
+ sits inside ``, directly beneath the header row (so it inherits the same
+ `colgroup` widths via `table-layout:fixed`) — free-text filter inputs per column
+ (Description's doubles as the search box), Status as an exact-match ``
+ populated from whatever statuses are actually present (never offers one the statement
+ doesn't have), and a small × button in the corner cell to clear every filter at once
+ (only rendered while a filter is active). Filtering to zero rows shows a
+ "No transactions match the current filters" row instead of an empty table.
+ **The one thing that had to be gotten right:** `TransactionRow`/`useRowEditing` read and
+ write `currentResult.transactions` by its own ORIGINAL index, not by position in
+ whatever's currently displayed — so `visibleRows` is a list of `{index, transaction}`
+ pairs (original index preserved through both the filter and the sort), never a plain
+ re-ordered array, or editing/flagging would silently target the wrong row the moment a
+ sort or filter was active. Confirmed correct by executing the real composable directly
+ (not just reading it): sorted/filtered a 3-row fixture several ways and checked the
+ original index stayed attached to the right transaction through every case.
- Per-row edit lock (`TransactionRow.vue`/`useRowEditing.js`): cells are read-only until
that row's pencil icon is clicked (pencil rendered in the blue accent color, fixed
2026-10-11 — it was the default muted gray, inconsistent with the Save button's own blue);
diff --git a/frontend/src/assets/main.css b/frontend/src/assets/main.css
index e6357de..56326a3 100644
--- a/frontend/src/assets/main.css
+++ b/frontend/src/assets/main.css
@@ -75,6 +75,12 @@ h1{ font-family:var(--fd); font-weight:800; font-size:30px; letter-spacing:-.01e
field on narrow viewports - see the mobile breakpoint below. */
.fields-row{ display:flex; align-items:flex-start; gap:16px; margin-bottom:16px; }
.fields-row .fields{ flex:1 1 auto; min-width:0; margin-bottom:0; }
+/* .recheck-spacer mirrors .fields label's own box (same font-size/
+ margin-bottom) invisibly, so the button below it starts at exactly the
+ same y as the balance inputs - aligned with the closing-balance field,
+ not the row's top edge (where the labels sit). */
+.recheck-wrap{ display:flex; flex-direction:column; flex-shrink:0; }
+.recheck-spacer{ font-size:11.5px; line-height:1; margin-bottom:6px; visibility:hidden; }
.btn-recheck{ flex-shrink:0; white-space:nowrap; }
.fields{ display:flex; flex-wrap:wrap; gap:16px; }
.fields > div{ flex:1 1 180px; min-width:160px; }
@@ -164,6 +170,36 @@ 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); }
+/* 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
+ both directions are always visibly available, not just the active one. */
+.sort-arrows{ display:inline-flex; flex-direction:column; vertical-align:middle; margin-left:4px; gap:1px; }
+.sort-arrow{
+ background:transparent; border:none; cursor:pointer; padding:0; margin:0; font-size:6px;
+ line-height:1; color:var(--border-b);
+}
+.sort-arrow:hover{ color:var(--blue); }
+.sort-arrow.active{ color:var(--blue); }
+
+/* Filter row sits directly beneath the header row, one input per column
+ (Description's doubles as a free-text search) - same colgroup widths
+ apply automatically since the table is table-layout:fixed. */
+.filter-row th{ padding:6px 8px 10px; text-transform:none; font-weight:400; }
+.filter-input{
+ width:100%; padding:5px 7px; background:var(--navy); border:1px solid var(--border-2);
+ border-radius:6px; font-size:11.5px; color:var(--t1); font-family:var(--fb); outline:none;
+ transition:border-color .2s;
+}
+.filter-input:focus{ border-color:var(--blue); }
+.filter-select{ cursor:pointer; }
+.clear-filters-btn{
+ background:transparent; border:none; cursor:pointer; color:var(--t4); font-size:12px;
+ padding:4px; line-height:1; border-radius:5px;
+}
+.clear-filters-btn:hover{ color:var(--red); background:rgba(16,24,40,.06); }
+.no-rows-note{ text-align:center; color:var(--t4); padding:20px 10px; white-space:normal; }
+
.cell-input{
width:100%; background:transparent; border:1px solid transparent; border-radius:5px;
padding:6px 6px; font:inherit; color:inherit; text-align:inherit; font-family:inherit;
@@ -321,5 +357,6 @@ tr.editing td{ background:rgba(37,99,235,.03); }
by side, so this is its own, narrower cutoff. */
@media (max-width: 640px){
.fields-row{ flex-direction:column; align-items:stretch; }
+ .recheck-spacer{ display:none; }
.btn-recheck{ align-self:flex-end; }
}
diff --git a/frontend/src/components/TransactionsTable.vue b/frontend/src/components/TransactionsTable.vue
index 500ee6a..dd44482 100644
--- a/frontend/src/components/TransactionsTable.vue
+++ b/frontend/src/components/TransactionsTable.vue
@@ -24,12 +24,16 @@ import { useExtractionStore } from '../stores/extractionStore'
import { useUiStore } from '../stores/uiStore'
import { fmtMoney } from '../services/formatService'
import * as extractionService from '../services/extractionService'
+import { useTransactionFilters } from '../composables/useTransactionFilters'
import TransactionRow from './TransactionRow.vue'
const extractionStore = useExtractionStore()
const uiStore = useUiStore()
const result = computed(() => extractionStore.currentResult)
+const transactions = computed(() => result.value?.transactions || [])
+const { sortKey, sortDir, setSort, filters, clearFilters, hasActiveFilters, statusOptions, visibleRows } =
+ useTransactionFilters(transactions)
const balanceCheck = computed(() => result.value?.checks?.find((c) => c.name === 'statement_balance'))
const balanceMatches = computed(() => balanceCheck.value?.outcome === 'pass')
@@ -111,9 +115,12 @@ async function handleRecheck() {
{{ closingCalcText }}
-
- {{ rechecking ? 'Checking…' : 'Recheck Balance' }}
-
+
+
+
+ {{ rechecking ? 'Checking…' : 'Recheck Balance' }}
+
+
{{ balanceMismatchPrefix }}{{ balanceMismatchText }}
This statement format may not print a clean opening/closing balance — enter them here to run the full statement balance check; otherwise it's marked "not available" rather than guessed.
@@ -135,20 +142,68 @@ async function handleRecheck() {
- Date
- Description
- Amount
- Balance
- Status
+
+ Date
+
+ ▲
+ ▼
+
+
+
+ Description
+
+ ▲
+ ▼
+
+
+
+ Amount
+
+ ▲
+ ▼
+
+
+
+ Balance
+
+ ▲
+ ▼
+
+
+
+ Status
+
+ ▲
+ ▼
+
+
+
+
+
+ ✕
+
+
+
+
+
+
+
+ All
+ {{ s }}
+
+
+
+ No transactions match the current filters.
+
diff --git a/frontend/src/composables/useTransactionFilters.js b/frontend/src/composables/useTransactionFilters.js
new file mode 100644
index 0000000..c8b0f43
--- /dev/null
+++ b/frontend/src/composables/useTransactionFilters.js
@@ -0,0 +1,76 @@
+/**
+ * Client-side sort + per-column filter/search over the transactions table.
+ * Pure UI state, no service calls - mirrors useImageZoom.js's own scope.
+ *
+ * Operates on {index, transaction} pairs rather than the transaction list
+ * directly, and always returns the ORIGINAL index (position in
+ * currentResult.transactions) alongside each visible row - TransactionRow
+ * reads/writes the store by that index, so sorting or filtering the
+ * DISPLAY order must never change which index a row actually points to.
+ */
+import { ref, computed } from 'vue'
+
+const FILTERABLE_FIELDS = ['date', 'description', 'amount', 'balance', 'status']
+
+function compareValues(a, b, key) {
+ if (key === 'amount' || key === 'balance') {
+ return (a ?? 0) - (b ?? 0)
+ }
+ if (key === 'date') {
+ const at = Date.parse(a)
+ const bt = Date.parse(b)
+ if (!Number.isNaN(at) && !Number.isNaN(bt)) return at - bt
+ }
+ return String(a ?? '').localeCompare(String(b ?? ''))
+}
+
+export function useTransactionFilters(transactionsRef) {
+ const sortKey = ref(null)
+ const sortDir = ref('asc')
+ const filters = ref({ date: '', description: '', amount: '', balance: '', status: '' })
+
+ function setSort(key, dir) {
+ sortKey.value = key
+ sortDir.value = dir
+ }
+
+ function clearFilters() {
+ filters.value = { date: '', description: '', amount: '', balance: '', status: '' }
+ }
+
+ const hasActiveFilters = computed(() => Object.values(filters.value).some((v) => v !== ''))
+
+ // Status is filtered via an exact-match dropdown (a small enum), not free
+ // text like the other columns - populated from whatever values are
+ // actually present, so it never offers a status this statement doesn't have.
+ const statusOptions = computed(() => {
+ const seen = new Set()
+ for (const t of transactionsRef.value || []) {
+ if (t.status) seen.add(t.status)
+ }
+ return [...seen].sort()
+ })
+
+ const visibleRows = computed(() => {
+ let rows = (transactionsRef.value || []).map((transaction, index) => ({ transaction, index }))
+
+ rows = rows.filter(({ transaction }) =>
+ FILTERABLE_FIELDS.every((key) => {
+ const filterValue = filters.value[key]
+ if (!filterValue) return true
+ if (key === 'status') return transaction.status === filterValue
+ return String(transaction[key] ?? '').toLowerCase().includes(filterValue.toLowerCase())
+ }),
+ )
+
+ if (sortKey.value) {
+ const dir = sortDir.value === 'asc' ? 1 : -1
+ const key = sortKey.value
+ rows = [...rows].sort((a, b) => compareValues(a.transaction[key], b.transaction[key], key) * dir)
+ }
+
+ return rows
+ })
+
+ return { sortKey, sortDir, setSort, filters, clearFilters, hasActiveFilters, statusOptions, visibleRows }
+}