Skip to content

fix: graceful fallback for assets missing images cp-7.77.0#30096

Merged
Prithpal-Sooriya merged 5 commits into
mainfrom
cursor/musd-send-flow-assetlogo-fix-2926
May 13, 2026
Merged

fix: graceful fallback for assets missing images cp-7.77.0#30096
Prithpal-Sooriya merged 5 commits into
mainfrom
cursor/musd-send-flow-assetlogo-fix-2926

Conversation

@Prithpal-Sooriya

@Prithpal-Sooriya Prithpal-Sooriya commented May 13, 2026

Copy link
Copy Markdown
Contributor

Description

  • replace the confirmation token avatar fallback with AssetLogo in token.tsx so send/perps flows use the same asset image pipeline + fallback as home/swap.

Changelog

CHANGELOG entry: fix: ensure missing assets try a fallback image url path.

Related issues

Fixes: #29946

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.
Open in Web Open in Cursor 

Note

Low Risk
Low risk UI change that only alters how token logos are rendered; main risk is minor layout/styling differences or unexpected image URL fallback behavior in a few flows.

Overview
Uses the shared AssetLogo component (with its fallback image URL logic) anywhere non-native token avatars were previously rendered directly via AvatarToken, including the asset overview balance header and the confirmations token selector.

Updates the confirmations Token tests to mock AssetLogo to keep them focused on text/interaction behavior.

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

@cursor cursor Bot changed the title [Bug]: Assets - mUSD icon missing in Send flow asset list fix: Assets - mUSD icon missing in Send flow asset list May 13, 2026
@Prithpal-Sooriya Prithpal-Sooriya marked this pull request as ready for review May 13, 2026 12:10
@Prithpal-Sooriya Prithpal-Sooriya requested a review from a team as a code owner May 13, 2026 12:10
@Prithpal-Sooriya Prithpal-Sooriya changed the title fix: Assets - mUSD icon missing in Send flow asset list fix: mUSD icon missing in Send flow asset list May 13, 2026
Comment thread app/components/Views/confirmations/components/UI/token/token.tsx
@Prithpal-Sooriya Prithpal-Sooriya changed the title fix: mUSD icon missing in Send flow asset list fix: graceful fallback for assets missing images May 13, 2026
@Prithpal-Sooriya

Copy link
Copy Markdown
Contributor Author

@cursor validate and fix this pls
#30096 (comment)

@cursor

cursor Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor

