Skip to content

refactor(rewards): use MMDS HeaderStandard#29706

Merged
brianacnguyen merged 5 commits into
mainfrom
refactor/headerstandard-titles-rewards
May 7, 2026
Merged

refactor(rewards): use MMDS HeaderStandard#29706
brianacnguyen merged 5 commits into
mainfrom
refactor/headerstandard-titles-rewards

Conversation

@brianacnguyen
Copy link
Copy Markdown
Contributor

@brianacnguyen brianacnguyen commented May 5, 2026

Description

This PR replaces HeaderCompactStandard with HeaderStandard from @metamask/design-system-react-native across Rewards screens and related sheets, and updates unit tests to match.

Reason: Align Rewards with the MetaMask design system and reduce use of component-library/components-temp for standard headers.

Changelog

CHANGELOG entry: null

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/DSYS-703

Manual testing steps

Feature: Rewards headers use design system HeaderStandard

  Scenario: Benefits and campaigns
    Given the user opens Rewards benefits (list or single benefit), campaigns list, or campaign mechanics
    When they use the header back control and read titles
    Then navigation and copy match prior behavior

  Scenario: Ondo and Season One campaign flows
    Given the user opens Ondo campaign details, portfolio, or Season One campaign details
    When they navigate back from the header
    Then behavior matches the previous implementation

  Scenario: Rewards settings and auxiliary sheets
    Given the user opens Rewards settings, referral, MUSD calculator, end-of-season claim, linked off-device accounts, opt-in modal, or environment toggle surfaces touched by this PR
    When they dismiss or navigate via the header
    Then sheets and screens behave as before

Screenshots/Recordings

Before

After

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

Low Risk
Low risk refactor limited to UI header component swaps and corresponding test updates; main risk is minor visual/layout or testID regressions affecting navigation/back-button automation.

Overview
Rewards screens and sheets now use MMDS HeaderStandard instead of the legacy HeaderCompactStandard component, including benefits, campaigns, referral, settings, calculators, and multiple bottom sheets/modals.

Unit tests were updated to remove HeaderCompactStandard mocks, align back/close button testIDs (e.g., campaign mechanics/details), and add missing Safe Area hook stubs (notably useSafeAreaInsets) so HeaderStandard can render cleanly in Jest.

Reviewed by Cursor Bugbot for commit d6a8c44. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-authored-by: Cursor <cursoragent@cursor.com>
@brianacnguyen brianacnguyen self-assigned this May 5, 2026
@brianacnguyen brianacnguyen added the No QA Needed Apply this label when your PR does not need any QA effort. label May 5, 2026
@brianacnguyen brianacnguyen requested a review from a team as a code owner May 5, 2026 05:34
@brianacnguyen brianacnguyen added team-design-system All issues relating to design system in Mobile no changelog required No changelog entry is required for this change labels May 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

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 size-L label May 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

🔍 Smart E2E Test Selection

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

E2E Test Selection:
All 31 changed files are confined to the app/components/UI/Rewards/ directory. The changes are a pure component migration: replacing HeaderCompactStandard (a temporary component from component-library/components-temp/) with HeaderStandard (from @metamask/design-system-react-native) across multiple Rewards views and components (BenefitFullView, CampaignsView, CampaignMechanicsView, MusdCalculatorView, OndoCampaignDetailsView, OndoCampaignPortfolioView, RewardsReferralView, RewardsSettingsView, SeasonOneCampaignDetailsView, CampaignViewHeader, EndOfSeasonClaimBottomSheet, LinkedOffDeviceAccountsSheet, RewardOptInAccountGroupModal, RewardsEnvironmentToggle). The functionality is identical — back/close buttons and title display remain the same. No shared components, controllers, navigation, or Engine code is touched. Searching for 'rewards' in .spec.ts files returned zero results, confirming there are no E2E tests for the Rewards feature. The Rewards feature is not covered by any of the available E2E test tags. HeaderCompactStandard remains in use in Perps and Trending components (unchanged in this PR), so those tests are unaffected. This is a low-risk cosmetic refactor with no E2E test coverage needed.

Performance Test Selection:
The changes are a pure header component swap (HeaderCompactStandard → HeaderStandard) within the Rewards feature. There is no impact on data loading, state management, list rendering, animations, or any performance-sensitive code paths. No performance tests are warranted.

View GitHub Actions results

Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

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 d6a8c44. Configure here.

testID={REWARDS_VIEW_SELECTORS.DETAIL_BENEFIT_VIEW}
>
<HeaderCompactStandard
<HeaderStandard
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.

includesTopInset prop likely ignored by HeaderStandard

High Severity

Multiple views pass includesTopInset to HeaderStandard, but this prop was specific to the HeaderRoot/HeaderCompactStandard component in components-temp. Existing HeaderStandard usages elsewhere in the codebase (MoneyHeader, PerpsHomeHeader) never use includesTopInset, and no evidence of this prop exists in the design-system package. The affected views (BenefitFullView, BenefitsFullView, CampaignMechanicsView, CampaignsView, OndoCampaignDetailsView, RewardsReferralView, SeasonOneCampaignDetailsView) use SafeAreaView with edges={{ bottom: 'additive' }}, relying entirely on the header for top safe-area inset handling. If HeaderStandard silently ignores includesTopInset, header content will render under the status bar / notch on iOS devices.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d6a8c44. Configure here.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 6, 2026

@brianacnguyen brianacnguyen added this pull request to the merge queue May 7, 2026
Merged via the queue into main with commit 89911ca May 7, 2026
60 checks passed
@brianacnguyen brianacnguyen deleted the refactor/headerstandard-titles-rewards branch May 7, 2026 17:39
@github-actions github-actions Bot locked and limited conversation to collaborators May 7, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.77.0 Issue or pull request that will be included in release 7.77.0 label May 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no changelog required No changelog entry is required for this change No QA Needed Apply this label when your PR does not need any QA effort. release-7.77.0 Issue or pull request that will be included in release 7.77.0 size-L team-design-system All issues relating to design system in Mobile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants