Skip to content

chore: add scroll event to Market Insights card#27872

Merged
joaosantos15 merged 2 commits into
TSA-299-track-ai-asset-symbolfrom
TSA-307-scroll-event
Mar 25, 2026
Merged

chore: add scroll event to Market Insights card#27872
joaosantos15 merged 2 commits into
TSA-299-track-ai-asset-symbolfrom
TSA-307-scroll-event

Conversation

@joaosantos15

@joaosantos15 joaosantos15 commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds a segment event to track when the Market Insights card comes into view. This is necessary because at the moment it always renders below the fold, making it arduous to get good CTR data for the Market Insights feature. This adds a useful, intermediate step in the funnel.

scroll.mp4

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

Medium Risk
Adds a new visibility-detection hook that uses a 250ms polling interval until the card is visible, which could impact performance or battery if misapplied. Other changes are additive analytics property updates with low functional risk.

Overview
Adds a new MARKET_INSIGHTS_CARD_SCROLLED_TO_VIEW analytics event that fires once when the Market Insights entry card becomes at least 50% visible, using a new useViewportTracking hook (layout + short polling) and wiring it into MarketInsightsEntryCard.

Extends Market Insights telemetry to include asset_symbol on MARKET_INSIGHTS_OPENED, MARKET_INSIGHTS_VIEWED, and MARKET_INSIGHTS_INTERACTION events (token + perps contexts), with updated unit tests to assert the new properties and event emission.

Written by Cursor Bugbot for commit 4407c73. 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.

@joaosantos15 joaosantos15 added team-social-ai Social & AI team Ledger Ledger hardware wallet related issue or development no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed and removed Ledger Ledger hardware wallet related issue or development labels Mar 24, 2026
@joaosantos15 joaosantos15 marked this pull request as ready for review March 24, 2026 14:36
@joaosantos15 joaosantos15 requested review from a team as code owners March 24, 2026 14:36

@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.

.addProperties({
caip19: caip19Id,
digest_id: caip19Id,
asset_name: report.asset,

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.

Inconsistent analytics property name asset_name vs asset_symbol

Medium Severity

The scroll-into-view event in MarketInsightsEntryCard.tsx sends the asset as asset_name, but every other analytics event in this PR uses asset_symbol (in MarketInsightsView.tsx, AssetOverviewContent.tsx, and PerpsMarketDetailsView.tsx). This inconsistency means the new scroll event will track the asset under a different property name than the rest of the Market Insights funnel, making it difficult to correlate CTR data — which is the stated goal of this PR. The test also asserts asset_name, so both need updating.

Additional Locations (1)
Fix in Cursor Fix in Web

@github-actions

Copy link
Copy Markdown
Contributor

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

@sonarqubecloud

Copy link
Copy Markdown

@joaosantos15 joaosantos15 changed the base branch from main to TSA-299-track-ai-asset-symbol March 25, 2026 09:48
@joaosantos15 joaosantos15 merged commit c12eddb into TSA-299-track-ai-asset-symbol Mar 25, 2026
40 of 42 checks passed
@joaosantos15 joaosantos15 deleted the TSA-307-scroll-event branch March 25, 2026 09:50
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 25, 2026
@github-actions github-actions Bot added the risk-low Low testing needed · Low bug introduction risk label Mar 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed risk-low Low testing needed · Low bug introduction risk size-M team-social-ai Social & AI team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant