feat: filter transactions#2464
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds transaction filtering by minimum amount and failed-payment visibility across the service, API, HTTP and Wails handlers, and frontend transaction list UI. Filter state is now managed in the wallet screens and passed through the menu, hook, and list components. ChangesTransaction Filtering End-to-End
Sequence Diagram(s)sequenceDiagram
participant User
participant TransactionsListMenu
participant Lightning_or_AppTransactionList as Lightning / AppTransactionList
participant useTransactions
participant HTTPHandler as listTransactionsHandler
participant TransactionsService
User->>TransactionsListMenu: Select minimum amount or toggle failed payments
TransactionsListMenu->>Lightning_or_AppTransactionList: onFiltersChange(updatedFilters)
Lightning_or_AppTransactionList->>useTransactions: render with filters
useTransactions->>HTTPHandler: GET /api/transactions?minAmountSat=X&showFailed=false
HTTPHandler->>TransactionsService: ListTransactions(..., ListTransactionsFilter)
TransactionsService-->>HTTPHandler: filtered rows
HTTPHandler-->>useTransactions: response data
useTransactions-->>Lightning_or_AppTransactionList: updated list
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@http/http_service.go`:
- Around line 771-775: In the minAmountSatParam parsing block, after
successfully parsing the query parameter into parsedMinAmountSat using
strconv.ParseUint, add an upper-bound validation check to ensure the parsed
value does not exceed a reasonable maximum threshold before performing the
multiplication by 1000 to convert to minAmountMsat. Only assign the converted
value to filters.MinAmountMsat if the value passes both the existing
greater-than-zero check and the new upper-bound guard, otherwise skip the
assignment to reject oversized user inputs.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f285392e-7341-4828-8cd3-90931bb6cf54
📒 Files selected for processing (10)
api/models.goapi/transactions.gofrontend/src/components/TransactionsList.tsxfrontend/src/components/TransactionsListMenu.tsxfrontend/src/components/connections/AppTransactionList.tsxfrontend/src/hooks/useTransactions.tsfrontend/src/screens/wallet/Lightning.tsxhttp/http_service.gotransactions/list_transactions_test.gotransactions/transactions_service.go
|
I haven't reviewed it yet, but thanks for the PR! I also added another idea which would be useful is to be able to search by keyword. |
Okay should I proceed with the search by keyword implementation? |
Description
Adds basic transaction list filtering.
This adds backend-supported filters for:
The filters are applied before counting and pagination, so filtered transaction totals and pages stay correct.
The frontend exposes these filters inside the existing transaction list menu to avoid adding extra clutter to the wallet screen.
Fixes #2463.
Summary by CodeRabbit