Repository navigation
fix(flashcard): open the top-up on its keypad - #749
Merged
Merged
Conversation
Tapping Top up showed the amount field, and the keypad came up only once the field was tapped. A top-up's first job is its amount, so the keypad now opens as the amount step shows. It waits while an empty card's unit is still to be chosen (the USD option), and stays shut once an amount is entered. AmountInput takes an opt-in `initiallyOpen` prop for this; every other screen keeps today's tap-to-open field. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review fixes for the top-up keypad. - The keypad opened from the first render, before the Keychain read of the card's unfinished top-ups settled. A top-up that read then refused had its keypad presented and taken down at once, and an unfinished top-up that fixed an empty card's unit left the keypad shut. The field now mounts again once the read settles (whatever it found, or if it failed), and only that mount opens the keypad. - Android's back key and back gesture reach a core Modal only as onRequestClose, which the keypad's modal did not set, so back did nothing while the keypad was up: now the top-up's landing state. Back now closes the keypad, on every screen that uses it. - The keypad's header showed the balance of the wallet named by the amount's unit. For a sat top-up that is the self-custodial wallet, $0.00 outside advanced mode, while the top-up is paid from the Cash wallet. A balanceWalletCurrency prop names the paying wallet; the top-up passes the Cash wallet's, and every other screen is unchanged. - The keypad's close button has a button role and a label for screen readers. - choosingUnit is now offersUnitChoice, and its test is named for what the code does: picking a unit does not open the keypad. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review fixes for the top-up keypad, round 2. - The amount field rendered before the Keychain read of the card's unfinished top-ups settled, and mounted again under a new key once it had. The pre-read field was live, so a keypad opened from it in that window was unmounted with its modal up when the read settled. What was typed was lost, and a second keypad was presented, or none on a card that offers a unit choice. The read waits its turn behind any other store work, such as the card screen's focus-time read. - The field now renders only once the read has settled, with no key. It mounts once, so nothing is left to open before the read or to take down after it, and it opens the keypad unless an amount is entered or the card offers a choice of unit. - AmountInput's initiallyOpen doc now says a screen that decides later mounts the field once it has decided, not that it remounts it. - Specs: no field to tap while the read is held, then one mount, open. The keypad-opening specs expect one mount each. Entering an amount does not mount the field again, and a top-up the read refuses never mounts it. The flow specs let the read settle before pressing the field. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Tapping Top up on a Cashu card showed the amount field, and the keypad only came up once the field was tapped. A top-up's first job is its amount, so the keypad now opens by itself on the amount step.
AmountInput: a new opt-ininitiallyOpenprop opens the keypad modal as the field mounts. It is read once, at mount, and later changes are ignored. It defaults to off, so every other screen keeps today's tap-to-open field. Prettier also reflowed one existing line in this file, which wasn't formatted on main either.onRequestClose, so back did nothing. Its close button now has a button role and a label for screen readers.balanceWalletCurrencyprop sets whose balance the header shows, and the top-up passes the Cash wallet's. Other screens keep their header as it was.AmountInputspec covers opening at mount, closing a keypad that opened itself, and ignoring the prop after mount. A modal spec covers Android's back. A keypad spec renders the field, modal and amount screen for real: the header's wallet, the labelled close, and back. The top-up screen tests cover opening after the read (also when the read fails), never opening for a refused top-up, opening once an unfinished top-up fixes the unit, staying shut on a card that offers a unit choice, staying shut after an amount (also after a failed quote), and the Cash wallet header. Each fails when the behaviour it names is removed. Full suite: 157 suites, 1,839 tests.Requested during the 2026-10-02 device test.
🤖 Generated with Claude Code