Skip to content

Fix card withdrawal asset picker and fund visibility issues - #2527

Merged
MusabShakeel576 merged 1 commit into
masterfrom
claude/monday-task-review-mrvnpw
Sep 17, 2026
Merged

MusabShakeel576 merged 1 commit into
masterfrom
claude/monday-task-review-mrvnpw

Conversation

@MusabShakeel576

Copy link
Copy Markdown
Contributor

Summary

This PR fixes two critical UX issues affecting card users:

  1. Asset picker showing empty/unreadable assets: The withdrawal screen was displaying all supported tokens (including $0 balances and unreadable ones), burying the actually-funded assets in a long list. This made it impossible to find withdrawable assets.

  2. Swap/Send actions disappearing for card-funded users: Users who funded their card directly (bypassing the wallet) saw their balance but the Swap and Send actions vanished, leaving only "Add Funds" visible.

Key Changes

  • New ToDestinationSelector.shared.tsx: Unified asset picker component used by both web and native platforms. Replaces the previous portalled dropdown menu (which didn't work in modals) with an in-flow list that:

    • Filters to show only funded assets (balance > $0) or the currently selected asset
    • Falls back to all readable assets when the card holds nothing
    • Adds chain names to disambiguate duplicate symbols across chains
    • Properly closes after selection, making the underlying button reachable
  • New helper functions in cardHelpers.ts:

    • withdrawableAssetOptions(): Filters assets to show only those with readable balances and non-zero amounts (keeping selected asset even if empty)
    • isDifferentCollateralAsset(): Detects actual asset changes vs. re-selecting the same asset (fixes amount field being cleared on re-selection)
  • New holdsFundsAnywhere() predicate: Determines whether to show Swap/Send actions by checking if user holds funds anywhere (wallet, card, savings, or has deposit history) rather than only checking wallet funding

  • Platform consolidation: Both ToDestinationSelector.native.tsx and .web.tsx now re-export from the shared implementation, eliminating platform-specific divergence

  • Improved empty state handling: TokenSelector now shows a helpful message when the wallet is empty (normal for card-funded users) instead of a blank list

Testing

Comprehensive test coverage added:

  • ToDestinationSelector.test.tsx: Tests asset filtering, selection behavior, chain disambiguation, and empty states
  • cardCollateralAssets.test.ts: Tests the filtering logic and asset comparison helpers
  • homeBalanceTotals.test.ts: Tests the fund visibility predicate across various balance scenarios

https://claude.ai/code/session_01FxQs7MKViUX9AL5bzUzj9o

…thdraw

Two symptoms from one support report (Solid Operations 13039057237): the
Swap and Send buttons had disappeared from home, and withdrawing from the
card did not work. The reporter holds $4.87 on a Rain card and $0 in their
wallet — every deposit they have ever made went to the card's own deposit
address, which never touches their Safe.

Home: the action row asked `depositCompleted`, which only ever knows about
wallet funding (a deposit on record, a token balance, a vault balance). A
cardholder who funds their card directly satisfies none of it, so the row
collapsed to a lone "Add Funds" on a screen that was showing them a balance
right above it. It now asks whether the user holds anything in any of the
pots the breakdown shows, with `depositCompleted` still in front so an
erroring or not-yet-settled balance query cannot hide the buttons either.
Swap and Send work off wallet tokens, so a card-only balance opens Send on
an empty asset list — which now says why, and points at Add Funds, instead
of rendering a blank list under "Select an asset".

Card withdraw: the asset picker was a portalled dropdown menu on web. Inside
the withdraw sheet on a phone browser it covered the "Withdraw" button and
swallowed taps on its own rows — in the recording the user spent nine
seconds tapping the asset they wanted and gave up with the sheet still open.
Both platforms now render the in-flow list native already had, from one
shared file.

Two more things the same screen got wrong:

- Every token the user's Rain contracts support was offered, so the two
  assets they could actually withdraw sat behind eight $0 rows, including a
  duplicate "USDC" and "USDT". Only funded assets are listed now (plus the
  selected one, and the full list when nothing is funded), and a symbol held
  on two chains names its chain.
- Picking the asset already selected cleared the amount, so "press Max, then
  confirm the destination" ended with an empty field. Only an actual change
  of asset clears it now.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxQs7MKViUX9AL5bzUzj9o
@vercel

vercel Bot commented Sep 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated
solid-app Ignored Ignored Sep 17, 2026 1:27pm UTC
solid-app-staging Ignored Ignored Sep 17, 2026 1:27pm UTC

Request Review

@claude

claude Bot commented Sep 17, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@MusabShakeel576
MusabShakeel576 merged commit 22313e0 into master Sep 17, 2026
6 checks passed
@MusabShakeel576
MusabShakeel576 deleted the claude/monday-task-review-mrvnpw branch September 17, 2026 14:01
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.

2 participants