Skip to content

feat: track Token Details secondary action buttons (ASSETS-3212) cp-7.80.0#30379

Merged
Prithpal-Sooriya merged 9 commits into
mainfrom
cursor/assets-3212-token-details-action-tapped-cea8
Jun 1, 2026
Merged

feat: track Token Details secondary action buttons (ASSETS-3212) cp-7.80.0#30379
Prithpal-Sooriya merged 9 commits into
mainfrom
cursor/assets-3212-token-details-action-tapped-cea8

Conversation

@Prithpal-Sooriya

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

Copy link
Copy Markdown
Contributor

Description

Adds Token Details Action Clicked analytics event instrumentation for the Token Details Page (TDP) secondary action buttons, enabling product to track how users interact with actions beyond the primary CTA.

Segment Schema: https://github.com/Consensys/segment-schema/pull/577

What changed:

  1. New event: Token Details Action Clicked registered in MetaMetrics.events.ts
  2. New enum: TokenDetailsAction with values: send, receive, more_opened, remove_token, view_on_explorer, copy_token_address
  3. New tracking hook: useTokenDetailsActionTracking — accepts token params, balance, and severity; returns a stable callback that fires the event
  4. Instrumented components:
    • TokenDetailsActions — fires on Send, Receive, and More (menu open) button presses
    • MoreTokenActionsMenu — fires on Remove Token and View on Block Explorer
    • TokenDetailsList → Copy Token Address button

Event properties:

Property Type Description
action enum send, receive, more_opened, remove_token, view_on_explorer, copy_token_address
token_symbol string e.g. ETH
token_address string Token contract address
chain_id string Chain ID
has_balance boolean Whether user holds the token
severity string Security classification: Verified, Benign, Warning, Spam, Malicious
source string Mirrors Token Details Opened source enum

Changelog

CHANGELOG entry: null

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-3212

Manual testing steps

Feature: Token Details Action Clicked analytics

  Scenario: user taps Send on Token Details Page
    Given user is viewing a token with balance on Token Details Page

    When user taps the Send button
    Then "Token Details Action Clicked" event fires with action="send"

  Scenario: user taps Receive on Token Details Page
    Given user is viewing a token on Token Details Page

    When user taps the Receive button
    Then "Token Details Action Clicked" event fires with action="receive"

  Scenario: user taps More menu on Token Details Page
    Given user is viewing a token on Token Details Page

    When user taps the More (⋯) button
    Then "Token Details Action Clicked" event fires with action="more_opened"

  Scenario: user taps View on Block Explorer in More menu
    Given user has opened the More menu on Token Details Page

    When user taps View on Block Explorer
    Then "Token Details Action Clicked" event fires with action="view_on_explorer"

  Scenario: user taps Remove Token in More menu
    Given user has opened the More menu for a non-native token

    When user taps Remove Token
    Then "Token Details Action Clicked" event fires with action="remove_token"

  Scenario: user copies token contract address
    Given user is viewing token details section with contract address

    When user taps the copy address button
    Then "Token Details Action Clicked" event fires with action="copy_token_address"

Screenshots/Recordings

https://www.loom.com/share/73dce87dc6bc47b48a0d40588213c4e1

Pre-merge author checklist

Open in Web Open in Cursor 

Prithpal-Sooriya and others added 2 commits May 19, 2026 13:15
Implements ASSETS-3212 - tracks Send, Receive, More (menu open),
Remove Token, View on Explorer, and Copy Token Address actions
on the Token Details Page.

Event schema:
- action: send | receive | more_opened | remove_token | view_on_explorer | copy_token_address
- token_symbol, token_address, chain_id, has_balance, severity, source

Co-authored-by: Prithpal Sooriya <prithpal.sooriya@gmail.com>
Tests all 6 action types (send, receive, more_opened, remove_token,
view_on_explorer, copy_token_address) and source fallback behavior.

Co-authored-by: Prithpal Sooriya <prithpal.sooriya@gmail.com>
@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.

