Skip to content

Conversation

@sahar-fehri
Copy link
Contributor

@sahar-fehri sahar-fehri commented Nov 10, 2025

Description

PR to add trending tokens card. This should be under a feature flag( selector selectAssetsTrendingTokensEnabled)

Changelog

CHANGELOG entry: No functional changes, this is still under a feature flag.

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

Screenshot 2025-11-11 at 18 09 58

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

Introduces a Trending Tokens UI section integrated into TrendingView with a shared token logo hook, updates the trending fetch hook to default to popular networks, and adds comprehensive tests and i18n.

  • UI (Trending):
    • Trending Tokens Section: New TrendingTokensSection with TrendingTokensList, TrendingTokenRowItem, TrendingTokenLogo, and TrendingTokensSkeleton, integrated into TrendingView (header tweak, scroll container).
  • Hooks:
    • New: useTokenLogo for shared image loading/error/background logic; refactors PerpsTokenLogo to use it.
    • Updated: useTrendingRequest now accepts optional chainIds, defaults to popular networks via useNetworksByNamespace/useNetworksToUse, sets initial loading to true, and fixes debounce dependencies.
  • Utils:
    • Add formatting helpers formatCompactUSD and formatMarketStats for market cap/volume.
  • Tests:
    • Add extensive unit tests and snapshots for new components/hooks and updated trending request behavior.
  • Localization:
    • Update en.json with trending.title, trending.view_all, and trending.tokens strings.

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

@github-actions
Copy link
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-XL and removed size-L labels Nov 10, 2025
}
}, []);

const pricePercentChange1d = 3.44; // TODO ; this should come from the trending hook
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will be added by platform api team; putting a placeholder value for now

const trendingTokens = trendingTokensResults.slice(0, 3);

const handleViewAll = useCallback(() => {
// TODO: Implement view all logic
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will be implemented on a separate PR

const handleTokenPress = useCallback((token: TrendingAsset) => {
// eslint-disable-next-line no-console
console.log('🚀 ~ TrendingTokensSection ~ token:', token);
// TODO: Implement token press logic
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will be implemented on a separate PR

<Text variant={TextVariant.BodyMDMedium} color={TextColor.Default}>
{token.name}
</Text>
<Icon
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is an ongoing discussion around this badge; it should come from the trending api itself; thinking about removing the icon for now til we have something from API

@sahar-fehri sahar-fehri marked this pull request as ready for review November 11, 2025 11:28
@sahar-fehri sahar-fehri requested review from a team as code owners November 11, 2025 11:28
@sahar-fehri
Copy link
Contributor Author

Very nit, in a future PR maybe we could show 3 items in the skeleton as soon as the screen is opened instead of showing an empty container and then snapping into 3 items, wdyt?

Screen.Recording.2025-11-11.at.15.18.29.mov
Also should this be clickable? Looks wrong 🤔

Screen.Recording.2025-11-11.at.15.19.35.mov

Should be fixed now 🙏

juanmigdr
juanmigdr previously approved these changes Nov 11, 2025
Copy link
Member

@juanmigdr juanmigdr left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

juanmigdr
juanmigdr previously approved these changes Nov 11, 2025
@sonarqubecloud
Copy link

@sahar-fehri sahar-fehri added this pull request to the merge queue Nov 12, 2025
Merged via the queue into main with commit 88a6815 Nov 12, 2025
85 of 86 checks passed
@sahar-fehri sahar-fehri deleted the feat/add-trending-tokens-section branch November 12, 2025 09:18
@github-actions github-actions bot locked and limited conversation to collaborators Nov 12, 2025
@metamaskbot metamaskbot added the release-7.60.0 Issue or pull request that will be included in release 7.60.0 label Nov 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.60.0 Issue or pull request that will be included in release 7.60.0 size-XL team-assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants