Skip to content

refactor: remove StartVerificationView interstitial - #2411

Merged
jjramirezn merged 3 commits into
devfrom
refactor/remove-start-verification-interstitial
Jul 14, 2026
Merged

refactor: remove StartVerificationView interstitial#2411
jjramirezn merged 3 commits into
devfrom
refactor/remove-start-verification-interstitial

Conversation

@jjramirezn

Copy link
Copy Markdown
Contributor

Summary

Removes the StartVerificationView interstitial ("Secure Verification. Limited Data Use.") for good.

Why: the Sumsub SDK never needed it — it inits off token + container. 6 of 8 KYC entry points already skipped it via autoStart/autoStartSdk/skipStartView (qr-pay, withdraw/manteca, limits, KYC drawer, add-money bank, Bridge ToS iframes). The two flows that still showed it — card application and first-time region KYC — both open it immediately after the user tapped an explicit CTA (Apply / "Verify now"), making it a redundant double-consent screen. The copy in IframeWrapper was fully dead code (both consumers passed skipStartView).

With the interstitial gone, the skip-flags (autoStart, autoStartSdk, skipStartView) have no job left, so they're deleted across all call sites; UnlockedRegions' resubmit-vs-start split collapses into one handler.

Exit-confirmation copy unified: Sumsub surfaces say "Exit for now? …your progress is saved." (accurate — Sumsub persists applicant progress; the old "start again from scratch" copy was wrong). Bridge ToS surfaces (IframeWrapper) say "You can come back and finish this anytime." (nothing is "saved" by closing an unaccepted ToS).

Hardening that fell out of /code-review high (second commit):

  • Script-load readiness is now keyed on window.snsWebSdk, not script-tag existence — with two wrapper instances mounted, the second could treat a still-downloading sibling script as loaded and init against undefined (blank modal). Load/error listeners attach to the existing tag instead.
  • SDK init failure now flips the error UI (sdkLoadError) instead of leaving a blank panel.
  • A spinner sits behind the SDK container while the Sumsub iframe boots.

115 insertions, 213 deletions.

Design notes / accepted trade-offs

  • Privacy disclosure removed intentionally. "Peanut never sees or stores your verification data" now appears nowhere. It was already absent from 6/8 flows, so it wasn't functioning as a consent gate. If we want it back, the right home is a one-liner on the pre-existing consent screens (card apply / KycVerifyNow modal) — flagged as a possible follow-up, deliberately not done here.
  • Exit-modal config is similar (not identical) in SumsubKycWrapper and IframeWrapper. Copies now intentionally differ per surface, so no shared helper was extracted. The broader help/exit ActionModal duplication (~80 lines) predates this PR — follow-up candidate.

Risks / breaking changes

  • No backend changes; no API contract impact.
  • All flows converge on the already-battle-tested autoStart init path (SDK inits when visible && accessToken && sdkLoaded) — no new init logic beyond the script-readiness fix above.

QA

  • CI green on both commits (typecheck, unit 1837/0, e2e, format, ci-success). eslint is the known repo-wide advisory red — changed files verified 0 new errors.
  • Manual: card apply → Sumsub opens straight into the SDK (spinner while booting); region KYC first-time + resubmission; qr-pay/withdraw limit-increase unchanged (already autoStart); Bridge ToS iframe exit copy.

Supersedes #2410 — same content plus the origin/dev merge (mobile-release safe-area insets). The old branch could not take the merge: the repo's signed-commits rule rejects updates whose range includes dev's unsigned mobile-release commits, while new-branch pushes pass. No code differences beyond the conflict resolution (kept dev's env(safe-area-inset-top) padding on the ToS iframe container).

Every KYC entry point except the card flow and first-time region KYC
already skipped this screen via autoStart/skipStartView — and in both
remaining flows the user had just tapped an explicit CTA, making it a
redundant double-consent step. The Sumsub SDK never needed it: it inits
off token + container, proven by the autoStart paths in prod.

Also unifies the exit-confirmation copy on the 'Exit for now?' variant;
the 'start again from scratch' copy was wrong anyway (Sumsub persists
applicant progress).
- Script-load effect keyed on window.snsWebSdk, not script-tag existence:
  a second wrapper instance could mark the SDK loaded while a sibling's
  script was still downloading, then init against undefined (blank modal).
