Skip to content

fix: scope hide-balances to the home screen - #615

Merged
quantusbot merged 1 commit into
mainfrom
fix/hide-balances-home-only
Aug 21, 2026
Merged

fix: scope hide-balances to the home screen#615
quantusbot merged 1 commit into
mainfrom
fix/hide-balances-home-only

Conversation

@n13

@n13 n13 commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Problem

isBalanceHiddenProvider was read inside the amount formatters — balanceDisplayProvider and txAmountDisplayProvider in currency_display_provider.dart. Every screen that formats an amount goes through that provider, so the eye toggle on home masked amounts that have nothing to do with the account balance:

  • multisig open proposals (ProposalListTile) and decoded calls in the approve/execute/cancel confirm sheets
  • POS charge + QR screens
  • send input amount, review send
  • transaction detail sheet

Change

The formatter no longer has any notion of hidden balances. The home screen owns the flag and passes it explicitly to the components it contains:

  • AmountDisplayWithConversion.isHidden → masks the main balance
  • ActivitySection.isHidden / MultisigActivitySection.isHidden → masks the amounts in the home transaction list

Everything else formats amounts normally, always. Open multisig proposals are not masked even on a multisig home — they are pending decisions to review, not balance disclosure.

The toggle itself still persists via SettingsService; only the home screen reads it now.

DRY

  • txItemAmountText(data, format, {isHidden}) in tx_item.dart replaces three copies of the hideAmount ? '—' : format(...).primaryAmount ternary (home, multisig, activity screen)
  • the formatter's inline function type is now a TxAmountFormatter typedef
  • customHiddenText is gone — its only caller passed the same '-----' the default already used; the placeholder now lives once, next to the component that renders it
  • _toFiatDisplayState lost two parameters and its post-hoc mutation, so it just builds and returns the state

Verification

  • dart analyze lib test in mobile-app: no issues
  • flutter test in mobile-app: 291 tests pass
  • melos run format clean

(melos run analyze can't complete locally — it dies in flutter pub get on a firebase_messaging plugin rsync error unrelated to this change.)

The hidden-balance flag was read inside the amount formatters
(balanceDisplayProvider / txAmountDisplayProvider), so toggling the eye on
home masked every amount in the app: multisig proposals and decoded calls,
POS charge screens, the send/review flow and transaction details.

Formatting no longer knows about hidden balances. The home screen owns the
flag and passes it explicitly to the components it contains: the main balance
(AmountDisplayWithConversion.isHidden) and its transaction list
(ActivitySection / MultisigActivitySection.isHidden). Open multisig proposals
stay visible — they are pending decisions, not balance disclosure.

Row amount text is now built by one shared helper (txItemAmountText) used by
the home, multisig and activity lists instead of three copies of the same
hideAmount ternary; the formatter's function type is a TxAmountFormatter
typedef, and the redundant customHiddenText parameter is gone.

@dewabisma dewabisma left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Make sense to only hide in home. Just wondering if user ever want show activity history screen with balance hidden? Maybe not.

LGTM!

@quantusbot
quantusbot merged commit a4782ee into main Aug 21, 2026
1 check passed
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.

3 participants