Skip to content

feat: token section on home page should always show popular networks#27009

Merged
salimtb merged 23 commits into
mainfrom
feat/home-redesign-tokens-section
Mar 6, 2026
Merged

feat: token section on home page should always show popular networks#27009
salimtb merged 23 commits into
mainfrom
feat/home-redesign-tokens-section

Conversation

@salimtb

@salimtb salimtb commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

Description

always display popular networks assets on the token section of the home page

Changelog

CHANGELOG entry: always display popular networks assets on the token section of the home page

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

before.mov

After

after.mov

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
Medium risk because it changes token selection and balance refresh/polling paths (including chain-id filtering and new controller calls), which can affect what assets appear and when balances update across networks.

Overview
The homepage TokensSection now always derives its token list from the popular network set returned by useNetworkEnablement, using a new selector (selectSortedAssetsBySelectedAccountGroupForChainIds) that filters assets by an explicit chain-id list (handling both CAIP-2 and EVM hex forms). Token refreshes from the homepage are also restricted to popular EVM networks by filtering evmNetworkConfigurationsByChainId before calling refreshTokens.

useNetworkEnablement now exposes popularEvmNetworks, popularMultichainNetworks, and popularNetworks (backed by the upgraded @metamask/network-enablement-controller@4.2.0), and wallet refresh/polling is updated to use these lists: useBalanceRefresh filters which networks it refreshes (and additionally triggers TokenDetectionController.detectTokens and TokenBalancesController.updateBalances), while Wallet/TokensFullView mount AssetPollingProvider only when focused and pass chainIds for the homepage-sections path.

Tests/mocks are updated broadly to accommodate the new hook shape and controller methods, plus selector changes and snapshot updates.

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

@github-actions

github-actions Bot commented Mar 4, 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.

@salimtb salimtb marked this pull request as ready for review March 5, 2026 19:19
@salimtb salimtb requested review from a team as code owners March 5, 2026 19:19
Comment thread app/components/Views/Wallet/hooks/useBalanceRefresh.ts Outdated
Comment thread app/components/hooks/useNetworkEnablement/useNetworkEnablement.ts Outdated
Comment thread app/components/Views/Homepage/Sections/Tokens/TokensSection.tsx Outdated
Comment thread app/components/hooks/useNetworkEnablement/useNetworkEnablement.ts Outdated
<Tokens isFullView />
</SafeAreaView>
<>
<AssetPollingProvider />

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.

Oooho nice catch here!

Comment thread app/selectors/assets/assets-list.ts
@github-actions github-actions Bot added size-XL and removed size-L labels Mar 6, 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.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Comment thread app/components/Views/Homepage/Sections/Tokens/TokensSection.tsx
@salimtb salimtb added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label Mar 6, 2026
@MetaMask MetaMask deleted a comment from sonarqubecloud Bot Mar 6, 2026
@github-actions

github-actions Bot commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAccounts, SmokeConfirmations, SmokeIdentity, SmokeNetworkAbstractions, SmokeNetworkExpansion, SmokeTrade, SmokeWalletPlatform, SmokeCard, SmokePerps, SmokeRamps, SmokeMultiChainAPI, SmokePredictions, FlaskBuildTests
  • Selected Performance tags: @PerformanceAccountList, @PerformanceOnboarding, @PerformanceLogin, @PerformanceSwaps, @PerformanceLaunch, @PerformanceAssetLoading, @PerformancePredict, @PerformancePreps
  • Risk Level: high
  • AI Confidence: 100%
click to see 🤖 AI reasoning details

E2E Test Selection:
Hard rule (controller-version-update): @MetaMask controller package version updated in package.json: @metamask/network-enablement-controller. Running all tests.

Performance Test Selection:
Hard rule (controller-version-update): @MetaMask controller package version updated in package.json: @metamask/network-enablement-controller. Running all tests.

View GitHub Actions results

@salimtb salimtb requested a review from Prithpal-Sooriya March 6, 2026 15:10
@github-actions

github-actions Bot commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

⚠️ E2E Fixture Validation — Structural changes detected

Category Count
New keys 68
Missing keys 11
Type mismatches 0
Value mismatches 7 (informational)

The committed fixture schema is out of date. To update, comment:

@metamaskbot update-mobile-fixture

View full details | Download diff report

@salimtb salimtb enabled auto-merge March 6, 2026 15:31
@sonarqubecloud

sonarqubecloud Bot commented Mar 6, 2026

Copy link
Copy Markdown

<Homepage ref={homepageRef} />
</HomepageScrollContext.Provider>
<>
{isFocused && <AssetPollingProvider chainIds={evmChainIds} />}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What about non-evm chains?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we don't do polling for them , we use cronJob snap

@salimtb salimtb disabled auto-merge March 6, 2026 15:48
@salimtb salimtb added this pull request to the merge queue Mar 6, 2026
Merged via the queue into main with commit b2ae04a Mar 6, 2026
198 of 201 checks passed
@salimtb salimtb deleted the feat/home-redesign-tokens-section branch March 6, 2026 16:28
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 6, 2026
@metamaskbot metamaskbot added the release-7.70.0 Issue or pull request that will be included in release 7.70.0 label Mar 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.70.0 Issue or pull request that will be included in release 7.70.0 size-XL skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants