Skip to content

fix: distinguish swaps trending token details source#28128

Merged
bfullam merged 3 commits intomainfrom
swaps-add-swaps-trending-source
Mar 31, 2026
Merged

fix: distinguish swaps trending token details source#28128
bfullam merged 3 commits intomainfrom
swaps-add-swaps-trending-source

Conversation

@bfullam
Copy link
Copy Markdown
Contributor

@bfullam bfullam commented Mar 30, 2026

Description

This change separates swaps-trending token detail navigation from the generic explore trending flow so MetaMetrics can attribute those entry points correctly.

It adds a dedicated trending-swaps token details source, passes that source from the Bridge/Swaps trending section into TrendingTokenRowItem, and keeps the default trending source for existing explore-tab behavior. The added test coverage verifies the swaps-trending navigation params include the new source.

Changelog

CHANGELOG entry: null

Related issues

Fixes: SWAPS-4306

Manual testing steps

Feature: Swaps trending token source tracking

  Scenario: user opens token details from swaps trending
    Given the app is running and the Bridge/Swaps trending tokens section is visible
    When the user taps a token from the Bridge/Swaps trending tokens list
    Then the Asset route is opened for that token
    And the token details navigation params use the source "trending-swaps"

  Scenario: user opens token details from explore trending
    Given the app is running and the Explore trending tokens list is visible
    When the user taps a token from the Explore trending list
    Then the Asset route is opened for that token
    And the token details navigation params continue to use the source "trending"

Screenshots/Recordings

Before

N/A

After

N/A

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

Low Risk
Small, scoped change to navigation params/analytics attribution with a default preserving existing behavior; minimal functional risk aside from potential analytics mislabeling if miswired.

Overview
Routes opened from the Swaps/Bridge trending tokens section now pass a dedicated token-details source value (TokenDetailsSource.TrendingSwaps) instead of the generic trending source, allowing analytics to distinguish entry points.

This introduces the new trending-swaps enum value, adds an optional tokenDetailsSource prop to TrendingTokenRowItem (defaulting to Trending), and updates tests to assert the Bridge section forwards the source and that navigation params include source: 'trending-swaps' when provided.

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

@bfullam bfullam requested review from a team as code owners March 30, 2026 23:35
@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.

@metamaskbot metamaskbot added the team-swaps-and-bridge Swaps and Bridge team label Mar 30, 2026
@bfullam bfullam changed the title Add swaps trending token details source fix: distinguish swaps trending token details source Mar 30, 2026
@github-actions github-actions bot added size-S risk-low Low testing needed · Low bug introduction risk labels Mar 30, 2026
infiniteflower
infiniteflower previously approved these changes Mar 30, 2026
sahar-fehri
sahar-fehri previously approved these changes Mar 30, 2026
@bfullam bfullam dismissed stale reviews from sahar-fehri and infiniteflower via 10145d9 March 31, 2026 00:38
@github-actions github-actions bot added size-M risk-low Low testing needed · Low bug introduction risk and removed size-S risk-low Low testing needed · Low bug introduction risk labels Mar 31, 2026
SteP-n-s
SteP-n-s previously approved these changes Mar 31, 2026
@bfullam bfullam dismissed stale reviews from SteP-n-s and Prithpal-Sooriya via 6909921 March 31, 2026 09:16
@github-actions github-actions bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Mar 31, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

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

E2E Test Selection:
The changes are analytics/tracking improvements only:

  1. TokenDetailsSource enum (constants.ts): Added TrendingSwaps = 'trending-swaps' to distinguish analytics source between Explore trending and Swaps/Bridge trending.

  2. TrendingTokenRowItem.tsx: Added optional tokenDetailsSource prop (defaults to TokenDetailsSource.Trending — backward compatible). The prop is passed to getAssetNavigationParams() to set the correct analytics source in navigation params.

  3. BridgeTrendingTokensSection.tsx: Now passes tokenDetailsSource={TokenDetailsSource.TrendingSwaps} to TrendingTokenRowItem, so Bridge/Swaps trending tokens correctly report their analytics source.

No functional behavior changes — only analytics metadata in navigation params is affected. Default behavior of TrendingTokenRowItem is unchanged.

Tag selection rationale:

  • SmokeTrade: The BridgeTrendingTokensSection is used in the Bridge/Swap view (BridgeView/index.tsx). The trending tokens section within Bridge is directly modified. SmokeTrade covers swap/bridge flows.
  • SmokeConfirmations: Required per SmokeTrade tag description — "when selecting SmokeTrade for swap/bridge flows, also select SmokeConfirmations."
  • SmokeWalletPlatform: The TrendingTokenRowItem is used in the Trending tab (TrendingTokensList, TrendingView/sections.config.tsx). Per tag description, changes to Trending views affect SmokeWalletPlatform.

Performance tests are not warranted — these are pure analytics metadata changes with no rendering, data loading, or performance-sensitive code paths affected.

Performance Test Selection:
Changes are limited to analytics metadata (TokenDetailsSource enum value and prop passing). No UI rendering changes, no data loading changes, no state management changes, and no performance-sensitive code paths are affected. Performance tests are not warranted.

View GitHub Actions results

@github-actions
Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Schema is up to date
17 value mismatches detected (expected — fixture represents an existing user).
View details

@sonarqubecloud
Copy link
Copy Markdown

@bfullam bfullam enabled auto-merge March 31, 2026 10:36
@bfullam bfullam added this pull request to the merge queue Mar 31, 2026
Merged via the queue into main with commit 859f000 Mar 31, 2026
178 of 181 checks passed
@bfullam bfullam deleted the swaps-add-swaps-trending-source branch March 31, 2026 11:01
@github-actions github-actions bot locked and limited conversation to collaborators Mar 31, 2026
@weitingsun weitingsun added release-7.73.0 Issue or pull request that will be included in release 7.73.0 and removed release-100.10.0 labels Mar 31, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.73.0 Issue or pull request that will be included in release 7.73.0 risk-low Low testing needed · Low bug introduction risk size-M team-swaps-and-bridge Swaps and Bridge team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants