feat(buy): allow the buy flow to be pushed onto a host stack - #584
Merged
Conversation
The buy flow could only be presented as a (nested) sheet, so any screen without a sheet underneath had no way to open it — `presentNested` no-ops on an empty sheet stack. The new tab-bar UI is push-based, so it needs the flow inline. - Add a `.buyCurrency(mint)` destination that hosts the buy amount step on the current navigation stack. The sub-flow (`BuyFlowPath`) already pushes onto whatever stack it lands in, so the rest of the flow follows. - Reshape `BuyAmountScreen` into a thin `(mint:)` environment-reading wrapper over a private `BuyAmountScreenContent`, matching the GiveScreen / CurrencyInfoScreen convention, so both presentations build it the same way. - Gate the Close button on the new `presentedAsSheetRoot` environment value — set only at the sheet root — so a pushed instance uses the system back arrow instead of showing both. Mirrors the deposit flow in #580. Sheet-based entry points (Discover, add-money shortfall) are unchanged.
This was referenced Aug 15, 2026
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.
Makes the buy flow presentable inline on an existing navigation stack, not just as a sheet. Split out of the currency-info revamp (#583) so it can be reviewed — and ported to Android — on its own.
Problem
The buy flow could only be opened as a (nested) sheet.
AppRouter.presentNestedno-ops when the sheet stack is empty, so any screen reached by a plain push — e.g. the new tab-bar UI's wallet → currency info — had no way to open it: the button silently did nothing.The new UI is push-based (see #580, which did the same for the deposit flow), so the flow needs to live on the host stack.
Change
.buyCurrency(mint)destination — hosts the buy amount step on the current stack. The sub-flow (BuyFlowPath) already pushes onto whatever stack it lands in, so the remaining steps follow automatically.owningStackis.balance.BuyAmountScreen(mint:)is now a thin environment-reading wrapper over a privateBuyAmountScreenContent(the previous implementation, unchanged), matching theGiveScreen/CurrencyInfoScreenconvention. Both the sheet root and the pushed destination construct it identically.presentedAsSheetRoot— the environment value from feat(add-money): push deposit destinations instead of showing sheets #580, set only at a sheet root. A pushed instance uses the system back arrow instead of showing both affordances.Sheet-based entry points (Discover, add-money shortfall) are unchanged and keep their Close button.