feat(tokens): replace Get with Buy In, swap Withdraw for Buy More - #1341
Merged
Conversation
Token info led with "Get" for a token you don't hold and offered Give/Convert/Withdraw for one you do. Withdrawal isn't the action someone reaches for from a token's page, and there was no way to add to a position you already hold without backing out to the buy flow. - Unowned: the single tile reads "Buy In", same OnBuy(shortfall) dispatch. - Held: Give / Buy More / Convert. Withdraw drops, Convert takes its slot, and "Buy More" takes the middle with the same dispatch as the unowned tile. - Dollars is the exception and keeps Give / Convert / Withdraw. There is no buying more of the cash reserve, and cashing out is what people come here for. action_get had one call site and becomes action_buyIn; action_buyMore already existed. The tiles get the design's exported icons: ic_arrow_down is Figma's IconArrowDown (node 9536:8434), and ic_arrow_up_large mirrors it vertically for the Withdraw tile, which the design has no glyph for — its only IconArrowUp is the 15.8px square-cap market-cap indicator, and the tile row it draws (node 9631:2168) has no Withdraw tile. The _large suffix avoids ui/components' 20dp ic_arrow_up, used by chat send.
bmc08gt
force-pushed
the
feat/token-info-buy-in-labels
branch
from
August 27, 2026 16:14
328fe8e to
34d2e16
Compare
The amount and receipt screens were both titled "Get", so tapping "Buy In" or "Buy More" on currency info opened a screen that named the action something else. Both now derive their title from whether the target currency is already held, and the payment-source row reads "Buy with". Held is the same test the tile row uses — an existing token account or a positive balance — so the tile and the screen it opens always agree. SwapViewModel picks the account up from AccountController.observeHasAccountFor, which outlives a balance that has gone to zero. title_get and label_getWith are dropped; the titles reuse action_buyIn and action_buyMore, and label_buyWith replaces the old label. "You Get" on the receipt breakdown is left alone — it names a leg of the trade, not the flow. Matches code-payments/code-ios-app#671.
bmc08gt
added a commit
that referenced
this pull request
Aug 27, 2026
#1341 added a required `accountController` parameter to `SwapViewModel` and changed only `SwapViewModel.kt`, so `SwapViewModelErrorTest.createViewModel()` still calls the old constructor. The module's unit tests have not compiled since it merged, which fails every PR built against `code/cash`. Add the mock in constructor order and stub `observeHasAccountFor` to return false. Nothing in this file exercises the first-buy/top-up branch it feeds, and an explicit answer is steadier than a relaxed mock's empty flow. `SwapViewModelStateTest` never constructs the view model, so it needs nothing.
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.
Token info led with "Get" for a token you don't hold and offered Give/Convert/Withdraw for one you do. Withdrawal isn't the action someone reaches for from a token's page, and there was no way to add to a position you already hold without backing out to the buy flow.
OnBuy(shortfall)dispatch as before.CurrencyActionTilesbranches ontokenMint == Mint.usdf.action_gethad a single call site and is replaced byaction_buyIn;action_buyMorealready existed.Icons. The Buy In / Buy More tiles use
ic_arrow_down, exported from Figma'sIconArrowDown(node 9536:8434). The Withdraw tile has no design asset to pull: the file's onlyIconArrowUpis the 15.8px square-cap market-cap indicator, a different family from the 28px round-cap tile glyphs, and the tile row the design draws (node 9631:2168) has no Withdraw tile at all — it puts Withdraw in a full-width text button instead. Soic_arrow_up_largeisic_arrow_downreflected about y=14, which matches the family exactly. The_largesuffix is there becauseui/componentsalready owns a 20dpic_arrow_upfor the chat send button; a second drawable by that name in a module on the same classpath would silently win the resource merge.Worth a second opinion on two things: the mirrored asset, if a designer would rather add a real 28px
IconArrowUpto the file; and the fact that withdrawal is no longer reachable from a non-Dollars token's page.AppRoute.Transfers.Withdrawalstill exists and is reachable elsewhere, but I didn't audit every entry point — if this tile was the primary way in, that path is gone for tokens.Buy flow titles
SwapEntryScreenandBuyReceiptScreenwere both titled "Get", so tapping a tile opened a screen that named the action something else. Both now derive the title fromstate.isBuyingMore, and the payment-source row reads "Buy with". Held is the same test the tile row uses — an existing token account or a positive balance — so the tile and the screen it opens always agree;SwapViewModelpicks the account up fromAccountController.observeHasAccountFor, which outlives a balance that has gone to zero.title_getandlabel_getWithare dropped. "You Get" on the receipt breakdown is left alone; it names a leg of the trade, not the flow.Matches code-payments/code-ios-app#671, which makes the same change on iOS.