- Init failure now flips sdkLoadError so the user gets the error UI +
  Close instead of an empty panel.
- Spinner behind the SDK container while the Sumsub iframe boots.
- IframeWrapper (Bridge ToS surfaces) gets honest exit copy — nothing is
  'saved' by closing an unaccepted ToS.
- Drop the reset-effect destroy block made redundant by visible being an
  init-effect dep; reword a cardApply.utils.ts comment that referenced
  the deleted interstitial.
…verification-view

# Conflicts:
#	src/components/Global/IframeWrapper/StartVerificationView.tsx
#	src/components/Global/IframeWrapper/index.tsx
@vercel

vercel Bot commented Jul 14, 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 14, 2026 11:44am

Request Review

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b3e31388-9852-4c61-9b78-06605b720a50

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/remove-start-verification-interstitial

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

@github-actions

Copy link
Copy Markdown
Contributor

Code-analysis diff

Painscore total: 6187.46 → 6179.6 (-7.86)
Findings: -1 net (+29 new, -30 resolved)

🆕 New findings (29)

  • critical complexity — src/components/Profile/views/UnlockedRegions.view.tsx — CC 65, MI 61.85, SLOC 188
  • critical complexity — src/components/Kyc/SumsubKycWrapper.tsx — CC 51, MI 60.94, SLOC 248
  • high hotspot — src/app/(mobile-ui)/qr-pay/page.tsx — 91 commits, +1021/-996 lines since 6 months ago
  • high hotspot — src/app/(mobile-ui)/withdraw/manteca/page.tsx — 69 commits, +637/-382 lines since 6 months ago
  • high hotspot — src/app/(mobile-ui)/add-money/[country]/bank/page.tsx — 57 commits, +622/-486 lines since 6 months ago
  • medium react-long-component — src/app/(mobile-ui)/qr-pay/page.tsx:101 — QRPayPage is 1503 lines — split it
  • medium high-mdd — src/app/(mobile-ui)/qr-pay/page.tsx:101 — QRPayPage: MDD 340.7 (uses across many lines from declarations)
  • medium high-mdd — src/app/(mobile-ui)/withdraw/manteca/page.tsx:101 — MantecaBankWithdrawFlow: MDD 249.0 (uses across many lines from declarations)
  • medium high-mdd — src/components/Profile/views/UnlockedRegions.view.tsx:64 — UnlockedRegions: MDD 87.9 (uses across many lines from declarations)
  • medium high-mdd — src/components/Global/IframeWrapper/index.tsx:16 — IframeWrapper: MDD 74.0 (uses across many lines from declarations)
  • medium high-mdd — src/components/Kyc/SumsubKycWrapper.tsx:26 — SumsubKycWrapper: MDD 60.9 (uses across many lines from declarations)
  • medium high-dlt — src/components/Kyc/SumsubKycWrapper.tsx:26 — SumsubKycWrapper: DLT 37 (calls 37 distinct functions — high context load)
  • medium high-dlt — src/components/Profile/views/UnlockedRegions.view.tsx:64 — UnlockedRegions: DLT 30 (calls 30 distinct functions — high context load)
  • medium complexity — src/components/Global/IframeWrapper/index.tsx — CC 27, MI 66.44, SLOC 112
  • medium method-complexity — src/components/Profile/views/UnlockedRegions.view.tsx:64 — CC 26 SLOC 118
  • medium hotspot — src/components/Kyc/KycStatusDrawer.tsx — 24 commits, +274/-308 lines since 6 months ago
  • medium high-mdd — src/components/Kyc/SumsubKycWrapper.tsx:105 — : MDD 24.5 (uses across many lines from declarations)
  • medium structural-dup — app/(mobile-ui)/withdraw/manteca/page.tsx:756 — 21 duplicate lines / 122 tokens with app/(mobile-ui)/withdraw/manteca/page.tsx:865
  • medium react-effect-derives-state — src/components/Kyc/SumsubKycWrapper.tsx:235 — small useEffect that only sets state from deps
  • medium react-direct-dom — src/components/Kyc/SumsubKycWrapper.tsx:78 — direct DOM: document.getElementById

…and 9 more.

