Skip to content

feat(support): adopt support consent flow in RewardsVipRefereeView and LinkedOffDeviceAccountsSheet - #33520

Merged
NicolasMassart merged 33 commits into
mainfrom
MCWP-684-support-consent-rewards
Jul 27, 2026
Merged

feat(support): adopt support consent flow in RewardsVipRefereeView and LinkedOffDeviceAccountsSheet#33520
NicolasMassart merged 33 commits into
mainfrom
MCWP-684-support-consent-rewards

Conversation

@NicolasMassart

@NicolasMassart NicolasMassart commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Description

Adopts the support-consent mechanism introduced by the core PR (#33424) in the two @MetaMask/rewards-owned "Contact support" call sites:

  • RewardsVipRefereeView: the priority support webview link now routes through useSupportConsent().openSupportWithConsent (falls back to the direct beta Intercom URL when the beta build flag is set).
  • LinkedOffDeviceAccountsSheet: the "let us know" contact-support action now routes through the same consent flow (same beta fallback behavior).

This PR is part of a stacked PR series on top of the core support-consent PR (#33424, MCWP-684-support-consent-core). Its base will be retargeted to main once #33424 merges.

Changelog

CHANGELOG entry: null

(Behavior already described in the core PR, #33424.)

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/MCWP-684

Manual testing steps

Feature: Support consent on rewards contact-support flows

  Scenario: user taps "Contact support" from the VIP referee view
    Given the user is on the Rewards VIP referee view

    When user taps "Contact support"
    Then the support consent sheet is shown before the support webview opens

  Scenario: user taps "let us know" from the linked off-device accounts sheet
    Given the user has opened the linked off-device accounts sheet

    When user taps "let us know"
    Then the support consent sheet is shown before the support webview opens

Screenshots/Recordings

Before

N/A

After

N/A

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.

Made with Cursor

NicolasMassart and others added 8 commits July 16, 2026 15:50
Adds the support consent sheet, hook, util, route, and ownerless
call sites (Compliance context, ReviewModal, ErrorBoundary,
Homepage MoreSection) that team-owned PRs will stack on.

Co-authored-by: Cursor <cursoragent@cursor.com>
Adds a real assertion inside the submit-feedback waitFor and restores
spies after each test, per flaky-test-detection bot suggestions on PR #33424.

Co-authored-by: Cursor <cursoragent@cursor.com>
The prior en.json checkout came from a stale branch and clobbered
translation keys added to main since, breaking unrelated unit tests
in CI. Re-applies only the support_consent strings on top of main's
current en.json.

Co-authored-by: Cursor <cursoragent@cursor.com>
…et prop for support contact

This update modifies the ErrorBoundary component to eliminate the use of the useSupportConsent hook, which was causing issues when rendering at the root boundary outside of NavigationProvider. Instead, it now utilizes an openTicket prop to handle support contact actions. Additionally, the corresponding tests have been updated to reflect this change, ensuring that the new behavior is correctly validated.

The support URL handling in the navigateToSupportConsent function has also been adjusted to open the raw base URL without appending device details, aligning with user consent preferences.
…ions

Addresses Copilot review comments on PR #33424: OpenSupportUrl now
allows Promise<void> to match async openers like Linking.openURL, and
onConfirm/onReject await open() in a try/catch so a rejected opener
can't surface as an unhandled promise rejection.

Co-authored-by: Cursor <cursoragent@cursor.com>
…d LinkedOffDeviceAccountsSheet

Co-authored-by: Cursor <cursoragent@cursor.com>
@NicolasMassart NicolasMassart self-assigned this Jul 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@github-actions github-actions Bot added the pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. label Jul 20, 2026
@metamask-ci metamask-ci Bot added the team-mobile-platform Mobile Platform team label Jul 20, 2026
@NicolasMassart NicolasMassart changed the title feat(rewards): adopt support consent flow in RewardsVipRefereeView and LinkedOffDeviceAccountsSheet feat(support): adopt support consent flow in RewardsVipRefereeView and LinkedOffDeviceAccountsSheet Jul 20, 2026
NicolasMassart and others added 7 commits July 21, 2026 13:59
…ipRefereeView and LinkedOffDeviceAccountsSheet

Extracts the beta-build support URL check into a shared getBetaSupportUrl()
helper so the consent-flow branch (previously unreachable under Jest, since
///: ONLY_INCLUDE_IF(beta) code fences are only stripped by Metro at build
time) can be exercised via module mocking in both call sites.

Adds test cases covering: the non-beta branch routing through
openSupportWithConsent with the correct URL, the opener callback correctly
navigating to the webview, and both branches of the beta/non-beta condition.

Co-authored-by: Cursor <cursoragent@cursor.com>
… with the consent sheet flow

Co-authored-by: Cursor cursoragent@cursor.com
…t flow

Lets call sites record their support opened analytics event when the user actually opens support (on consent confirm/reject), instead of when the consent sheet is merely shown.

Co-authored-by: Cursor cursoragent@cursor.com
…er glue

Trim RewardsVipRefereeView and LinkedOffDeviceAccountsSheet tests to assert the consent sheet opens with the expected base URL, plus one opener-invoke test per call site for the newly-added opener wiring. Confirm/reject mechanics are already covered by core PR #33424.

Co-authored-by: Cursor <cursoragent@cursor.com>
NicolasMassart and others added 9 commits July 22, 2026 14:55
…opens

Bugbot flagged that onOpenSupport fired synchronously on confirm/reject,
before the async open() call resolved, so analytics could record
"support opened" even when opening later failed. onOpenSupport is now
threaded into confirmSupportConsent/rejectSupportConsent and fired only
after open() succeeds.

Co-authored-by: Cursor <cursoragent@cursor.com>
Base automatically changed from MCWP-684-support-consent-core to main July 23, 2026 18:01
@metamask-ci

metamask-ci Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

PR template — items to address before "Ready for review"

Warnings — informational, address before merging:

  • Pre-merge author checklist has unchecked items (e.g. "I've tested on Android"). Every box must be consciously checked — see docs/readme/ready-for-review.md.

See docs/readme/ready-for-review.md for the full Definition of Ready for Review.

@NicolasMassart
NicolasMassart marked this pull request as ready for review July 24, 2026 10:13
@NicolasMassart
NicolasMassart requested a review from a team as a code owner July 24, 2026 10:13

@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 cefb2e0. Configure here.

Comment thread app/components/UI/Rewards/Views/RewardsVipRefereeView.tsx Outdated
@github-actions github-actions Bot added the risk:medium AI analysis: medium risk label Jul 24, 2026
Move get-help analytics tracking into the support-consent open callback so the event fires only when support is actually opened.
@github-actions github-actions Bot added risk:low AI analysis: low risk and removed risk:medium AI analysis: medium risk labels Jul 24, 2026
@NicolasMassart NicolasMassart removed the pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. label Jul 24, 2026
@github-actions github-actions Bot added risk:medium AI analysis: medium risk and removed risk:low AI analysis: low risk labels Jul 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 90%
click to see 🤖 AI reasoning details

E2E Test Selection:
The PR changes are confined to the Rewards feature area (RewardsVipRefereeView, LinkedOffDeviceAccountsSheet, and utils.ts). The changes are a refactoring of support URL logic: extracting inline beta code fence logic (ONLY_INCLUDE_IF(beta)) into a testable utility function getBetaSupportUrl() and integrating the existing useSupportConsent hook for the non-beta path. No new user-facing flows are introduced; behavior is functionally equivalent. There are no existing E2E smoke tests for the Rewards feature area (confirmed by grep). The useSupportConsent hook itself is not modified. All changes are accompanied by unit tests. No shared components (TabBar, navigation, modals, confirmations) are affected in a breaking way. This is a low-risk internal refactoring with no E2E test coverage gap to fill.

Performance Test Selection:
The changes are a refactoring of support URL logic within the Rewards feature. No performance-sensitive flows (app launch, login, onboarding, swaps, asset loading, account list, perps, predictions) are affected. No performance tests are warranted.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@NicolasMassart
NicolasMassart added this pull request to the merge queue Jul 27, 2026
@github-project-automation github-project-automation Bot moved this from Needs dev review to Review finalised - Ready to be merged in PR review queue Jul 27, 2026
Merged via the queue into main with commit 973c6fc Jul 27, 2026
134 of 135 checks passed
@NicolasMassart
NicolasMassart deleted the MCWP-684-support-consent-rewards branch July 27, 2026 14:49
@github-project-automation github-project-automation Bot moved this from Review finalised - Ready to be merged to Merged, Closed or Archived in PR review queue Jul 27, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 27, 2026
@metamask-ci metamask-ci Bot added the release-8.6.0 Issue or pull request that will be included in release 8.6.0 label Jul 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-8.6.0 Issue or pull request that will be included in release 8.6.0 risk:medium AI analysis: medium risk size-M team-mobile-platform Mobile Platform team

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants