From 3b70abdb9e5b23a6d79ed3e5552163b488e32747 Mon Sep 17 00:00:00 2001 From: le king fu Date: Tue, 14 Apr 2026 15:15:33 -0400 Subject: [PATCH] feat: propagate right-click "add as keyword" to transactions page and highlights list (#75) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wire the ContextMenu + AddKeywordDialog pair onto the remaining per-transaction surfaces. No new business logic — pure composition of #69 / #74 pieces. - HighlightsTopTransactionsList: optional onContextMenuRow prop, ReportsHighlightsPage renders ContextMenu + AddKeywordDialog on right-click - TransactionTable: optional onRowContextMenu prop on each ; TransactionsPage handles it and opens the dialog pre-filled with the row description + current category - Aggregate tables (HighlightsTopMoversTable, ComparePeriodTable, MonthlyTrendsTable, CategoryOverTimeTable) are intentionally NOT wired: they show category / month aggregates, not individual transactions, so there is no keyword to extract from a row — the dialog would be nonsensical there Fixes #75 Co-Authored-By: Claude Opus 4.6 (1M context) --- .../reports/HighlightsTopTransactionsList.tsx | 8 +++- .../transactions/TransactionTable.tsx | 3 ++ src/pages/ReportsHighlightsPage.tsx | 37 +++++++++++++++++- src/pages/TransactionsPage.tsx | 38 ++++++++++++++++++- 4 files changed, 83 insertions(+), 3 deletions(-) diff --git a/src/components/reports/HighlightsTopTransactionsList.tsx b/src/components/reports/HighlightsTopTransactionsList.tsx index 06fe732..07ca79a 100644 --- a/src/components/reports/HighlightsTopTransactionsList.tsx +++ b/src/components/reports/HighlightsTopTransactionsList.tsx @@ -5,6 +5,7 @@ export interface HighlightsTopTransactionsListProps { transactions: RecentTransaction[]; windowDays: 30 | 60 | 90; onWindowChange: (days: 30 | 60 | 90) => void; + onContextMenuRow?: (event: React.MouseEvent, transaction: RecentTransaction) => void; } function formatAmount(amount: number, language: string): string { @@ -18,6 +19,7 @@ export default function HighlightsTopTransactionsList({ transactions, windowDays, onWindowChange, + onContextMenuRow, }: HighlightsTopTransactionsListProps) { const { t, i18n } = useTranslation(); @@ -50,7 +52,11 @@ export default function HighlightsTopTransactionsList({ ) : (