Skip to content

feat(onboarding): add post-opt-in interest questionnaire (MMCPR-392)#30056

Merged
wachunei merged 12 commits into
mainfrom
feat/MMCPR-392-onboarding-interest-question
May 14, 2026
Merged

feat(onboarding): add post-opt-in interest questionnaire (MMCPR-392)#30056
wachunei merged 12 commits into
mainfrom
feat/MMCPR-392-onboarding-interest-question

Conversation

@wachunei

@wachunei wachunei commented May 12, 2026

Copy link
Copy Markdown
Member

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 generateDeterministicRandomNumber from @metamask/remote-feature-flag-controller with the MetaMetrics analytics id and compares it to a rollout threshold. MetaMetrics: Onboarding Interest Question Viewed on mount and Onboarding Interest Question Submitted on Continue (including selected_interests, item_count, and skipped when 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

Feature: Onboarding interest questionnaire after metrics opt-in

  Scenario: User with basic usage checked and in rollout sees the questionnaire
    Given a fresh install or cleared onboarding state
    When the user completes wallet creation through the metrics opt-in screen
    And "Gather basic usage data" remains checked
    And the user confirms opt-in
    Then the interest questionnaire may appear before the next onboarding step
    When the user selects one or more interests and taps Continue
    Then the app records submission and continues the onboarding flow

  Scenario: User with basic usage unchecked skips the questionnaire
    Given the user reaches the metrics opt-in screen
    When the user unchecks "Gather basic usage data" and confirms
    Then the questionnaire is not shown and onboarding continues as before

Screenshots/Recordings

Before

After

iphone_SE.mp4
Light Mode Dark Mode
questionnaire_light questionnaire_dark

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

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 under Routes.ONBOARDING.INTEREST_QUESTIONNAIRE in the onboarding stack.

Updates OptinMetrics so that after a user opts into basic usage metrics, the flow deterministically samples eligibility (via a new useOnboardingInterestQuestionnaireEligibility hook) and either navigates to the questionnaire (passing an onComplete callback and optional accountType) 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.

- 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
@wachunei wachunei added the team-mobile-ux Mobile UX team label May 12, 2026
@wachunei wachunei self-assigned this May 12, 2026
@metamaskbotv2 metamaskbotv2 Bot added the team-money-movement issues related to Money Movement features label May 12, 2026
@wachunei wachunei removed the team-money-movement issues related to Money Movement features label May 12, 2026
@wachunei wachunei marked this pull request as ready for review May 12, 2026 17:17
@wachunei wachunei requested a review from a team as a code owner May 12, 2026 17:17
Comment thread app/constants/navigation/Routes.ts
wachunei added 2 commits May 12, 2026 13:27
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
@github-actions github-actions Bot added size-XL and removed size-L labels May 12, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.47%. Comparing base (3751d9a) to head (e645d11).
⚠️ Report is 39 commits behind head on main.

Files with missing lines Patch % Lines
...e/useOnboardingInterestQuestionnaireEligibility.ts 12.50% 7 Missing ⚠️
...tQuestionnaire/OnboardingInterestQuestionnaire.tsx 91.66% 0 Missing and 3 partials ⚠️

❗ There is a different number of reports uploaded between BASE (3751d9a) and HEAD (e645d11). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (3751d9a) HEAD (e645d11)
2 1
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…; 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)
Comment thread app/components/UI/OptinMetrics/index.tsx
wachunei added 2 commits May 12, 2026 15:37
…rows

Wrap getShouldShowQuestionnaire in try/catch so continueNavigation still runs.
Log failures with Logger. Add navigation test for rejected eligibility.
wachunei added 4 commits May 13, 2026 09:10
- 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

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread app/components/Nav/App/App.test.tsx

@Cal-L Cal-L 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

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAccounts, SmokeConfirmations, SmokeIdentity, SmokeNetworkAbstractions, SmokeNetworkExpansion, SmokeSwap, SmokeStake, SmokeWalletPlatform, SmokeMoney, SmokePerps, SmokeMultiChainAPI, SmokePredictions, SmokeSeedlessOnboarding, SmokeBrowser, SmokeSnaps
  • Selected Performance tags: @PerformanceAccountList, @PerformanceOnboarding, @PerformanceLogin, @PerformanceSwaps, @PerformanceLaunch, @PerformanceAssetLoading, @PerformancePredict, @PerformancePreps
  • Risk Level: high
  • AI Confidence: %
click to see 🤖 AI reasoning details

E2E Test Selection:
Fallback: AI analysis did not complete successfully. Running all tests.

Performance Test Selection:
Fallback: AI analysis did not complete successfully. Running all performance tests.

View GitHub Actions results

@wachunei wachunei enabled auto-merge May 14, 2026 14:45
@sonarqubecloud

Copy link
Copy Markdown

@wachunei wachunei added this pull request to the merge queue May 14, 2026
Merged via the queue into main with commit 171fbc3 May 14, 2026
204 of 209 checks passed
@wachunei wachunei deleted the feat/MMCPR-392-onboarding-interest-question branch May 14, 2026 15:32
@github-actions github-actions Bot locked and limited conversation to collaborators May 14, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.78.0 Issue or pull request that will be included in release 7.78.0 label May 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.78.0 Issue or pull request that will be included in release 7.78.0 size-XL team-mobile-ux Mobile UX team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants