feat(onboarding): add post-opt-in interest questionnaire (MMCPR-392)#30056
Conversation
- Optional questionnaire after metrics opt-in when basic usage is on and rollout eligible - MetaMetrics viewed/submitted events; deterministic sampling via generateDeterministicRandomNumber - Routes, OptinMetrics branch, DS screen, i18n, assets, unit tests
Restores Routes.MONEY.MODALS.MONEY_BALANCE_INFO_SHEET used by Money modals; fixes lint:tsc.
- Unit tests for useOnboardingInterestQuestionnaireEligibility (id empty, threshold branches) - Questionnaire tests for account_type on Viewed/Submitted - OptinMetrics navigation test for accountType param; useSelector uses full root state - App.test mock for OnboardingInterestQuestionnaire screen
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #30056 +/- ##
===========================================
- Coverage 81.54% 70.47% -11.07%
===========================================
Files 5343 5360 +17
Lines 142128 142590 +462
Branches 32411 32538 +127
===========================================
- Hits 115899 100494 -15405
- Misses 18299 34564 +16265
+ Partials 7930 7532 -398 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…; fix OptinMetrics tests - Add BackHandler (silent) and gestureEnabled: false to avoid returning to OptinMetrics - Require OnboardingInterestQuestionnaire route params in RootStackParamList - Mock eligibility + valid UUID analytics id in OptinMetrics tests (hex id error)
…rows Wrap getShouldShowQuestionnaire in try/catch so continueNavigation still runs. Log failures with Logger. Add navigation test for rejected eligibility.
- App: assert OnboardingNav can show interest questionnaire route - OptinMetrics navigation: cover Logger paths for Error and non-Error throws - Questionnaire: BackHandler, Android Platform branch, Viewed without account_type - Eligibility hook: use renderHook from @testing-library/react-native
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 91e39bb. Configure here.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Performance Test Selection: |
|




Description
After users opt in to basic usage metrics on the onboarding privacy screen, this change optionally routes them to a short interest questionnaire (multi-select, design-system UI) when they pass eligibility sampling. If basic usage data is unchecked, navigation is unchanged.
Eligibility uses
generateDeterministicRandomNumberfrom@metamask/remote-feature-flag-controllerwith the MetaMetrics analytics id and compares it to a rollout threshold. MetaMetrics:Onboarding Interest Question Viewedon mount andOnboarding Interest Question Submittedon Continue (includingselected_interests,item_count, andskippedwhen the user continues with no selection).Adds route/screen wiring, i18n (
en.json), option imagery, and unit tests for the screen and OptinMetrics navigation.Figma: https://www.figma.com/design/z0panHXrMSMUSof2SaPkd4/Home-2026?node-id=10434-81757&m=dev
Changelog
CHANGELOG entry: Added an optional onboarding interest questionnaire after metrics opt-in for eligible users.
Related issues
Refs: MMCPR-392
Manual testing steps
Screenshots/Recordings
Before
After
iphone_SE.mp4
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
Changes onboarding navigation after metrics opt-in and adds new analytics events, so regressions could block onboarding progression or affect tracking/consent behavior. Logic is gated by deterministic sampling and covered by new unit tests, reducing risk.
Overview
Adds a new onboarding screen,
OnboardingInterestQuestionnaire, and registers it underRoutes.ONBOARDING.INTEREST_QUESTIONNAIREin the onboarding stack.Updates
OptinMetricsso that after a user opts into basic usage metrics, the flow deterministically samples eligibility (via a newuseOnboardingInterestQuestionnaireEligibilityhook) and either navigates to the questionnaire (passing anonCompletecallback and optionalaccountType) or continues onboarding as before; eligibility check failures are logged and fall back to continuing.Introduces two new MetaMetrics events for the questionnaire (Viewed on mount and Submitted on continue with selected interests/skipped metadata), adds English i18n strings, and expands test coverage (new screen tests plus OptinMetrics navigation-branch tests and route registration assertions).
Reviewed by Cursor Bugbot for commit f5bd26c. Bugbot is set up for automated code reviews on this repo. Configure here.