Skip to content

feat: Update musd calculator#27949

Merged
Montoya merged 6 commits into
mainfrom
update-musd-calculator
Mar 25, 2026
Merged

feat: Update musd calculator#27949
Montoya merged 6 commits into
mainfrom
update-musd-calculator

Conversation

@Montoya

@Montoya Montoya commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

Description

This PR provides some minor fixes and improvements to the mUSD calculator:

  • Guard against / set default value for a variable
  • Use swap navigation instead of deeplink for reduced friction
  • Move the disclaimer to the bottom of the page content

Changelog

CHANGELOG entry: null

Related issues

Fixes: n/a

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Simulator Screenshot - iPhone 16e - 2026-03-25 at 16 09 28

Pre-merge author checklist

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
Medium risk because it changes the mUSD swap action from a deeplink to in-app swap navigation and adjusts rewards state rehydration/selectors to tolerate missing campaign status data, which could affect routing and campaign UI behavior if misconfigured.

Overview
Updates the mUSD calculator header to use a new localized rewards.musd.page_title string and tweaks layout by moving the disclaimer to the bottom with updated styling.

Replaces the Swap button’s deeplink (link.metamask.io/swap) with in-app swap navigation via useSwapBridgeNavigation, preconfiguring ETH→mUSD tokens, and updates tests accordingly.

Hardens Rewards redux state handling by defaulting campaignParticipantStatuses to {} on rehydrate and making related selectors null-safe, preventing crashes when the field is missing from persisted payloads.

Written by Cursor Bugbot for commit fc1814e. This will update automatically on new commits. Configure here.

@Montoya Montoya requested a review from a team as a code owner March 25, 2026 20:10
@Montoya Montoya added size-XS team-rewards Rewards team release-7.72.0 Issue or pull request that will be included in release 7.72.0 labels Mar 25, 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 size-S risk-low Low testing needed · Low bug introduction risk and removed size-XS labels Mar 25, 2026
@Montoya Montoya enabled auto-merge March 25, 2026 20:18
@github-actions github-actions Bot added risk-medium Moderate testing recommended · Possible bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Mar 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Schema is up to date
17 value mismatches detected (expected — fixture represents an existing user).
View details

@Montoya Montoya changed the title Feat: Update musd calculator feat: Update musd calculator Mar 25, 2026
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 25, 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 PR contains the following changes:

  1. MusdCalculatorView.tsx: Minor string key change for the header title (rewards.musd.titlerewards.musd.page_title).

  2. MusdCalculatorTab.tsx: Refactored the swap button from a deeplink URL approach to using the useSwapBridgeNavigation hook (standard pattern used across the app). Also moved/restyled the disclaimer section. No shared components affected.

  3. app/reducers/rewards/index.ts: Defensive null-safety fix - added ?? {} fallback for campaignParticipantStatuses during Redux rehydration. This prevents potential crashes but doesn't change normal behavior.

  4. app/reducers/rewards/selectors.ts: Added optional chaining (?.) to two selectors for campaignParticipantStatuses. Pure defensive fix.

  5. Locale files (20 languages): Additive change - added a new page_title key to the rewards.musd section.

Why no E2E tags are selected:

  • No E2E tests exist for the Rewards/mUSD calculator feature in the test suite (confirmed by searching)
  • Changes are isolated to the Rewards feature UI and its Redux state management
  • The reducer/selector changes are purely defensive null-safety fixes that don't alter normal behavior
  • The swap navigation change uses the existing useSwapBridgeNavigation hook without modifying it - only the entry point changes (from deeplink to hook-based navigation)
  • No shared components (TabBar, Browser, Modals, Confirmations) are affected
  • No critical paths (Engine, controllers, navigation infrastructure) are touched
  • Locale changes are purely additive (new key only, no existing keys modified)

The risk is low and no existing E2E tests cover this specific feature area.

Performance Test Selection:
No performance-sensitive code is changed. The modifications are limited to Rewards UI components (mUSD calculator), minor Redux defensive fixes, and additive locale strings. No rendering-heavy components, list rendering, state management at scale, or critical user flows (login, swap execution, asset loading) are affected.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@Montoya Montoya added this pull request to the merge queue Mar 25, 2026
Merged via the queue into main with commit bcf7f71 Mar 25, 2026
64 of 66 checks passed
@Montoya Montoya deleted the update-musd-calculator branch March 25, 2026 21:53
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.72.0 Issue or pull request that will be included in release 7.72.0 risk-low Low testing needed · Low bug introduction risk size-S team-rewards Rewards team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants