Repository navigation
fix(home): make hide balance work, and add an eye to peek - #203
Merged
Merged
Conversation
… is on The Security toggle wrote hideBalance onto the wallet, but the home screen never read it. Its reader in the wallet header went with the WalletTransactions screen, and only the drawer card shown on large screens still checked it, so on a phone the switch did nothing. The setting is now an app-wide preference kept with the other settings instead of on the wallet, so it holds on every network and can be changed without a wallet. Values saved by the old toggle aren't carried over, since they never had an effect on a phone. While it's on, home shows dots for the balance, the fiat line and each transaction amount, as does the large-screen drawer card. The dots on the two balance lines share a centre line: a clear copy of the unit balances the visible one, and the fiat line drops its ≈. A row's long-press menu stops offering Copy Amount, and screen readers hear "Balance hidden" and "Amount hidden" instead of a run of bullets. Transaction details still show the amount, since that screen is opened on purpose. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The home header gets an eye next to the settings button. It hides or shows the balance and transaction amounts for the current session without touching the Hide balance on home setting, so a quick look doesn't turn the setting off. Every launch starts from the setting, and while the setting is on, leaving the app hides the amounts again, for whoever opens it next and in the app switcher's snapshot. The eye sits in the header rather than beside the balance: it also covers the transaction amounts, the header stays on screen while the list scrolls, and on large screens the balance is in the drawer. Tapping the balance already switches between BTC and sats. The glyph shows the current state, struck through while amounts are hidden. On iOS 26 it shares the settings button's glass capsule; elsewhere it gets a circle of its own. The setting's row gains a subtitle that points to the eye. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Turns the setting on in Security and checks that home shows the balance as dots, that the eye shows it, and that after a relaunch it starts hidden again, so the peek left the setting on. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…e background isBalanceHidden was a second piece of state, mirrored from the setting by hand on load, on change and on leaving the app. It also behaved differently depending on the setting: with it on, leaving the app hid a peek again, but with it off, a hide from the eye outlived leaving. Now the eye sets a single override and isBalanceHidden is derived from it and the setting. The override clears when the setting changes and when the app goes to the background, so the eye works the same either way and every visit starts from the setting. The context exposes toggleBalanceHidden rather than a raw setter. Only 'background' clears it. iOS also goes 'inactive' for Control Center, Face ID and permission prompts, which would undo the eye mid-use. The cost is that the app switcher's snapshot can show amounts the eye revealed, since home has no capture protection. The tests now capture each test's own AppState listeners instead of picking the last one from a mock shared across tests, and cover both directions of the override. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The settings button and the eye each drew the same 52pt circle where there's no glass behind them. HeaderBarButton already decides between glass and its own background, so the circle is now its default and both callers drop their copy. Contacts' "+" still passes its own square. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
EyeOffIcon repeated EyeIcon's path and circle, and its clip polygons hardcoded numbers that only held for one stroke width. EyeIcon takes a `slashed` prop instead, and the gap cut around the slash is worked out from the stroke width and the view box. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The fiat line drops its ≈ while hidden, but the balance keeps its unit, balanced by a clear copy, so tapping it still visibly switches BTC/sats. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The test left the setting on, so a test added after it in the spec would have started with the amounts hidden. Getting to the switch and back moves into a helper that both steps use. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Hide balance on home now hides amounts, and an eye on home overrides it until the app goes to the background, without turning the setting off.
The bug
The Security toggle wrote
hideBalanceonto the wallet, but the home screen never read it. Its reader in the wallet header went with theWalletTransactionsscreen (fc3049f), and only the drawer card shown on large screens still checked it, so on a phone the switch did nothing.Hide balance on home
SettingsProvider(HideBalance, next toPinLayoutScrambled) instead of a field on the wallet. It holds on every network and can be changed without a wallet.hideBalanceis dropped fromAbstractWallet. Values saved by the old toggle aren't carried over, since they never had an effect on a phone: if you'd turned it on, turn it on again.••••for the balance, the fiat line and each transaction amount. The large-screen drawer card hides its balance too.≈while hidden. The unit stays so tapping it still visibly switches BTC/sats.The eye
HeaderBarButtonnow draws by default (Contacts' "+" keeps its own square).isBalanceHiddenis derived from that override and the setting, and the context exposestoggleBalanceHidden(). The eye never changes the setting, and changing the setting clears the override.inactivedoesn't clear it. Control Center, Face ID and permission prompts would otherwise undo the eye mid-use.EyeIcongains aslashedprop, with the gap around the slash worked out from the stroke width.settings.security_hide_balance_subtitle,wallets.show_balance,wallets.hide_balance,wallets.balance_hidden,transactions.amount_hidden.Testing
inactivedoesn't. Each test captures its own AppState listeners;06-settings3/3, including the new hide-balance test, which now turns the setting back off at the end.07-contacts, and the steps are untouched here. With a one-second settle added locally (not committed) all 3 passed.Not verified
🤖 Generated with Claude Code