Skip to content

chore: emit chain name on follow-trading token events#33349

Open
zone-live wants to merge 3 commits into
mainfrom
TSA-pass-chain-value-to-top-trader-events
Open

chore: emit chain name on follow-trading token events#33349
zone-live wants to merge 3 commits into
mainfrom
TSA-pass-chain-value-to-top-trader-events

Conversation

@zone-live

@zone-live zone-live commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Description

Emits a chain_name property on follow-trading token analytics events so dashboards can break down views by chain without parsing caip19 or relying on chain_id_destination (which social events never send).
Values are lowercase chain slugs from position.chain (e.g. base, solana, hyperliquid).

Changelog

CHANGELOG entry: null

Related issues

Fixes: NA

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

NA

After

NA

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.

Note

Low Risk
Analytics-only property addition on existing event builders; no user-facing behavior or auth/data-path changes.

Overview
Adds chain_name to Social Leaderboard follow-trading token analytics so reporting can segment by chain without parsing caip19.

buildFollowTradingTokenContext now always includes a lowercase slug from position.chain (e.g. base, hyperliquid) on the shared context used for screen viewed, CTA clicked, and profile position clicked events. pickFollowTradingDismissedProperties also forwards chain_name on dismiss payloads alongside trader_address and caip19 / perps_market. A CHAIN_NAME key is registered in SocialLeaderboardEventProperties; unit and view tests assert the new field for spot and perp flows.

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

@zone-live zone-live requested a review from a team as a code owner July 15, 2026 13:50
@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 Jul 15, 2026
@metamask-ci metamask-ci Bot added the team-social-ai Social & AI team label Jul 15, 2026
@metamask-ci

metamask-ci Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

PR template — items to address before "Ready for review"

Warnings — informational, address before merging:

  • Manual testing steps still contain template content (the Gherkin example title or a [...] placeholder). Replace with real steps, or write N/A — <reason>.
  • Pre-merge author checklist has unchecked items (e.g. "I've followed MetaMask Contributor Docs and MetaMask Mobile Coding Standards."). Every box must be consciously checked — see docs/readme/ready-for-review.md.

See docs/readme/ready-for-review.md for the full Definition of Ready for Review.

@github-actions github-actions Bot added size-S risk:low AI analysis: low risk labels Jul 15, 2026
@sonarqubecloud

Copy link
Copy Markdown

@zone-live zone-live changed the title chore: emit chain on follow-trading token events chore: emit chain name on follow-trading token events Jul 16, 2026
@zone-live zone-live removed 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 Jul 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

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

E2E Test Selection:
All 5 changed files are confined to the SocialLeaderboard analytics layer:

  1. socialLeaderboardEvents.ts — adds a new CHAIN_NAME constant to the event properties enum.
  2. buildFollowTradingTokenContext.ts — enriches the analytics context object with chain_name derived from position.chain.
  3. buildFollowTradingTokenContext.test.ts, TraderPositionView.test.tsx, TraderProfileView.test.tsx — unit test updates to assert the new chain_name field is present in analytics events.

These changes are purely additive analytics property enrichment — no UI components, navigation flows, controllers, shared infrastructure, or user-facing behavior is modified. No E2E smoke tests cover SocialLeaderboard analytics event properties. The changes carry no risk to any existing E2E test flows. No performance-sensitive code paths are affected.

Performance Test Selection:
The changes only add a chain_name property to analytics event objects in the SocialLeaderboard feature. No rendering, data fetching, state management, or performance-sensitive code paths are modified. No performance tests are warranted.

View GitHub Actions results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:low AI analysis: low risk size-S team-social-ai Social & AI team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant