Skip to content

refactor: remove StartVerificationView interstitial#2410

Closed
jjramirezn wants to merge 2 commits into
devfrom
refactor/remove-start-verification-view
Closed

refactor: remove StartVerificationView interstitial#2410
jjramirezn wants to merge 2 commits into
devfrom
refactor/remove-start-verification-view

Conversation

@jjramirezn

@jjramirezn jjramirezn commented Jul 13, 2026

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.

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).
@vercel

vercel Bot commented Jul 13, 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 12:25am

Request Review

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The KYC flow now starts directly when its SDK prerequisites are ready. Separate verification start views and autoStart/autoStartSdk props were removed, iframe ToS wiring was simplified, and KYC retry entry points use the standard start handler.

Changes

KYC flow simplification

Layer / File(s) Summary
Direct iframe and SDK initialization
src/components/Global/IframeWrapper/index.tsx, src/components/Kyc/SumsubKycWrapper.tsx
Removes the separate verification start view and auto-start state, initializes verification directly when visible and ready, and simplifies exit confirmation copy.
Modal and ToS integration
src/components/Kyc/SumsubKycModals.tsx, src/components/Kyc/BridgeTosStep.tsx, src/components/Kyc/KycStatusDrawer.tsx
Removes autoStartSdk and skipStartView wiring while preserving existing flow and visibility connections.
KYC entry-point updates
src/app/(mobile-ui)/..., src/components/Profile/views/UnlockedRegions.view.tsx, src/features/limits/components/IncreaseLimitsButton.tsx, src/components/Card/cardApply.utils.ts
Removes obsolete auto-start props, adds multi-level configuration to the Manteca flow, routes retries through the standard KYC start handler, and updates related polling documentation.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested labels: enhancement

Suggested reviewers: hugo0

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly matches the main change: removing the StartVerificationView interstitial.
Description check ✅ Passed The description is directly related and accurately summarizes the KYC interstitial removal and related cleanup.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Code-analysis diff

Painscore total: 6128.22 → 6121.26 (-6.96)
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 — 68 commits, +611/-371 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.53, SLOC 111
  • 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 — 67 commits, +611/-370 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.8, SLOC 119
  • 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/components/Kyc/SumsubKycWrapper.tsx:90 — : MDD 24.3 (uses across many lines from declarations)
  • src/hooks/useMultiPhaseKycFlow.ts — 23 commits, +535/-109 lines since 6 months ago
  • 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.7 12.5 +0.9
src/components/Global/IframeWrapper/StartVerificationView.tsx 2.7 0.0 -2.7

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

🧪 UI test report — ✅ all green

Suites

  • unit: 1837 ran, 0 failed, 0 skipped, 31.1s

📊 Coverage (unit)

metric %
statements 57.9%
branches 42.0%
functions 47.1%
lines 58.0%
⏱ 10 slowest test cases
time test
4.5s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › never places two stickers in heavy overlap (broad seed sweep)
0.6s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › every sticker stays within canvas at any count
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 › keeps stickers off the username pill (final pass respects the keep-out)
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/components/Global/GeneralRecipientInput/__tests__/GeneralRecipientInput.test.tsx › should handle valid Italian IBAN
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 ETH address with surrounding spaces
0.1s src/components/Global/GeneralRecipientInput/__tests__/GeneralRecipientInput.test.tsx › should handle invalid ETH address (invalid characters)
📍 Inline annotations are in the **Unit test report** check above. Coverage artifact: `coverage-unit`. Generated by `.github/workflows/tests.yml`.

- 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.
@jjramirezn
jjramirezn marked this pull request as ready for review July 14, 2026 10:35
@jjramirezn
jjramirezn requested a review from Hugo0 July 14, 2026 10:35

@kushagrasarathe kushagrasarathe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jjramirezn

Copy link
Copy Markdown
Contributor Author

Superseded by #2411 — the signed-commits ruleset rejects any update to this branch that carries dev's unsigned mobile-release commits (GH013), so the dev merge + conflict resolution had to land on a fresh branch. Closing.

@jjramirezn jjramirezn closed this Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants