fix: show balances and fees below 0.000001 ETH as nonzero on the send screens (closes #343)
check / check (push) Successful in 2m18s
e2e / e2e-chrome (push) Successful in 3m37s
e2e / e2e-firefox (push) Successful in 3m13s

The stored ETH balance and the send-confirm screen's fee were each cut to six
decimal places, so a value below 0.000001 read as 0.0. The ETH balance is now
stored exactly, and the send and send-confirm screens' balances, reserve and
insufficient-balance messages go through truncateAmountNeverZero(). Both the
send-confirm and approval screens render the fee through formatFee(), which
prices the exact fee in USD, so the same fee reads the same on both. Token
balances keep their six-decimal value: it also leaves dust off the balance
list, and keeps the string within the 18 decimals the balance check reads.

Model: opus-5-5
This commit is contained in:
2026-10-04 03:08:32 +00:00
committed by sneak
parent 5f54fcbb24
commit 72f1eb7217
10 changed files with 392 additions and 70 deletions
+14
View File
@@ -45,6 +45,20 @@ but the review is broader than any of them.
# Completed Steps
- 2026-10-04: The Send and confirmation screens no longer show an ETH balance or
a network fee below 0.000001 as `0.0`
([#343](https://git.eeqj.de/sneak/AutistMask/issues/343)). The stored ETH
balance (`src/shared/balances.js`) and the confirmation screen's fee were each
cut to six decimal places by a rule of their own. The ETH balance is now
stored exactly, and the Send screen's `Current balance`, and the confirmation
screen's balance, fee, reserve and insufficient-balance messages, go through
`truncateAmountNeverZero()` in `src/shared/amountDisplay.js`, the helper the
approval screen already used. The confirmation and approval screens both
render the fee through `formatFee()` in `src/popup/views/helpers.js`, which
prices the exact fee in USD, so the same fee reads the same on both, USD value
included. Token balances are still stored to six decimal places: that cut is
also what leaves a holding below 0.000001 off the balance list, and keeps the
stored string within the 18 decimals the balance check reads.
- 2026-10-04: Removing an address or deleting a wallet ends every site
connection approved without "Remember" for the addresses removed
([#245](https://git.eeqj.de/sneak/AutistMask/issues/245)). Such a connection