feat(wallet): tick the balance up when a scanned bill is claimed - #1369
Open
bmc08gt wants to merge 1 commit into
Open
feat(wallet): tick the balance up when a scanned bill is claimed#1369bmc08gt wants to merge 1 commit into
bmc08gt wants to merge 1 commit into
Conversation
"Put in Wallet" dismissed the bill and left the user on the scanner, so money they had just taken only showed up the next time they opened the wallet, already counted. The button now hands them to the wallet tab and the balance rolls up on arrival. That roll needs a "before" to start from, and there isn't one by then: `tokenCoordinator.add` credits the account when the bill is *grabbed*, several taps earlier, so every flow the wallet reads has already moved. `WalletRevealCoordinator` captures the pre-credit totals at the grab, `claimReceivedFunds` arms them, and the wallet opens on that snapshot for 450ms before releasing to live values. Both the header and each card's balance already draw through `AnimatedNumberText`, so the roll is just the rendered string changing. Only a scanned bill routes. A cash link is claimed from a link rather than from the scanner, so nothing is captured for it, `arm()` reports that, and its confirmation dismisses where it stands as before. A claim in a currency the wallet didn't hold is withheld from the deck for the same beat, then passed to `TokenCardStack` as `enteringMint`, which opens a slot for it and fades it in. The caller names the card rather than the stack diffing its own token list, because the case that most needs the animation, a wallet that held nothing so the stack was never composed, is the one a diff can't see. The hold is timed from the wallet reporting itself drawn rather than from the tap, so a slow tab doesn't spend it behind the loading spinner, and a reveal nobody collects releases itself after 3s.
bmc08gt
force-pushed
the
feat/wallet-claim-reveal
branch
from
August 28, 2026 21:52
e204102 to
10b4a63
Compare
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.
Put in Walletdismissed the bill and left the user on the scanner. The money they had just taken only showed up the next time they opened the wallet, already counted.The button now takes them to the wallet tab and the balance rolls up on arrival.
Why there's a coordinator for this
The roll needs a "before" to start from, and there isn't one by the time the wallet opens.
tokenCoordinator.addcredits the account when the bill is grabbed, several taps before the claim, so every flow the wallet reads has already moved.WalletRevealCoordinatorcarries the pre-credit picture across that gap:CodeScanDelegatecaptures the totals immediately before the credit.claimReceivedFunds()arms the snapshot and dismisses the bill. It's a separateBillOperationsmethod rather than a branch insidedismissBill(PutInWallet), because that same result also covers a grab timeout, a cancel, and a swipe-away, none of which is the user asking to see their wallet.The header and each card's balance already draw through
AnimatedNumberText, so the roll itself is just the rendered string changing. The claimed token's own card balance is held back too, so its number rolls in step with the total above it instead of sitting there already updated.The hold is timed from the wallet reporting itself drawn, not from the tap, so a slow tab doesn't spend the window behind the loading spinner. A reveal nobody collects releases itself after 3s, which also means there's no logout or reset wiring to keep in sync.
Only scanned bills route
A cash link is claimed from a link rather than from the scanner, so nothing is captured for it.
arm()returns whether there was a snapshot,claimReceivedFunds()passes that back, and the decorator navigates only ontrue. The cash link confirmation dismisses where it stands, as it did before.New card entry
A claim in a currency the wallet didn't hold is withheld from the deck for the same beat, then passed to
TokenCardStackasenteringMint. The deck opens a slot from 0 to the full fanned reveal and the card fades in over the first half of that.The caller names the entering card rather than the stack diffing its own token list. The case that most needs the animation, a wallet that held nothing so the stack was never composed, is exactly the one a diff can't see. The entry offset is read in the placement phase alongside
scrolledPast, so it only re-places cards, and the measured height stays the full fanned height so the list's scroll range doesn't move.Tests
WalletRevealCoordinatorTestcovers the capture/arm/hold/release cycle: a capture is consumed once so a second tap can't replay it, arming with nothing captured publishes nothing and reportsfalse, a redraw part way through the hold doesn't extend it, and an uncollected reveal times out.CodeScanDelegateTestasserts the ordering the whole thing rests on, that the snapshot is taken before the credit.BillPresentationDelegateTestcovers both claim paths and checks the otherPutInWalletdismissals leave the reveal alone.