fix(suite): compact amount format in activity notifications - #32191
Conversation
High-precision token amounts overflowed the Activity/notification rows (e.g. 21.96688906034121369 trSHUSDTp). Format transaction notification and toast amounts using the compact style already used by balance lists. Closes #32172
juriczech
left a comment
There was a problem hiding this comment.
This feels like a second cryptoAmountFormatter just for notification 😕
I would either extract the parts that are duplicated by both to some utility so it can be used for both of them or maybe see if we can change how the values are passed into the notifications themselves.
But I guess the biggest reason for the compact notifications formatter was the missing locale. Since it's hardcoded here, why couldn't it be default property of the crypto formatter? I'd prefer that over the duplicity.
Ideally, I think the notifications are doing too much. They should simply send notifications with enough info for the value to be formatted on the platforms using the formatters available with correct locale setup...
|
There is multiple reasons why I had to create this utility function and why are the notification values "different". Let's discuss it on call, it will be faster. |
Description
Use compact formatting for transaction notification amounts.
Notes for QA
<0.00001/<0.01, and large amounts abbreviate withM/B.Related Issue
Resolve #32172
🤖 LLM Test Recommendations
Summary: The changed files touch send form logic (sendFormThunks and useSendForm fixtures), crypto amount formatting (prepareCryptoAmountFormatter and formatCompactNotificationAmount), and account/blockchain synchronization (accountsThunks and blockchainThunks). The recommended set focuses on send flows across the main networks (BTC regtest, EVM, Solana, Doge, LTC), account discovery/creation, custom backend handling, and a staking flow that validates formatted notification amounts. Broad-utility files are not used as a blanket reason to run all mapped tests; only tests that exercise the affected behaviors are selected.
Changed files (9)
packages/suite/src/hooks/wallet/__fixtures__/useSendForm.tssuite-common/formatters/src/formatters/prepareCryptoAmountFormatter.tssuite-common/formatters/src/index.tssuite-common/formatters/src/utils/formatCompactNotificationAmount.test.tssuite-common/formatters/src/utils/formatCompactNotificationAmount.tssuite-common/wallet-core/package.jsonsuite-common/wallet-core/src/accounts/accountsThunks.tssuite-common/wallet-core/src/blockchain/blockchainThunks.tssuite-common/wallet-core/src/send/sendFormThunks.tsRecommended tests (12)
🔴 High priority (9)
suite/e2e/tests/settings/coins-custom-backend.test.ts— Directly exercises custom backend configuration, WebSocket client connections, discovery completion, and account loading. Changes to blockchainThunks and accountsThunks can affect backend sync and discovery state, making this a strong end-to-end check.suite/e2e/tests/staking/eth/initial-stake.test.ts— Asserts formatted staking amounts in device prompts, dashboard pending amounts, and the success toast amount. Changes to prepareCryptoAmountFormatter or formatCompactNotificationAmount could alter these displayed values and the toast notification.suite/e2e/tests/wallet/add-account-types.test.ts— Creates accounts for multiple coins (BTC, LTC, ETH, Base, ADA) and verifies account creation analytics with derivation paths. The accountsThunks changes are directly on the account creation path.suite/e2e/tests/wallet/discovery.test.ts— Activates eight coins, verifies discovery completes, and checks resilience after a page reload. blockchainThunks and accountsThunks are central to discovery and account state, so regressions here would be visible.suite/e2e/tests/wallet/pending-transactions.test.ts— Broadcasts multi-output Bitcoin regtest transactions and validates pending/confirmed transaction grouping. sendFormThunks and the useSendForm fixtures affect how outputs are built and broadcast.suite/e2e/tests/wallet/send-doge.test.ts— Fills the send form with a large DOGE amount and verifies device prompt amount formatting plus the sign-tx error toast. sendFormThunks, the amount formatter, and the send-form fixture changes all directly influence this flow.suite/e2e/tests/wallet/send-eth.test.ts— Uses custom Ethereum fees and verifies send amount, max fee, and fee breakdown formatting in device prompts. sendFormThunks and prepareCryptoAmountFormatter are core to this path.suite/e2e/tests/wallet/send-form-regtest.test.ts— Exercises add/remove outputs, locktime, OP_RETURN, and BTC/sat unit switching in the send form. This is the most direct coverage of sendFormThunks and the changed useSendForm fixtures.suite/e2e/tests/wallet/send-sol.test.ts— Tests Solana Send Max calculation, rent/reserve handling, and amount/fee formatting. sendFormThunks and crypto amount formatter changes can affect the computed max amount and displayed fees.🟡 Medium priority (3)
suite/e2e/tests/wallet/blockbook-discovery.test.ts— Discovers accounts using custom Blockbook backends for BTC and LTC. Relevant to blockchainThunks backend/discovery changes, though partially overlapped by coins-custom-backend.suite/e2e/tests/wallet/import-btc-csv.test.ts— Populates send form outputs from a CSV file, including amount and label fields. sendFormThunks and the send-form fixture changes could affect output parsing and rendering.suite/e2e/tests/wallet/send-form-ltc.test.ts— Sends LTC spending a MimbleWimble peg-out output via a custom blockbook backend. Covers both send form logic and blockchain backend integration without duplicating the BTC/EVM/SOL high-priority set.suite-common/formatters/src/index.tssuite-common/formatters/src/utils/formatCompactNotificationAmount.test.tssuite-common/wallet-core/package.jsonUpdated: 2026-09-07T15:26:48.749Z
🌐 Preview deployments
🌐 Suite Web preview: https://dev.suite.sldev.cz/suite-web/fix/activity-compact-amount-32172/web/
🔍 Currents Test Results
🔍 Suite web test results: View in Currents
🔍 Suite native android test results: View in Currents
🔒 Quarantined E2E Tests
Trezor Suite (web) — 3 test(s)
Updated: 2026-09-07T15:27:58.276Z • 3 test(s) total