Skip to content

fix(home): activation-rejection CTA respects users who can already transact#2351

Merged
Hugo0 merged 1 commit into
mainfrom
hotfix/activation-cta-respect-card
Jul 3, 2026
Merged

fix(home): activation-rejection CTA respects users who can already transact#2351
Hugo0 merged 1 commit into
mainfrom
hotfix/activation-cta-respect-card

Conversation

@Hugo0

@Hugo0 Hugo0 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

The home activation-rejection override (ActivationCTAs) showed "Complete your setup → Upload document" (fixable) or "Verification issue" (blocked) to any Sumsub-approved user with a rejected bank/qr rail — even users who already hold an active card or another enabled rail, or whom the BE has marked isActivated. For a card-holder that's a nag on an optional capability they don't need (and, for a terminally-rejected bank rail, can't fix).

Gate the override on !canAlreadyTransact, where canAlreadyTransact = rails.some(status === 'enabled') || user.isActivated. The card's own rail reads enabled, so a card-holder is covered. A genuinely-fixable bank RFI is unaffected on the home screen only — it still surfaces in context in the /add-money/[country]/bank flow, which runs its own capability gate.

Risk

Low. One added boolean guard on an existing memo; the fixable/blocked branches themselves are untouched. Covered by new tests.

Cross-repo

Pairs with the peanut-api-ts hotfix terminal Bridge → blocked (peanutprotocol/peanut-api-ts #1132). Independent — either can ship first. The API fix flips a terminal user from the "fixable/upload" card to the "blocked/contact-support" card; this FE fix suppresses both for users who can already transact.

QA

npm test — new src/components/Home/__tests__/ActivationCTAs.test.tsx:

  • card-holder (enabled card rail) + rejected bank rail → no "Complete your setup"; falls through to the normal funnel step
  • BE-activated user + rejected bank rail → no nag
  • user with no working rail + fixable rejection → still nagged (behavior unchanged)

…ansact

The provider-rejection override showed 'Complete your setup / Upload
document' (or 'Verification issue') to any Sumsub-approved user with a
rejected bank/qr rail — even card-holders and already-activated users, who
already have a working way to transact and don't need the bank rail. Gate
the override on !canAlreadyTransact (any enabled rail — the card's rail
reads enabled — or BE isActivated). A genuinely-fixable bank RFI still
surfaces in context in the /add-money bank flow.
@vercel

vercel Bot commented Jul 3, 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 Jul 3, 2026 5:49pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 47 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

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.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 79041aaf-790e-4bfc-8ecb-5d1eef93c70c

📥 Commits

Reviewing files that changed from the base of the PR and between 1dde3e8 and 82392ea.

📒 Files selected for processing (2)
  • src/components/Home/ActivationCTAs.tsx
  • src/components/Home/__tests__/ActivationCTAs.test.tsx

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

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Code-analysis diff

Painscore total: 5885.18 → 5885.24 (+0.06)
Findings: 0 net (+2 new, -2 resolved)

🆕 New findings (2)

  • high complexity — src/components/Home/ActivationCTAs.tsx — CC 46, MI 59.99, SLOC 167
  • medium high-mdd — src/components/Home/ActivationCTAs.tsx:77 — ActivationCTAs: MDD 46.3 (uses across many lines from declarations)

✅ Resolved (2)

  • src/components/Home/ActivationCTAs.tsx — CC 42, MI 59.11, SLOC 160
  • src/components/Home/ActivationCTAs.tsx:77 — ActivationCTAs: MDD 45.8 (uses across many lines from declarations)

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

🧪 UI test report — ✅ all green

Suites

  • unit: 1725 ran, 0 failed, 0 skipped, 27.5s

📊 Coverage (unit)

metric %
statements 55.6%
branches 39.4%
functions 43.8%
lines 55.5%
⏱ 10 slowest test cases
time test
3.8s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › never places two stickers in heavy overlap (broad seed sweep)
0.5s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › every sticker stays within canvas at any count
0.3s src/app/actions/__tests__/api-headers.test.ts › should include Content-Type in updateUserById
0.3s src/app/actions/__tests__/api-headers-extended.test.ts › should not include apiKey in updateUserById body
0.1s src/components/Global/GeneralRecipientInput/__tests__/GeneralRecipientInput.test.tsx › should handle valid 9-digit US account
0.1s src/components/Global/GeneralRecipientInput/__tests__/GeneralRecipientInput.test.tsx › should handle valid ETH address
0.1s src/components/Global/GeneralRecipientInput/__tests__/GeneralRecipientInput.test.tsx › should handle too long for US account
0.1s src/components/Global/GeneralRecipientInput/__tests__/GeneralRecipientInput.test.tsx › should handle valid US account with spaces 2
0.1s src/app/(mobile-ui)/qr-pay/__tests__/qr-pay-states.test.tsx › Perk claim in progress shows disabled button + progress
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 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Hugo0 Hugo0 marked this pull request as ready for review July 3, 2026 17:56
@Hugo0 Hugo0 merged commit f88baf5 into main Jul 3, 2026
22 of 24 checks passed
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