Skip to content

feat(predict): pass predict_feed_tab and predict_screen through to trade events cp-7.80.0#30943

Merged
matallui merged 4 commits into
mainfrom
predict/pred-938
Jun 2, 2026
Merged

feat(predict): pass predict_feed_tab and predict_screen through to trade events cp-7.80.0#30943
matallui merged 4 commits into
mainfrom
predict/pred-938

Conversation

@matallui

@matallui matallui commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Description

entry_point: "predict_feed" correctly identifies that a trade originated from the Predict feed, but it carries no information about where within the feed the trade came from. We already track predict_feed_tab (e.g. "world-cup", "trending", "sports") and predict_screen (e.g. "world_cup") on Predict Feed Viewed, but those properties were never forwarded to Predict Trade Transaction or Predict Market Details Opened — so trade volume and conversion could not be segmented by tab or surface in Mixpanel.

This PR forwards predict_feed_tab and predict_screen from the feed market cards through to the trade and market-details events, flowing through the same path entry_point already uses:

market card → PredictMarketDetails route params → PredictBuyPreview → analyticsProperties → Predict Trade Transaction

What it does:

  • Source screens set the values: PredictFeed passes the active tab key as predict_feed_tab; PredictWorldCup passes the active tab key plus predict_screen: "world_cup".
  • Threading layer mirrors the existing entry_point / transactionActiveAbTests plumbing through PredictMarket and the four card variants (PredictMarketSingle, PredictMarketMultiple, PredictMarketSportCard, PredictCryptoUpDownMarketCard), the navigation param types, PredictMarketDetails, and PredictBuyPreview / PredictBuyWithAnyToken.
  • Analytics layer emits the two properties (only when present) on Predict Trade Transaction and Predict Market Details Opened.

What does not change:

  • entry_point values are unchanged (feed-originated trades remain "predict_feed").
  • No new event names.
  • No changes to surfaces outside of PredictFeed and PredictWorldCup.

Note: the values are forwarded on the primary buy paths (card tap → details → buy, and direct card buy). The secondary "Outcomes tab inside Market Details" buy path still carries entry_point but not the new tab/screen, since extending it would touch additional nested components beyond the scope of this ticket.

Changelog

CHANGELOG entry: null

Related issues

Fixes: PRED-938

Manual testing steps

Feature: Predict feed tab and screen analytics attribution

  Scenario: user trades from a Predict feed tab
    Given the user is on the Predict feed on the "trending" tab
    When the user taps a market card and places a trade
    Then the "Predict Trade Transaction" event includes predict_feed_tab "trending"
    And the "Predict Market Details Opened" event includes predict_feed_tab "trending"
    And entry_point remains "predict_feed"

  Scenario: user trades from the World Cup hub
    Given the user is on the Predict World Cup screen on a given tab
    When the user taps a market card and places a trade
    Then the "Predict Trade Transaction" event includes that tab key as predict_feed_tab
    And the event includes predict_screen "world_cup"

Screenshots/Recordings

No UI changes — analytics-only enrichment.

Before

N/A

After

Screenshot 2026-06-01 at 9 18 27 PM

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
  • I've tested with a power user scenario
  • I've instrumented key operations with Sentry traces for production performance metrics

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 optional fields on existing navigation and event paths; no changes to trading, auth, or payment logic.

Overview
This PR threads predict_feed_tab and predict_screen from feed market cards into trade and market-details analytics, using the same optional-prop pattern as entry_point and transactionActiveAbTests.

PredictFeed passes the active category as predictFeedTab; PredictWorldCup passes the active tab plus predict_screen: world_cup. PredictMarket forwards both props to all card variants, which include them when navigating to market details or opening the buy sheet. Route types, parseAnalyticsProperties, and buy preview screens carry the values into order analytics; PredictAnalytics and predictAnalyticsEvents emit predict_feed_tab / predict_screen on Predict Trade Transaction and Predict Market Details Opened only when set. Tests cover forwarding and property mapping.

entry_point behavior is unchanged. Buys initiated only from the market details outcomes tab still do not get tab/screen context (called out in the PR).

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

…ade events

Forward the active feed tab key and screen context from PredictFeed and
PredictWorldCup market cards through to the Predict Trade Transaction and
Predict Market Details Opened analytics events, mirroring the existing
entry_point path (card -> PredictMarketDetails route params -> buy preview
-> analyticsProperties). entry_point values are unchanged.

PRED-938
@github-actions

github-actions Bot commented Jun 2, 2026

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 Jun 2, 2026
@mm-token-exchange-service mm-token-exchange-service Bot added the team-predict Predict team label Jun 2, 2026
@github-actions github-actions Bot added the size-M label Jun 2, 2026
@matallui matallui marked this pull request as ready for review June 2, 2026 14:43
@matallui matallui requested a review from a team as a code owner June 2, 2026 14:43
@matallui matallui 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 Jun 2, 2026
@github-actions github-actions Bot added the risk:medium AI analysis: medium risk label Jun 2, 2026
@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokePredictions, SmokeWalletPlatform, SmokeConfirmations
  • Selected Performance tags: @PerformancePredict
  • Risk Level: medium
  • AI Confidence: 90%
click to see 🤖 AI reasoning details

E2E Test Selection:
All 19 changed files are within the app/components/UI/Predict/ directory. The changes are purely additive analytics enrichment: two new optional properties (predictFeedTab and predictScreen) are threaded through the Predict component hierarchy to provide richer analytics context about which feed tab and screen a user was on when interacting with prediction markets.

Key observations:

  1. No UI rendering changes - purely prop threading for analytics
  2. No business logic changes - all new props are optional with conditional spreading
  3. Changes span: PredictFeed → PredictMarket → PredictMarketSingle/Multiple/SportCard/CryptoUpDownCard → PredictMarketDetails → PredictBuyPreview/PredictBuyWithAnyToken
  4. Navigation params updated (PredictMarketDetailsParams, PredictBuyPreviewParams) with new optional fields
  5. PredictWorldCup now passes predictFeedTab (active tab) and predictScreen (WORLD_CUP constant)

Tag selection rationale:

  • SmokePredictions: Directly covers the Predict feature - position lifecycle, market interactions, buy flows
  • SmokeWalletPlatform: Required per SmokePredictions description (Predictions is a section inside Trending tab)
  • SmokeConfirmations: Required per SmokePredictions description (opening/closing positions are on-chain transactions)

The changes are low-risk (additive, optional props) but the Predict buy flow and market details navigation are touched, warranting validation of the full Predict flow including confirmations.

Performance Test Selection:
The changes thread new props through the Predict component hierarchy including PredictMarketSingle, PredictMarketMultiple, PredictMarketSportCard, and PredictCryptoUpDownMarketCard. While the changes are additive and minimal (optional props with conditional spreading), the @PerformancePredict tag covers prediction market list loading and market details which are directly affected. However, since the changes are purely analytics prop threading with no rendering logic changes, the performance impact is expected to be negligible. Including @PerformancePredict as a precaution to validate no regression in market list rendering performance.

View GitHub Actions results

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

LGTM

@matallui matallui enabled auto-merge June 2, 2026 20:43
@matallui matallui added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label Jun 2, 2026
@matallui matallui changed the title feat(predict): pass predict_feed_tab and predict_screen through to trade events feat(predict): pass predict_feed_tab and predict_screen through to trade events cp-7.80.0 Jun 2, 2026
@matallui matallui added this pull request to the merge queue Jun 2, 2026
Merged via the queue into main with commit fcb8801 Jun 2, 2026
366 of 370 checks passed
@matallui matallui deleted the predict/pred-938 branch June 2, 2026 21:10
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

risk:medium AI analysis: medium risk size-M skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-predict Predict team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants