Skip to content

fix(rewards): Update mUSD calculator input max to 10M#30202

Merged
Montoya merged 1 commit into
mainfrom
musd-calculator-remove-maxes
May 14, 2026
Merged

fix(rewards): Update mUSD calculator input max to 10M#30202
Montoya merged 1 commit into
mainfrom
musd-calculator-remove-maxes

Conversation

@sophieqgu

@sophieqgu sophieqgu commented May 14, 2026

Copy link
Copy Markdown
Contributor

Description

  • Split mUSD calculator input max from slider max:
    -- text input now accepts up to 10,000,000
    -- slider scale remains capped at 10,000
  • Added compact yearly earnings formatting when the input amount is >= 100,000.
  • When typed input is above the slider max, the slider stays visually pinned to the right. Touching or dragging the slider brings the amount back onto the slider scale.
Simulator.Screen.Recording.-.E2E.Test.-.2026-05-14.at.13.45.30.mov

Changelog

CHANGELOG entry: null

Related issues

Fixes:

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

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: localized UI/input/formatting changes to the Rewards mUSD calculator with updated tests; no auth, network, or persistence logic touched.

Overview
The mUSD Rewards calculator now accepts typed amounts up to 10,000,000 while keeping the slider scale capped at 10,000, with the slider thumb visually pinned at max when the typed value exceeds the slider range and returning to slider scale on the next slider interaction.

Yearly earnings display switches to compact USD formatting (e.g., $123K) when the input amount is >= 100,000, enabled by extending formatCompactUsd to support an optional maximumFractionDigits setting.

Tests are updated/added to cover the new input cap behavior, slider resync behavior, and compact earnings formatting.

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

@sophieqgu sophieqgu requested a review from a team as a code owner May 14, 2026 17:46
@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.

@metamaskbotv2 metamaskbotv2 Bot added the team-rewards Rewards team label May 14, 2026
@sophieqgu sophieqgu changed the title Update input max to 10M fix(rewards): Update mUSD calculator input max to 10M May 14, 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: 95%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes are entirely contained within the Rewards/mUSD calculator UI component and its utility functions:

  1. formatUtils.ts: Backward-compatible enhancement to formatCompactUsd() adding an optional maximumFractionDigits option. Default behavior is preserved.

  2. MusdCalculatorTab.tsx: UI display improvements - decoupling input max from slider max, and using compact formatting for large yearly earnings values. No changes to navigation, state management, or shared infrastructure.

  3. Both test files are unit tests only - no E2E test files are involved.

No E2E tests exist for the mUSD calculator specifically, and these changes don't affect any shared components (navigation, modals, confirmations, browser, accounts) that would cause existing E2E tests to break. The changes are purely cosmetic/display improvements within a self-contained feature component. No E2E tags are warranted.

Performance Test Selection:
No performance-sensitive code paths are affected. Changes are limited to display formatting logic (compact number formatting) and UI state management within a single calculator component. No list rendering, data fetching, state management, or app initialization changes are present.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@Montoya Montoya added this pull request to the merge queue May 14, 2026
Merged via the queue into main with commit 5d661e9 May 14, 2026
80 of 88 checks passed
@Montoya Montoya deleted the musd-calculator-remove-maxes branch May 14, 2026 19:04
@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-M team-rewards Rewards team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants