Skip to content

feat(buy): allow the buy flow to be pushed onto a host stack - #584

Merged
bmc08gt merged 1 commit into
mainfrom
feat-pushable-buy-flow
Aug 15, 2026
Merged

feat(buy): allow the buy flow to be pushed onto a host stack#584
bmc08gt merged 1 commit into
mainfrom
feat-pushable-buy-flow

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

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.presentNested no-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. owningStack is .balance.
  • BuyAmountScreen(mint:) is now a thin environment-reading wrapper over a private BuyAmountScreenContent (the previous implementation, unchanged), matching the GiveScreen / CurrencyInfoScreen convention. Both the sheet root and the pushed destination construct it identically.
  • Close button gated on 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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant