Skip to content

fix(payments): show insufficient funds above the swipe sheets - #1873

Merged
bmc08gt merged 4 commits into
code/cashfrom
fix/insufficient-funds-over-sheet
Oct 28, 2026
Merged

bmc08gt merged 4 commits into
code/cashfrom
fix/insufficient-funds-over-sheet

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

The swipe sheets for request pay, group send and Currency Info send were Material3 ModalBottomSheets. Each opens its own window, so a BottomBarManager modal raised while one was up, such as insufficient funds, drew underneath it in the Activity window.

The three sheets are now SwipePaySheet, built on a new InWindowBottomSheet (ui/navigation, on top of UnstyledBottomSheet) and drawn inside the route's content. The entry decorator draws the bar after entry.Content() in the same window, so errors now show over the sheet and the sheet stays open under them. InWindowBottomSheet keeps the scrim, back handling, the lock while a swipe is in progress, and the same 92.5% height cap as the nav sheets.

  • Request pay checks funds after the swipe only, against the token picked in the sheet. Pressing "Send $X" opens the sheet straight away, since the wallet can hold several currencies.
  • Deck Pay opens only the pay sheet over the chat. It used to push Request details with pay = true and open the sheet on top. The pay logic moved out of RequestDetailsViewModel into RequestPayFlow, which both the chat (RequestPayViewModel) and Request details use. pay and payOnOpen are gone. Tapping the card itself still opens Request details.
  • Currency Info send checks the balance before its sheet opens, since that screen sends a single token. Group send already checked at the amount step.
  • Add Money from the modal closes the sheet, then opens the deposit screen.
  • CodeButton latched its size on first composition, so a button first drawn while loading kept the spinner's width and clipped its label to one letter once loading ended (request details' "Send $2" opened through deck Pay). It now latches only while the label is shown.

SwipePaySheet is stateless: it takes a SwipePayUiState and SwipePayActions. docs/swipe-sheet-destinations.md lays out the next step: each sheet as its own nav destination with an entry-scoped view model, including the hostsBars change a partial sheet needs and the nested FlowHost group send sits in.

RequestPayFlowTest, RequestDetailsInsufficientFundsTest and CurrencySendInsufficientFundsTest cover the sheet opening without a pre-check, the sheet staying open after a post-swipe failure, and the closed and nothing-to-pay outcomes.

@bmc08gt bmc08gt self-assigned this Oct 28, 2026
@github-actions github-actions Bot added the type: fix Bug fix label Oct 28, 2026
Request pay, group send and Currency Info send drew their swipe sheet in a
Material ModalBottomSheet, a window of its own, so the insufficient-funds
modal (drawn in the Activity window) appeared behind it.

Draw the sheets in the route's own window instead, through a new
InWindowBottomSheet, so the bar the entry decorator draws lands above them.
The sheet content moves to one stateless SwipePaySheet fed by a
SwipePayUiState and SwipePayActions. Request pay and Currency Info send also
check the balance before the sheet opens, and Add Money closes the sheet
before opening the deposit screen.
@bmc08gt bmc08gt changed the title fix(payments): show insufficient funds above the swipe sheet fix(payments): show insufficient funds above the swipe sheets Oct 28, 2026
@bmc08gt
bmc08gt force-pushed the fix/insufficient-funds-over-sheet branch from 4053c54 to 78a554e Compare October 28, 2026 18:55
@github-actions github-actions Bot added the area: ui Compose UI, theme, components, resources label Oct 28, 2026
The payer picks the token in the sheet, so the check runs after the swipe against that pick. CodeButton latches its size from the label only, so a button first composed while loading no longer clips its text.
…details

Extract the pay logic into RequestPayFlow, shared by Request details and a new chat-side RequestPayViewModel. The deck's Pay now opens the swipe sheet in the chat screen; the card body still opens details. Drops the pay flag on ChatStep.RequestDetails and payOnOpen.
@bmc08gt
bmc08gt merged commit bf1dd59 into code/cash Oct 28, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ui Compose UI, theme, components, resources type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant