Skip to content

chore: adds segment event to Market Insights view#28087

Merged
zone-live merged 1 commit into
mainfrom
TSA-327-add-metric-market-insights-closed
Mar 30, 2026
Merged

chore: adds segment event to Market Insights view#28087
zone-live merged 1 commit into
mainfrom
TSA-327-add-metric-market-insights-closed

Conversation

@zone-live

@zone-live zone-live commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

Description

Adds the segment metric event "Market Insights Closed" to the Market Insights view, for the back button.

Changelog

CHANGELOG entry: null

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

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
Low risk analytics-only change; main risk is accidental over/under-counting if handleBackPress is triggered from additional paths.

Overview
Adds a new MetaMetrics event, MARKET_INSIGHTS_CLOSED (Market Insights Closed), to the central analytics event registry.

Updates MarketInsightsView so pressing the back button tracks this close event with the same asset identifier properties (caip19/perps_market, optional digest_id, and asset_symbol) before navigating away.

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

@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-social-ai Social & AI team label Mar 30, 2026
@github-actions github-actions Bot added size-S risk-low Low testing needed · Low bug introduction risk labels Mar 30, 2026
@github-actions

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 PR makes two small, additive changes:

  1. MetaMetrics.events.ts: Adds a new MARKET_INSIGHTS_CLOSED analytics event enum value and its corresponding event generator. This is purely additive — no existing events are modified.

  2. MarketInsightsView.tsx: Wires up the new MARKET_INSIGHTS_CLOSED event to fire when the user presses the back button on the Market Insights view. The handleBackPress callback now tracks the event with asset ID and symbol properties before calling navigation.goBack(). The navigation behavior itself is unchanged.

Risk Assessment:

  • Changes are purely additive (new event + new tracking call)
  • No existing functionality is modified or removed
  • No shared components, controllers, or navigation infrastructure is affected
  • MarketInsights is feature-flag gated
  • The MarketInsights feature is accessible from the Token Details/Asset Overview screen, which is part of the core wallet token browsing experience covered by SmokeWalletPlatform

Tag Selection:

  • SmokeWalletPlatform: Selected because MarketInsights is part of the token/asset details flow within the wallet platform. The change touches the back navigation handler of the MarketInsights view, which should be validated to ensure the analytics event fires correctly and navigation still works as expected.
  • No other tags are needed as the changes don't touch confirmations, accounts, networks, trading, or any other feature areas.

Performance Test Selection:
No performance impact expected. The changes only add a single analytics event call (createEventBuilder + trackEvent) to the back press handler in MarketInsightsView. This is a negligible operation that does not affect rendering performance, data loading, list rendering, or any critical user flow performance metrics.

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

@zone-live zone-live added this pull request to the merge queue Mar 30, 2026
Merged via the queue into main with commit 032e646 Mar 30, 2026
114 checks passed
@zone-live zone-live deleted the TSA-327-add-metric-market-insights-closed branch March 30, 2026 13:28
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 30, 2026
@metamaskbot metamaskbot added the release-7.73.0 Issue or pull request that will be included in release 7.73.0 label Mar 30, 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-S team-social-ai Social & AI team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants