Skip to content

fix(send): hide 'Exchange or Wallet' dead-button card in direct-send flow#2225

Merged
Hugo0 merged 1 commit into
mainfrom
hotfix/send-external-wallet-dead-card
Jun 15, 2026
Merged

fix(send): hide 'Exchange or Wallet' dead-button card in direct-send flow#2225
Hugo0 merged 1 commit into
mainfrom
hotfix/send-external-wallet-dead-card

Conversation

@Hugo0

@Hugo0 Hugo0 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Why

A guest on /send who enters an amount sees an 'Exchange or Wallet' card (soon:false, enabled) that does nothing when tapped. PaymentMethodActionList only acts on that card when the caller passes onPayWithExternalWallet; the semantic-request flow does, but direct-send (SendInputView) does not — and direct-send has no external-wallet path (only Input/Status/Success views). Dead button. Found by the dead-button-class audit (HIGH), same family as the withdraw Continue throw (#2224).

Fix

Filter the exchange-or-wallet card out of PaymentMethodActionList unless an onPayWithExternalWallet handler is provided — correct-by-construction: no caller can render a card it can't honor. Semantic-request unchanged (still passes the handler, card still shows). Not wiring a handler into direct-send because that flow has no external-wallet machinery — that would be a feature, not a bug fix.

Test

Adds the component's first tests: card hidden without handler (+ other methods still render), shown + invokes handler (no /setup redirect) with handler. 2/2 pass.

Risk

Low, UI-only. Removes a non-functional option from the guest direct-send view; no behavior change for logged-in users or the request flow.

@vercel

vercel Bot commented Jun 15, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
peanut-wallet Ready Ready Preview, Comment Jun 15, 2026 10:00pm

Request Review

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@Hugo0, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 41 minutes and 31 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d46250a3-d82b-4cdb-9c02-ae3138410c0f

📥 Commits

Reviewing files that changed from the base of the PR and between 5573129 and fdf12fa.

📒 Files selected for processing (2)
  • src/features/payments/shared/components/PaymentMethodActionList.tsx
  • src/features/payments/shared/components/__tests__/PaymentMethodActionList.test.tsx

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Code-analysis diff

Painscore total: 5793.76 → 5793.77 (+0.01)
Findings: 0 net (+4 new, -4 resolved)

🆕 New findings (4)

  • medium structural-dup — src/features/payments/flows/contribute-pot/components/RequestPotActionList.tsx:177 — 24 duplicate lines / 140 tokens with src/features/payments/shared/components/PaymentMethodActionList.tsx:104
  • medium high-mdd — src/features/payments/shared/components/PaymentMethodActionList.tsx:40 — PaymentMethodActionList: MDD 23.5 (uses across many lines from declarations)
  • medium complexity — src/features/payments/shared/components/PaymentMethodActionList.tsx — CC 23, MI 65.28, SLOC 52
  • low high-mdd — src/features/payments/shared/components/PaymentMethodActionList.tsx:99 — : MDD 11.9 (uses across many lines from declarations)

✅ Resolved (4)

  • src/features/payments/flows/contribute-pot/components/RequestPotActionList.tsx:177 — 24 duplicate lines / 140 tokens with src/features/payments/shared/components/PaymentMethodActionList.tsx:95
  • src/features/payments/shared/components/PaymentMethodActionList.tsx — CC 21, MI 64.84, SLOC 48
  • src/features/payments/shared/components/PaymentMethodActionList.tsx:40 — PaymentMethodActionList: MDD 20.0 (uses across many lines from declarations)
  • src/features/payments/shared/components/PaymentMethodActionList.tsx:90 — : MDD 11.9 (uses across many lines from declarations)

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

🧪 UI test report — ✅ all green

Suites

  • unit: 1434 ran, 0 failed, 0 skipped, 21.4s

📊 Coverage (unit)

metric %
statements 52.0%
branches 34.0%
functions 39.1%
lines 51.9%
⏱ 10 slowest test cases
time test
0.4s src/app/actions/__tests__/api-headers-extended.test.ts › should not include apiKey in updateUserById body
0.3s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › every stamp stays within canvas at any count
0.3s src/app/actions/__tests__/api-headers.test.ts › should include Content-Type in updateUserById
0.1s src/components/Global/GeneralRecipientInput/__tests__/GeneralRecipientInput.test.tsx › should handle valid 9-digit US account
0.1s src/app/(mobile-ui)/qr-pay/__tests__/qr-pay-states.test.tsx › Manteca PIX form ready shows merchant card + amount input + pay button
0.1s src/components/Global/GeneralRecipientInput/__tests__/GeneralRecipientInput.test.tsx › should handle valid US account with spaces
0.1s src/components/Global/GeneralRecipientInput/__tests__/GeneralRecipientInput.test.tsx › should handle valid ETH address in lowercase
0.1s src/components/Global/GeneralRecipientInput/__tests__/GeneralRecipientInput.test.tsx › should handle invalid ETH address (invalid characters)
0.1s src/components/Global/GeneralRecipientInput/__tests__/GeneralRecipientInput.test.tsx › should handle valid US account with spaces 2
0.1s src/components/Global/GeneralRecipientInput/__tests__/GeneralRecipientInput.test.tsx › should handle maximum length (17 digits) US account
📍 Inline annotations are in the **Unit test report** check above. Coverage artifact: `coverage-unit`. Generated by `.github/workflows/tests.yml`.

@Hugo0 Hugo0 marked this pull request as ready for review June 15, 2026 21:45
PaymentMethodActionList renders an 'Exchange or Wallet' card (soon:false, so
enabled) whose tap only does anything when the caller passes onPayWithExternalWallet.
The semantic-request flow passes it; the direct-send flow (SendInputView, non-
logged-in users) does NOT — and direct-send has no external-wallet path at all
(only Input/Status/Success views). So a guest who entered an amount and tapped
the card got nothing: a dead button (audit HIGH finding, same class as the
withdraw Continue throw).

Fix at the component level so it's correct-by-construction for every caller:
only render the exchange-or-wallet card when an onPayWithExternalWallet handler
is provided. No caller can surface a card it can't honor. Semantic-request is
unchanged (still passes the handler). Adds the component's first tests.
@Hugo0 Hugo0 force-pushed the hotfix/send-external-wallet-dead-card branch from 7f7085f to fdf12fa Compare June 15, 2026 21:55
@Hugo0 Hugo0 changed the base branch from dev to main June 15, 2026 21:55
@Hugo0 Hugo0 merged commit 74060a0 into main Jun 15, 2026
16 of 19 checks passed
Hugo0 added a commit that referenced this pull request Jun 16, 2026
…dev-20260616

chore: back-merge main → dev (20260616) — withdraw + send dead-button hotfixes (#2224, #2225)
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