add doc-aware embed routing + sticky verification request - #2194
add doc-aware embed routing + sticky verification request#2194transphorm wants to merge 11 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughWebview boot routing now resolves document-aware destinations asynchronously, preserves request context across navigation, and shows MRZ scan status overlays during native camera scanning. The embed-mode spec and plans were expanded to define the ChangesDoc-aware embed routing (EM-02 Part A)
Bridge and onboarding scan overlays
Embed-mode specs and plans
Estimated code review effort: 4 (Complex) | ~60 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 3e4a6046-7eea-4ab9-bd25-2bfcf9df2c59
📒 Files selected for processing (11)
packages/webview-app/src/components/InitialRouteRedirect.tsxpackages/webview-app/src/providers/VerificationRequestProvider.tsxpackages/webview-app/src/screens/embed/TourScreen.tsxpackages/webview-app/src/utils/resolveEmbedEntry.tspackages/webview-app/tests/components/initialRouteRedirect.test.tsxpackages/webview-app/tests/providers/verificationRequestProvider.test.tsxpackages/webview-app/tests/utils/resolveEmbedEntry.test.tsspecs/projects/sdk/workstreams/webview-in-app/SPEC-MODES.htmlspecs/projects/sdk/workstreams/webview-in-app/embed-mode/SPEC.mdspecs/projects/sdk/workstreams/webview-in-app/embed-mode/plans/EM-01-getconfig-handler.mdspecs/projects/sdk/workstreams/webview-in-app/embed-mode/plans/EM-02-web-doc-aware-routing.md
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5c0ecf6189
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 9a15c44c-f0d3-4808-9b61-58fd2a0fbef6
📒 Files selected for processing (8)
packages/webview-app/src/providers/BridgeProvider.tsxpackages/webview-app/src/screens/onboarding/eu-id/ViewfinderRoute.tsxpackages/webview-app/src/screens/onboarding/passport/CodeScanViewfinderRoute.tsxpackages/webview-app/tests/flows/onboarding.euid-aadhaar.test.tsxpackages/webview-app/tests/flows/onboarding.passport.test.tsxpackages/webview-app/tests/providers/bridgeProvider.test.tsxpackages/webview-app/tests/screens/onboarding/mrzScanStatusOverlay.test.tsxpackages/webview-app/tests/utils/renderWithBridge.tsx
Summary
…/tunnel/tour/1?disclosures=…, which hits the catch-all route. It used to force-jump every such launch straight to/disclose/requestregardless of document state, so a first-time user with no registered document landed on the proof screen and failed (passport_data_not_found). The catch-all now checks the selected document first: registered →/disclose/request(unchanged), unregistered/unknown/error → onboarding (/tour/1).VerificationRequestProvidernow sticky-captures the request, so in-session onboarding navigation (which wipes the URL query) no longer losesdisclosures/userId/scopebefore the user reaches the proof request after registration.embed/TourScreenis extracted intoresolveEmbedEntryand reused by the catch-all, so the two boot paths can't drift.getConfig.Changes
WebView app
src/utils/resolveEmbedEntry.ts(new) — doc-aware entry decision: registered document →/disclose/request, otherwise the caller's onboarding fallback. Any failure to read document state falls toward onboarding (never into an unsatisfiable proof request).src/components/InitialRouteRedirect.tsx— catch-all is now doc-aware and async behind a loading state; on adisclosures/proofItemsparam it defers toresolveEmbedEntry(client, '/tour/1')instead of an unconditional jump. Entries without a request param still redirect to/.src/screens/embed/TourScreen.tsx— inline end-of-tour branch replaced with the shared helper (/capture/kycfallback, devmockParampreserved).src/providers/VerificationRequestProvider.tsx— sticky-capture the last parse that carried a request so in-session navigation can't drop it.Tests
resolveEmbedEntryunit tests (registered / unregistered / none / error / fallback pass-through).InitialRouteRedirectdoc-aware routing tests (registered → disclose w/ preserved query, unregistered → onboarding,proofItemskeying, no-param → home with no doc check).VerificationRequestProvidersticky-capture test (request survives query-wiping navigation) + empty baseline.Docs/specs
specs/.../webview-in-app/embed-mode/SPEC.md—getConfigbridge contract + embed-mode backlog (EM-01/02a/02b/03).embed-mode/plans/EM-01-getconfig-handler.md— SDKgetConfighandler plan (code lands in theself-webview-sdkrepo, PR Updated circuit #26).embed-mode/plans/EM-02-web-doc-aware-routing.md— this work (Part A) + Part B (post-EM-01getConfigconsumption).SPEC-MODES.html— minor contract note.Linear Issues
Related embed-mode backlog: SELF-3395 (EM-01,
self-webview-sdkPR #26) · SELF-3397 (EM-02b) · SELF-3398 (EM-03)Scope notes
getConfig(separate repo, still in PR Updated circuit #26), so per the spec it follows the demo. Part B will refactorparseVerificationRequestContextto a structured input and switch embed screens to read from context.getConfighandler lives inself-webview-sdk.Test Plan
pnpm --filter @selfxyz/webview-app typespassespnpm --filter @selfxyz/webview-app testpasses (237 tests)pnpm --filter @selfxyz/webview-app buildsucceedspnpm --filter @selfxyz/webview-app lintpasses (--max-warnings=0)/disclose/requestwith the request intact; with a registered document, launch goes straight to/disclose/request.🤖 Generated with Claude Code
Summary by CodeRabbit
disclosures/proofItems.lifecycle.getConfigcontract and routing requirements.