Skip to content

feat: MUSD-166 right align convert to musd cta#24249

Merged
Matt561 merged 8 commits intomainfrom
feat/musd-166-right-align-convert-to-musd-cta
Jan 6, 2026
Merged

feat: MUSD-166 right align convert to musd cta#24249
Matt561 merged 8 commits intomainfrom
feat/musd-166-right-align-convert-to-musd-cta

Conversation

@Matt561
Copy link
Copy Markdown
Contributor

@Matt561 Matt561 commented Jan 5, 2026

Description

Moved the "Convert to mUSD" CTA to the AssetElement's secondary balance position for supported stablecoins. This is where the price change percentage is normally displayed.

Changelog

CHANGELOG entry: updated token list item musd conversion cta position to secondary balance position. This replaces the price change percentage for specified stablecoins

Related issues

Fixes: MUSD-166: Right align convert to mUSD CTA

Manual testing steps

Feature: Stablecoin conversion to mUSD from token list

Scenario: user initiates mUSD conversion from token list secondary balance
Given user is viewing the Wallet token list
And mUSD conversion is enabled
And user has a supported stablecoin balance greater than 0
When user taps "Convert to mUSD" on the token’s secondary balance
Then the mUSD conversion flow is started with the selected token pre-selected

Scenario: user views non-convertible token in token list
Given user is viewing the Wallet token list
And the token is not eligible for mUSD conversion
When user views the token row
Then "Convert to mUSD" is not displayed in the secondary balance position
And the secondary balance shows the token’s percentage change (when available)

Scenario: user has a convertible stablecoin with zero balance
Given user is viewing the Wallet token list
And mUSD conversion is enabled
And the token is eligible for mUSD conversion
And the token balance is 0
When user views the token row
Then "Convert to mUSD" is not displayed in the secondary balance position

Screenshots/Recordings

Before

image

After

Screen_Recording_20260105_165424_MetaMask.mp4

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

Shifts the mUSD conversion entry point to the token row’s secondary balance and wires it to initiate conversion.

  • AssetElement: wraps secondaryBalance in a pressable with SECONDARY_BALANCE_BUTTON_TEST_ID; adds onSecondaryBalancePress(asset) prop and disables when no handler or disabled is true
  • TokenListItem: replaces percentage with "Convert to mUSD" when conversion is enabled, token is eligible, and balance > 0; pressing calls initiateConversion with outputChainId, preferredPaymentToken, and navigationStack; otherwise keeps percentage logic
  • StakeButton: removes mUSD conversion logic/flags and related tests; retains pooled staking/lending flows
  • Updates tests and snapshots for AssetElement, TokenListItem, CardAssetItem, and EarnLendingBalance; adds new test IDs and coverage for press behavior

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

@Matt561 Matt561 added No QA Needed Apply this label when your PR does not need any QA effort. team-earn labels Jan 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 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 Jan 5, 2026
@Matt561 Matt561 force-pushed the feat/musd-166-right-align-convert-to-musd-cta branch from e242f64 to ac79f59 Compare January 5, 2026 22:10
@Matt561 Matt561 marked this pull request as ready for review January 5, 2026 22:11
@Matt561 Matt561 requested review from a team as code owners January 5, 2026 22:11
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 5, 2026

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAssets, SmokeStake, SmokeWalletPlatform
  • Risk Level: medium
  • AI Confidence: 82%
click to see 🤖 AI reasoning details

The changes involve refactoring the mUSD conversion flow from StakeButton to TokenListItem, and adding a new clickable secondary balance feature to AssetElement.

Key changes:

  1. AssetElement - Added onSecondaryBalancePress prop and wrapped secondary balance in TouchableOpacity. This is a UI component used by TokenListItem, StakingBalance, CardAssetItem, EarnLendingBalance, and Balance components.

  2. StakeButton - Removed mUSD conversion functionality (handleConvertToMUSD, related hooks and selectors). The button now only handles pooled staking and stablecoin lending.

  3. TokenListItem - Added mUSD conversion functionality that was removed from StakeButton. Now displays "Convert to mUSD" as clickable secondary balance text for convertible stablecoins.

The changes affect:

  • Token list display in the wallet (SmokeAssets)
  • Staking button behavior (SmokeStake)
  • Core wallet token display (SmokeWalletPlatform)

The risk is medium because:

  • The changes are primarily UI refactoring, moving functionality between components
  • Unit tests have been updated to cover the new behavior
  • Snapshot tests have been updated
  • No core business logic changes, just relocation of existing functionality
  • The mUSD conversion feature is behind a feature flag

I'm not including SmokeCard or SmokeRamps because the Card and Earn components only have snapshot changes (adding TouchableOpacity wrapper) with no functional changes to those features.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Jan 5, 2026

@amandaye0h
Copy link
Copy Markdown
Contributor

amandaye0h commented Jan 6, 2026

@Matt561 Can we right align Earn as well, maybe in a follow up PR? Pattern wise, it seems odd to have different CTA styles.

Copy link
Copy Markdown
Contributor

@nickewansmith nickewansmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Matt561 Matt561 added this pull request to the merge queue Jan 6, 2026
Merged via the queue into main with commit 5816026 Jan 6, 2026
96 checks passed
@Matt561 Matt561 deleted the feat/musd-166-right-align-convert-to-musd-cta branch January 6, 2026 18:10
@github-actions github-actions bot locked and limited conversation to collaborators Jan 6, 2026
@metamaskbot metamaskbot added the release-7.62.0 Issue or pull request that will be included in release 7.62.0 label Jan 6, 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.62.0 Issue or pull request that will be included in release 7.62.0 size-L team-earn

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants