Skip to content

feat: MUSD-673 conditionally render Money hub via feature flag#28934

Merged
Matt561 merged 8 commits into
mainfrom
feat/musd-673-create-feature-flag-for-money-hub
Apr 16, 2026
Merged

feat: MUSD-673 conditionally render Money hub via feature flag#28934
Matt561 merged 8 commits into
mainfrom
feat/musd-673-create-feature-flag-for-money-hub

Conversation

@Matt561
Copy link
Copy Markdown
Contributor

@Matt561 Matt561 commented Apr 16, 2026

Description

Adds new selectMoneyHubEnabledFlag selector to control conditional rendering of the new Money hub screen.

Changelog

CHANGELOG entry: added new selectMoneyHubEnabledFlag selector to control conditional rendering of the new Money hub screen.

Related issues

Fixes: MUSD-673: Create feature flag for Money Hub

Manual testing steps

Feature: Money Hub feature flag

  Scenario: user with Money Hub enabled sees the full view
    Given the MM_MONEY_HUB_ENABLED remote feature flag is enabled

    When user navigates to the Cash Tokens full view
    Then the Money Hub component is rendered

  Scenario: user with Money Hub disabled sees the fallback
    Given the MM_MONEY_HUB_ENABLED remote feature flag is disabled

    When user navigates to the Cash Tokens full view
    Then the Money Hub component is not rendered

Screenshots/Recordings

Before

Money hub always rendered

After

When enabled
image

When disabled

image

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
Feature-flag-gated UI rendering changes with no new data handling or critical logic; primary risk is accidentally hiding/showing Money Hub sections due to flag wiring.

Overview
Adds a new selectMoneyHubEnabledFlag selector (remote version-gated flag with MM_MONEY_HUB_ENABLED env fallback) and registers the corresponding remote flag earnMoneyHubEnabled for test defaults.

Updates CashTokensFullView to conditionally render the bonus/convert sections and bottom CTAs (Convert vs Swap/Buy) only when Money Hub is enabled, with expanded unit tests covering the enabled/disabled UI states and CTA behavior.

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

@Matt561 Matt561 added No QA Needed Apply this label when your PR does not need any QA effort. team-earn labels Apr 16, 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.

@Matt561 Matt561 marked this pull request as ready for review April 16, 2026 16:55
@Matt561 Matt561 requested a review from a team as a code owner April 16, 2026 16:55
@Matt561 Matt561 changed the title feat: MUSD-673 create feature flag for money hub feat: MUSD-673 conditionally render Money hub via feature flag Apr 16, 2026
Comment thread app/components/UI/Money/selectors/featureFlags.ts Outdated
@Matt561 Matt561 force-pushed the feat/musd-673-create-feature-flag-for-money-hub branch from 6feb802 to 9be2c69 Compare April 16, 2026 16:59
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 9047abf. Configure here.

Comment thread app/components/UI/Money/selectors/featureFlags.test.ts Outdated
@github-actions github-actions Bot added the risk-low Low testing needed · Low bug introduction risk label Apr 16, 2026
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Apr 16, 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: 88%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes in this PR are:

  1. New feature flag earnMoneyHubEnabled added to the feature flag registry with inProd: false and enabled: false as defaults - this flag is disabled by default in production and in E2E test environments.

  2. New Redux selector selectMoneyHubEnabledFlag that reads the new remote feature flag with a local env var fallback (MM_MONEY_HUB_ENABLED=false).

  3. CashTokensFullView UI gating: The bonus/convert sections and CTA buttons (Convert/Swap/Buy) are now conditionally rendered based on isMoneyHubEnabled. Since the flag defaults to false, these sections are hidden by default - meaning the component now renders LESS UI than before.

  4. .js.env.example and unit test files updated accordingly.

Why no E2E tags are needed:

  • The feature flag is disabled by default (inProd: false, enabled: false), so E2E tests running against the app will see the same behavior as before (the bonus/convert sections were already not visible in test environments without the flag)
  • No existing E2E tests reference CashTokensFullView or the Money Hub feature
  • The changes are purely additive (new flag, new selector, conditional rendering) with no modifications to existing functionality
  • No shared components (navigation, modals, confirmations, TabBar) are affected
  • The feature flag registry change only adds a new entry without modifying existing flags
  • Unit tests provide adequate coverage for the new selector and component behavior

Performance Test Selection:
The changes are purely additive UI gating behind a disabled feature flag. No performance-sensitive code paths (rendering loops, data fetching, state management at scale, app startup) are affected. The CashTokensFullView actually renders LESS UI when the flag is disabled (default), which would only improve performance marginally. No performance tests are warranted.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

@Matt561 Matt561 added this pull request to the merge queue Apr 16, 2026
Merged via the queue into main with commit aed2881 Apr 16, 2026
65 checks passed
@Matt561 Matt561 deleted the feat/musd-673-create-feature-flag-for-money-hub branch April 16, 2026 17:56
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 16, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.74.0 Issue or pull request that will be included in release 7.74.0 label Apr 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

No QA Needed Apply this label when your PR does not need any QA effort. release-7.74.0 Issue or pull request that will be included in release 7.74.0 risk-low Low testing needed · Low bug introduction risk size-M team-earn

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants