feat(wallet): cycle balance display between sats, fiat, and hidden#562
Open
dmnyc wants to merge 1 commit into
Open
feat(wallet): cycle balance display between sats, fiat, and hidden#562dmnyc wants to merge 1 commit into
dmnyc wants to merge 1 commit into
Conversation
Ports iOS PR barrydeen/wisp-ios#166 to Android. Tapping the wallet dashboard balance now cycles through three states instead of the prior plain hide/show toggle: 1. SATS — current default rendering ("21,000 sats" or app-wide fiat when [FiatPreferences.isFiatMode] is on). 2. FIAT — wallet-screen-scoped fiat. Renders the balance + each tx row's amount/fee in the user's currently-selected fiat currency without flipping the app-wide fiat-mode flag, so feed sat counts elsewhere stay in sats. 3. HIDDEN — masks the dashboard balance AND every per-row amount + fee in the transaction history, useful for screenshots / shoulder-surfing scenarios. Storage: new per-pubkey key `walletBalanceDisplay_<pubkey>` in the existing `wisp_settings` SharedPreferences. The legacy global `balance_hidden` Bool is read once per pubkey when no per-pubkey entry exists (true → HIDDEN, false → SATS) and then a migrated value is written; legacy key is left in place so older builds rolled back keep their preference. Storage-key format matches iOS, so the cross-platform port doc lives on the iOS side (see PR barrydeen#166). Companion enum `WalletBalanceDisplayMode` carries the `next()` cycle helper and the read/write helpers; both `WalletHomeContent` and the transaction history `TransactionRow` read the same key.
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Android port of iOS feat/wallet-balance-toggle. Tapping the wallet
dashboard balance now cycles through three states instead of the
prior plain hide/show toggle:
the global `FiatPreferences.isFiatMode` flag is on.
tx row's amount/fee in the user's currently-selected fiat currency
without flipping the app-wide flag, so feed sat counts elsewhere
keep showing sats.
shoulder-surfing.
Storage
New per-pubkey key `walletBalanceDisplay_` (matches iOS) in
the existing `wisp_settings` SharedPreferences. The legacy global
`balance_hidden` Bool is read once per pubkey when no per-pubkey
entry exists (true → HIDDEN, false → SATS) and then a migrated value
is written. Legacy key left in place — older builds rolled back keep
their preference.
`WalletBalanceDisplayMode` enum exposes `next()` for the cycle and
`read` / `write` helpers. Both `WalletHomeContent` and
`TransactionRow` read the same key so dashboard + history stay in
lockstep.
Test plan
("$12.34" using the user's selected fiat currency). Tap
again → "* * * * *" hidden. Tap again → back to sats.
kill + relaunch, dashboard opens in FIAT.
is masked ("+* * " / "- * *"; fee text masked). Tap the
dashboard balance to leave HIDDEN → tx history numbers reappear
on next open.
fiat currency.
`isFiatMode` flag: Settings → Interface → Fiat toggle stays
whatever it was; feed action-bar zap counts, timestamps, etc.
still respect the global setting.
build for the first time → dashboard opens in HIDDEN. User who
had it `false` → opens in SATS. Same value reflected after
toggling and relaunching.
that pubkey at its own default (SATS, since the per-pubkey key
isn't migrated for the new account).
back to the sats display so the dashboard doesn't show a blank.