Validated and fixed the exact issue in that discussion thread (#discussion_r3234065291).

✅ Fix applied

  • Removed the unused AvatarToken import from:
    • app/components/Views/confirmations/components/UI/token/token.tsx

✅ Validation

  • yarn eslint app/components/Views/confirmations/components/UI/token/token.tsx
    • Passes (only existing deprecation warnings, no errors)
  • yarn jest app/components/Views/confirmations/components/UI/token/token.test.tsx --coverage=false
    • Passes (10/10)

✅ Git updates

View PR

Open in Web Open in Cursor 

juanmigdr
juanmigdr previously approved these changes May 13, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.74%. Comparing base (3751d9a) to head (8740530).
⚠️ Report is 72 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #30096      +/-   ##
==========================================
+ Coverage   81.54%   81.74%   +0.19%     
==========================================
  Files        5343     5387      +44     
  Lines      142128   143484    +1356     
  Branches    32411    32766     +355     
==========================================
+ Hits       115899   117290    +1391     
+ Misses      18299    18179     -120     
- Partials     7930     8015      +85     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

OGPoyraz
OGPoyraz previously approved these changes May 13, 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.

@Prithpal-Sooriya Prithpal-Sooriya changed the title fix: graceful fallback for assets missing images fix: graceful fallback for assets missing images cp-7.77.0 May 13, 2026
bergarces
bergarces previously approved these changes May 13, 2026

@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

❌ 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 ff151f5. Configure here.

Comment thread app/components/UI/AssetOverview/Balance/Balance.tsx
@Prithpal-Sooriya

Copy link
Copy Markdown
Contributor Author

@cursor fix this pls
#30096 (comment)

@cursor

cursor Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor

Fixed the issue from that review thread (#discussion_r3236724052) on the PR branch.

What I changed

  • Removed dead imports in:
    • app/components/UI/AssetOverview/Balance/Balance.tsx
  • Specifically removed:
    • AvatarToken
    • AvatarSize

These were left unused after switching renderNetworkAvatar to AssetLogo.

Validation

  • Ran:
    • yarn eslint app/components/UI/AssetOverview/Balance/Balance.tsx
  • Result:
    • ✅ no errors (only existing deprecation warnings)

Git updates

View PR

Open in Web Open in Cursor 

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeConfirmations, SmokeWalletPlatform, SmokeStake
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 82%
click to see 🤖 AI reasoning details

E2E Test Selection:

The PR replaces direct AvatarToken usage with the shared AssetLogo component in two places:

  1. Balance.tsx (AssetOverview): The token logo in the asset overview/balance screen now uses AssetLogo instead of AvatarToken directly. AssetLogo internally uses AvatarToken for non-native tokens but adds fallback URL support via getAssetImageUrl. This affects the wallet's token detail view.

  2. token.tsx (confirmations): The token display component in confirmation screens now uses AssetLogo instead of AvatarToken from the design-system. This affects how tokens are displayed in transaction/signature confirmation flows.

  3. token.test.tsx: Updated unit test to mock the new AssetLogo import.

Tag selection rationale:

  • SmokeConfirmations: Directly affected - token.tsx is used in confirmation screens to display token information. The logo rendering change needs validation in confirmation flows (ERC-20 approvals, token transfers, etc.).
  • SmokeWalletPlatform: Balance.tsx is in the AssetOverview component which is part of the core wallet platform. Token logo display in the asset detail screen needs validation.
  • SmokeStake: AssetLogo is used in StakingBalance and StakingConfirmation/TokenValueStack components. The staking flows display token logos and should be validated.

Not selected:

  • SmokeSwap: While swap flows show tokens, the changes are in Balance.tsx (asset overview) and token.tsx (confirmations), not in swap-specific token display components.
  • SmokeMoney: CardAssetItem uses AssetLogo but was not changed in this PR.
  • SmokePerps: Not directly affected by these specific component changes.

The risk is medium because while the refactoring is straightforward (same underlying AvatarToken component), the AssetLogo component adds logic for native token detection and fallback URL resolution that could behave differently in edge cases.

Performance Test Selection:
These changes are UI refactoring - replacing AvatarToken with AssetLogo component. AssetLogo internally uses the same AvatarToken for non-native tokens, so there is no meaningful performance impact. The change adds a small amount of logic (native token check, fallback URL resolution) but this is negligible and not expected to affect rendering performance metrics.

View GitHub Actions results

@Prithpal-Sooriya

Copy link
Copy Markdown
Contributor Author

Skipping E2E as known failure

SmokeWalletPlatform: mUSD Conversion Happy Path › converts USDC to mUSD from Asset Overview
https://consensys.slack.com/archives/C02U025CVU4/p1778698549273839

@Prithpal-Sooriya Prithpal-Sooriya added the skip-e2e skip E2E test jobs label May 13, 2026
@sonarqubecloud

Copy link
Copy Markdown

@Prithpal-Sooriya Prithpal-Sooriya added this pull request to the merge queue May 13, 2026
Merged via the queue into main with commit 24712bd May 13, 2026
220 of 225 checks passed
@Prithpal-Sooriya Prithpal-Sooriya deleted the cursor/musd-send-flow-assetlogo-fix-2926 branch May 13, 2026 21:27
@github-actions github-actions Bot locked and limited conversation to collaborators May 13, 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 13, 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-S skip-e2e skip E2E test jobs team-assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Assets - mUSD doesn't have a token icon when going over the Send flow

6 participants