@github-actions github-actions Bot added the pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. label May 19, 2026
@metamaskbotv2 metamaskbotv2 Bot added team-assets INVALID-PR-TEMPLATE PR's body doesn't match template labels May 19, 2026
Prithpal-Sooriya and others added 3 commits May 19, 2026 13:41
Co-authored-by: Prithpal Sooriya <prithpal.sooriya@gmail.com>
Renamed from 'Token Details Action Tapped' to 'Token Details Action Clicked'
per schema alignment.

Co-authored-by: Prithpal Sooriya <prithpal.sooriya@gmail.com>
Covers TokenDetailsActions (send/receive/more), MoreTokenActionsMenu
(view_on_explorer/remove_token), and TokenDetailsList (copy address)
to satisfy SonarQube 80% new-code coverage gate.

Co-authored-by: Prithpal Sooriya <prithpal.sooriya@gmail.com>
@sonarqubecloud

Copy link
Copy Markdown

…r/assets-3212-token-details-action-tapped-cea8
@Prithpal-Sooriya Prithpal-Sooriya marked this pull request as ready for review June 1, 2026 14:01
@Prithpal-Sooriya Prithpal-Sooriya requested a review from a team as a code owner June 1, 2026 14:01
@github-actions github-actions Bot added the risk:medium AI analysis: medium risk label Jun 1, 2026

@juanmigdr juanmigdr left a comment

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.

LGTM! 🚀 Just missing link to segment

@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 98b8149. Configure here.

Comment thread app/components/UI/TokenDetails/components/TokenDetailsActions.tsx
@Prithpal-Sooriya Prithpal-Sooriya changed the title feat: track Token Details secondary action buttons (ASSETS-3212) feat: track Token Details secondary action buttons (ASSETS-3212) cp-7.80.0 Jun 1, 2026
@Prithpal-Sooriya Prithpal-Sooriya added no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed and removed pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. labels Jun 1, 2026
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

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

E2E Test Selection:
The changes are purely analytics/tracking additions to the Token Details screen:

  1. MetaMetrics.events.ts: Adds a new TOKEN_DETAILS_ACTION_CLICKED event (additive, no breaking changes)
  2. constants/constants.ts: Adds a new TokenDetailsAction enum (additive)
  3. useTokenDetailsActionTracking.ts: New hook for tracking token detail actions (new file)
  4. AssetOverviewContent.tsx: Integrates the tracking hook and passes optional callbacks down the component tree
  5. TokenDetailsActions.tsx: Accepts optional onActionTapped callback for Send, Receive, MoreOpened actions
  6. MoreTokenActionsMenu.tsx: Accepts optional onActionTapped callback for ViewOnExplorer, RemoveToken actions
  7. TokenDetails.tsx / TokenDetailsList.tsx: Accepts optional onCopyAddress callback

All changes are additive with optional props - no existing behavior is modified. The token details screen is part of the wallet platform (asset overview/token list). SmokeWalletPlatform covers transaction history and wallet features which include token detail views. No confirmations, swaps, navigation infrastructure, or core controllers are affected. No dedicated E2E tests exist for the Token Details screen specifically.

Performance Test Selection:
The changes are purely analytics tracking additions (new event, new hook, new optional callbacks). No UI rendering changes, no data loading changes, no state management changes, and no component structure changes that would affect performance. The new tracking hook uses useCallback with proper memoization, so no performance regression is expected.

View GitHub Actions results

@Prithpal-Sooriya Prithpal-Sooriya added this pull request to the merge queue Jun 1, 2026
Merged via the queue into main with commit 1bdcec5 Jun 1, 2026
408 of 418 checks passed
@Prithpal-Sooriya Prithpal-Sooriya deleted the cursor/assets-3212-token-details-action-tapped-cea8 branch June 1, 2026 19:20
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 1, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.81.0 Issue or pull request that will be included in release 7.81.0 label Jun 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

INVALID-PR-TEMPLATE PR's body doesn't match template no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.81.0 Issue or pull request that will be included in release 7.81.0 risk:medium AI analysis: medium risk size-M team-assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants