Skip to content

Conversation

@NodeDiver
Copy link
Contributor

@NodeDiver NodeDiver commented Nov 28, 2025

Fixes #1939 This PR adds a transaction amount filter to the wallet screen, allowing users to filter transactions by minimum satoshi amounts (10, 100, 1K, 10K, 100K sats).
It will help to filter out zaps or recurrent small transactions from the bigger ones.
I used the AI to help me do it and did a thorough review of everything.

An unintended visualization bug appeared in the first attempt to add the filter, and I had to modify empty states: a generic "No transactions yet" message was incorrectly displayed when a filter returned no results, even though transactions existed. There is a distinction between empty transaction lists and filtered empty states, showing an appropriate message with a "Show All Transactions" button when the chosen filters hide all transactions.

Preview in the video:

2025-11-27.23-14-28.mp4

Note: Commit 174c43a is a duplicate of the already-merged PR #1876 and can be ignored.

const totalCount = transactionData?.totalCount || 0;

const filteredTransactions = minAmountSats
? transactions.filter((tx) => Math.floor(tx.amount / 1000) >= minAmountSats)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should do filtering on the backend otherwise pagination will break

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is why you see the weird behavior too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want me to move the filtering to the backend, I think I can do it, but for next week

<DropdownMenu>
<Button asChild size="icon" variant="secondary">
<DropdownMenuTrigger>
<FilterIcon className="h-4 w-4" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if filtering should be an option in the "..." menu so we don't clutter the interface too much?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a strong opinion about this if it has to be on the 3 dots menu we can place it there.

I also thought that " the least intrusive the better "., Nonetheless, if the filtering is on the 3 dots menu, it is also hidden, and might not even be discovered. That is why I chose to put it on its own button, but just an icon to save some space.

@rolznz rolznz requested a review from im-adithya November 28, 2025 04:40
@rolznz rolznz marked this pull request as draft December 15, 2025 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Filter based on TX amount in main wallet history

2 participants