✅ Resolved (30)

  • src/components/Profile/views/UnlockedRegions.view.tsx — CC 66, MI 61.73, SLOC 198
  • src/components/Kyc/SumsubKycWrapper.tsx — CC 55, MI 60.66, SLOC 268
  • src/app/(mobile-ui)/qr-pay/page.tsx — 90 commits, +1021/-995 lines since 6 months ago
  • src/app/(mobile-ui)/withdraw/manteca/page.tsx — 68 commits, +637/-381 lines since 6 months ago
  • src/app/(mobile-ui)/add-money/[country]/bank/page.tsx — 56 commits, +621/-485 lines since 6 months ago
  • src/components/Global/IframeWrapper/index.tsx — CC 30, MI 66.71, SLOC 120
  • src/app/(mobile-ui)/qr-pay/page.tsx:101 — QRPayPage is 1504 lines — split it
  • src/app/(mobile-ui)/qr-pay/page.tsx:101 — QRPayPage: MDD 340.8 (uses across many lines from declarations)
  • src/app/(mobile-ui)/withdraw/manteca/page.tsx:101 — MantecaBankWithdrawFlow: MDD 249.2 (uses across many lines from declarations)
  • src/components/Profile/views/UnlockedRegions.view.tsx:64 — UnlockedRegions: MDD 90.1 (uses across many lines from declarations)
  • src/components/Global/IframeWrapper/index.tsx:18 — IframeWrapper: MDD 76.8 (uses across many lines from declarations)
  • src/components/Kyc/SumsubKycWrapper.tsx:28 — SumsubKycWrapper: MDD 66.3 (uses across many lines from declarations)
  • src/components/Kyc/SumsubKycWrapper.tsx:28 — SumsubKycWrapper: DLT 35 (calls 35 distinct functions — high context load)
  • src/components/Profile/views/UnlockedRegions.view.tsx:64 — UnlockedRegions: DLT 32 (calls 32 distinct functions — high context load)
  • src/components/Profile/views/UnlockedRegions.view.tsx:64 — CC 26 SLOC 123
  • src/app/actions/sumsub.ts — 24 commits, +220/-68 lines since 6 months ago
  • src/components/Kyc/SumsubKycWrapper.tsx:90 — : MDD 24.3 (uses across many lines from declarations)
  • app/(mobile-ui)/withdraw/manteca/page.tsx:757 — 21 duplicate lines / 122 tokens with app/(mobile-ui)/withdraw/manteca/page.tsx:866
  • src/components/Kyc/SumsubKycWrapper.tsx:71 — direct DOM: document.getElementById
  • src/components/Kyc/SumsubKycWrapper.tsx:77 — direct DOM: document.createElement

…and 10 more.

📈 Painscore deltas (top movers)

File Before After Δ
src/components/Kyc/SumsubKycWrapper.tsx 11.6 12.5 +0.9
src/components/Global/IframeWrapper/StartVerificationView.tsx 3.2 0.0 -3.2

@github-actions

Copy link
Copy Markdown
Contributor

🧪 UI test report — ✅ all green

Suites

  • unit: 1924 ran, 0 failed, 0 skipped, 32.8s

📊 Coverage (unit)

metric %
statements 58.7%
branches 42.5%
functions 47.4%
lines 59.0%
⏱ 10 slowest test cases
time test
3.6s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › never places two stickers in heavy overlap (broad seed sweep)
1.3s src/utils/__tests__/demo-api.test.ts › isDemoMode() is false when not running under Capacitor
0.4s 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 validateInviteCode
0.3s src/app/actions/__tests__/api-headers-extended.test.ts › should not include apiKey in validateInviteCode body
0.2s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › keeps stickers off the username pill (final pass respects the keep-out)
0.2s src/utils/__tests__/url.utils.test.ts › uses the public BASE_URL in Capacitor, not the localhost WebView origin
0.2s src/utils/__tests__/demo-balance.test.ts › auto-refills a wallet older than the TTL on cold start
0.2s src/utils/__tests__/demo-balance.test.ts › auto-refills a stored balance that has no timestamp (legacy install)
0.2s src/utils/__tests__/demo-balance.test.ts › starts at the full balance on a fresh install and stamps a timestamp
📍 Inline annotations are in the **Unit test report** check above. Coverage artifact: `coverage-unit`. Generated by `.github/workflows/tests.yml`.

@jjramirezn
jjramirezn merged commit a91e1a7 into dev Jul 14, 2026
22 of 26 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