Skip to content

feat: add "Your bonus" section to mUSD asset page#28479

Merged
shane-t merged 5 commits into
MetaMask:mainfrom
margelo:kureev/MUSD-578
Apr 8, 2026
Merged

feat: add "Your bonus" section to mUSD asset page#28479
shane-t merged 5 commits into
MetaMask:mainfrom
margelo:kureev/MUSD-578

Conversation

@Kureev

@Kureev Kureev commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Description

Replace the simple claimable bonus display with a richer "Your bonus" section that is always visible for eligible mUSD tokens. The section shows estimated annual bonus, lifetime bonus claimed, a 3% bonus tag, and a dynamic CTA button across 4 states (claim/accruing/no bonus).

Changelog

CHANGELOG entry:

Related issues

Fixes:

Manual testing steps

Feature: Your bonus section on mUSD asset page
  Scenario: User with mUSD balance and no claimable bonus sees accruing state
    Given the user holds mUSD tokens and there is no claimable bonus
  
    When user navigates to the mUSD asset details page
    Then the "Your bonus" section is visible with a "3% bonus" tag
    And "Estimated annual bonus" shows a value based on their balance
    And "Lifetime bonus claimed" shows the total previously claimed
    And the CTA button says "Accruing next bonus" and is disabled
  
  Scenario: User with claimable bonus can claim
    Given the user holds mUSD tokens and there is a claimable bonus above threshold
  
    When user taps the "Claim $X.XX bonus" button
    Then the button shows a loading state and duplicate taps are prevented
  
  Scenario: User taps info icon to see tooltip
    Given the user is on the mUSD asset details page
  
    When user taps the info icon next to "Your bonus"
    Then a bottom sheet opens with explanations for each metric and a "Learn more" button
    When user taps "Learn more"
    Then the mUSD support page opens in the browser
  
  Scenario: User with zero balance sees empty state
    Given the user has 0 mUSD balance and no claimable bonus
  
    When user navigates to the mUSD asset details page
    Then "Estimated annual bonus" shows "+$0.00"
    And the CTA button says "No accruing bonus" and is disabled

Screenshots/Recordings

Before

After

Simulator Screenshot - iPhone 16 Pro - 2026-04-07 at 18 32 06 image

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
Changes mUSD bonus UI/CTA logic and adds new rewards-derived fields (including numeric conversion from on-chain claimed amounts), which could affect what users see and when claims are enabled. Also extends the tooltip modal route params to support a callback, impacting modal behavior across callers if misused.

Overview
Replaces the mUSD asset page’s conditional “claimable bonus” widget with an always-visible “Your bonus” section that shows an estimated annual bonus (derived from live token balance and APY), a lifetime bonus claimed value, a 3% bonus tag, and a dynamic CTA that switches between Claim / Accruing next bonus / No accruing bonus states.

Extends Merkl rewards plumbing to surface lifetimeBonusClaimed from useMerklRewards through useMerklBonusClaim, and updates claim analytics to record the actual CTA label while preventing claims when the CTA is disabled.

Enhances the tooltip system by adding optional onButtonPress support to useTooltipModal/TooltipModal (used here to open a new MUSD_LEARN_MORE URL), and updates/enlarges tests and test IDs to cover the new UI states and tooltip/analytics changes.

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

Replace the simple claimable bonus display with a richer "Your bonus"
section that is always visible for eligible mUSD tokens. The section
shows estimated annual bonus, lifetime bonus claimed, a 3% bonus tag,
and a dynamic CTA button across 4 states (claim/accruing/no bonus).

- Expose lifetimeBonusClaimed from useMerklRewards hook
- Use live balance from Redux store via useTokenBalance
- Add tooltip modal with detailed bonus explanations
- Support onButtonPress callback in TooltipModal for "Learn more" URL
- Add localization strings for all new UI elements
@Kureev Kureev requested a review from a team as a code owner April 7, 2026 16:31
@github-actions

github-actions Bot commented Apr 7, 2026

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.

@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

Reviewed by Cursor Bugbot for commit 7da6f78. Configure here.

@Jwhiles Jwhiles 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.

The code looks good to me! Though I've not had a chance to run this version of the app yet.

@shane-t

shane-t commented Apr 8, 2026

Copy link
Copy Markdown
Member

Tested and works

@shane-t shane-t added this pull request to the merge queue Apr 8, 2026
Merged via the queue into MetaMask:main with commit 905043c Apr 8, 2026
104 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants