fix(card): prioritize card CTA for eligible users over region-picker KYC#2262
Conversation
Card-eligible users (skip badge or admin grant — both collapse into cardInfo.hasCardAccess on the BE) were funneled to the region picker first: the home activation funnel only surfaced the card step after KYC + funding, and the carousel KYC prompt always pointed at /profile/identity-verification. For EU/NA users that picker maps the region intent to bridge-requirements and auto-enrolls Bridge bank rails, whose DB checks fail on many EU addresses — surfacing as a "blocked by Bridge / proof of address" detour for people who only ever wanted a card. Surface the card step first whenever the user is eligible and cardless, routing them to /card (KYC runs on rain-requirements — no regionIntent, no Bridge rails), and stop showing the region-picker carousel CTA to eligible users.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughCard access state is elevated to a first-class priority across activation flow and region KYC initiation. Two hooks now gate on card-eligible status: ChangesCard Access Priority Across Activation Flow and Region KYC
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Comment |
Code-analysis diffPainscore total: 5732.06 → 5733.06 (+1) 🆕 New findings (15)
✅ Resolved (15)
📈 Painscore deltas (top movers)
|
🧪 UI test report — ✅ all greenSuites
📊 Coverage (unit)
⏱ 10 slowest test cases
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/hooks/useHomeCarouselCTAs.tsx`:
- Around line 298-304: The useCardInfo() and useActivationStatus hooks are
constructing their query keys inconsistently. Locate both hooks and examine
their query key construction for the 'card-info' key. The useCardInfo hook uses
['card-info', user?.user?.userId] while useActivationStatus uses ['card-info',
userId]. Standardize the query key parameters so both hooks extract and
reference userId in the same way (e.g., both should use the same pattern like
userId or both should use user?.user?.userId) to ensure React Query treats them
as a single cache entry and maintains consistent state across all consumers.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 4e97d32c-7068-42a1-9d5b-c00d3da3df9b
📒 Files selected for processing (2)
src/hooks/useActivationStatus.tssrc/hooks/useHomeCarouselCTAs.tsx
Extends the card-priority behavior to the region picker. When a user has card access (skip badge / admin grant -> cardInfo.hasCardAccess) but no active card, handleStartKyc now sends them to /card — whose KYC runs on the rain-requirements Sumsub level (no regionIntent, no Bridge/Manteca rail enrollment) — instead of starting region KYC, regardless of which region they selected. Card-holders fall through and can still unlock bank regions.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/Profile/views/UnlockedRegions.view.tsx`:
- Around line 72-74: The hasActiveCard computation on line 73 uses the
double-bang operator (!!findActiveCard(overview)) which converts undefined to
false, treating the unknown/loading state the same as "no active card". This
causes premature redirects to /card before the card overview finishes loading.
Remove the !! operator from the findActiveCard(overview) call in the useMemo
hook to preserve the tri-state value (true | false | undefined), and then update
the redirect logic at line 172-175 to only redirect when hasActiveCard is
explicitly false, not when it is undefined.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b140af0f-697b-463b-a087-910580458191
📒 Files selected for processing (1)
src/components/Profile/views/UnlockedRegions.view.tsx
Address CodeRabbit (Major): while useRainCardOverview is still loading, treating `overview` as "no active card" could bounce a card-holder to /card before it resolves. Make hasActiveCard tri-state (undefined while loading) and only redirect on an explicit `false`.
Summary
Card-eligible users were being routed to the region picker before ever seeing the card. The home activation funnel only inserted the
cardstep after the user was KYC-approved and funded, and the carouselkyc-promptalways pointed at/profile/identity-verification.For EU/NA users that picker maps the region intent →
bridge-requirementsand auto-enrolls Bridge bank rails — whose database checks fail on many EU (e.g. Polish) addresses, surfacing as a "blocked by Bridge / proof of address" dead-end for people who only ever wanted a card.This makes the card CTA take priority for eligible users and routes them to
/card, whose KYC runs on therain-requirementsSumsub level (noregionIntent, no Bridge rail enrollment).useActivationStatus: thecardstep now wins oververify/deposit/outbound(and fires for activated-but-cardless users), gated onhasCardAccess && !hasCard && !dismissed.useHomeCarouselCTAs: suppress the region-pickerkyc-promptfor users who already have card access."Eligible" =
cardInfo.hasCardAccess— a skip badge (e.g.WAITLIST_SKIP) or an admin grant. This is already phase-aware on the backend (activeSkipBadgeCodes()), so the gate widens automatically at public launch with no FE change.Risk
Low / FE-only. Changes which single home CTA shows; all routing targets already exist. Eligible users now see "Get your card" first instead of "Unlock payments"; non-eligible users are unchanged. No API/contract change.
QA (sandbox)
/card(rain-requirements KYC, no region picker).