Skip to content

feat(predict): add world cup section as empty state#30427

Merged
PatrykLucka merged 12 commits into
mainfrom
feat/world-cup-predict-section
May 21, 2026
Merged

feat(predict): add world cup section as empty state#30427
PatrykLucka merged 12 commits into
mainfrom
feat/world-cup-predict-section

Conversation

@PatrykLucka

@PatrykLucka PatrykLucka commented May 20, 2026

Copy link
Copy Markdown
Contributor

Description

Adds the new Predict-specific empty state experience for wallet home users with no Predict positions. The treatment replaces the generic/trending-only empty state with a sports discovery layout featuring World Cup/NBA championship discovery rows, bracket/stage CTAs, and feature-flagged BTC up/down row scaffolding that is hidden for now.

This PR also implements Segment/MetaMetrics tracking for the Predict Empty State A/B test:

  • Tracks Empty State Viewed exposure for zero-position Predict users.
  • Tracks treatment CTA engagement with cta_name and optional category_name.
  • Threads active_ab_tests through market entry and bet placement paths for downstream attribution.
  • Preserves trending experiment attribution when the trending-only section renders the treatment/list layout.
  • Normalizes championship CTA category tracking so the FIFA World Cup winner row reports category_name: "world_cup" instead of the internal row kind.
  • Adds remote feature flags for the Predict discovery NBA champion row and empty-state experiment handling.

The BTC 5m up/down row is intentionally left hidden and its data/navigation wiring is commented for now because the shared live-market hook work lives on predict/crypto-updown-feed-card and has not merged into main yet. The current branch keeps the row scaffold in place behind SHOW_BTC_UP_DOWN_5M_ROW = false so the later integration should be a small, low-risk follow-up instead of rebuilding the row wiring from scratch.

When predict/crypto-updown-feed-card is merged, enable the BTC row by:

  • Removing the temporary SHOW_BTC_UP_DOWN_5M_ROW guard, or setting it to true if the team still wants a short-lived rollout switch.
  • Uncommenting the shared hook imports and hook call in HomepagePredictWorldCupDiscovery.
  • Replacing the temporary BTC placeholder values with the hook values for spot price, price-to-beat, countdown, market id, and market metadata.
  • Uncommenting the navigateToMarketDetails branch in handleBtcRow so the row opens the current 5m up/down market directly when available.
  • Keeping the fallback Predict crypto market-list navigation for cases where no current 5m market is available.

Changelog

CHANGELOG entry: Added a new Predict discovery empty state for users with no Predict positions

Related issues

Refs: https://consensyssoftware.atlassian.net/browse/TMCU-749
https://consensyssoftware.atlassian.net/browse/TMCU-750
https://consensyssoftware.atlassian.net/browse/TMCU-754

Manual testing steps

Feature: Predict empty state discovery

  Scenario: user with no Predict positions views the Predict section
    Given Predict is enabled
    And the user has zero active or claimable Predict positions

    When the user lands on the wallet home Predict section
    Then the Predict empty state is displayed
    And the Empty State Viewed event is emitted with surface "predict", the assigned variant, and active_ab_tests

  Scenario: user taps a treatment CTA
    Given the user is assigned to the treatment variant
    And the Predict empty state sports discovery layout is visible

    When the user taps a World Cup, NBA, category, or explore CTA
    Then the Empty State CTA Clicked event is emitted with the correct cta_name
    And category_name is included for category-specific CTAs
    And the World Cup winner row reports category_name "world_cup"
    And downstream Market Viewed and Bet Placed attribution includes active_ab_tests

  Scenario: trending-only treatment list preserves attribution
    Given the homepage Predict section is rendered in trending-only mode
    And the discovery experiment assigns the list treatment

    When the user opens a market from the sports discovery list
    Then the Predict market navigation params include the trending experiment transactionActiveAbTests

Screenshots/Recordings

Before

After

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

Medium Risk
Updates homepage Predict rendering and navigation/analytics plumbing to support a new A/B-tested empty-state discovery experience; risk is mainly UI/UX and event attribution correctness across multiple entry points.

Overview
Adds an A/B-tested Predict homepage empty-state experience: when users have no Predict positions, the section can switch from the existing trending carousel to a sports discovery list (World Cup + NBA champion rows, bracket/stage CTAs, and scaffolded BTC 5m up/down row behind a kill switch).

Threads transactionActiveAbTests through Predict navigation and buy flows (cards, row items, feed/search/world-cup routes) and extends analytics to include active_ab_tests for market-details opens plus new empty-state VIEWED/CTA_CLICKED events with surface/variant/cta_name/category_name properties.

Improves World Cup tab behavior by adding fallback stage keys when remote stages is empty and normalizing requested stage keys (hyphen vs underscore), and introduces a new remote feature flag/selector to gate the NBA champion discovery row.

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

@PatrykLucka PatrykLucka self-assigned this May 20, 2026
@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.

@PatrykLucka PatrykLucka force-pushed the feat/world-cup-predict-section branch from fd9f565 to 68dc7b4 Compare May 20, 2026 08:31
@PatrykLucka PatrykLucka added the team-mobile-ux Mobile UX team label May 20, 2026
@PatrykLucka PatrykLucka marked this pull request as ready for review May 20, 2026 08:33
@PatrykLucka PatrykLucka requested review from a team as code owners May 20, 2026 08:33
@PatrykLucka PatrykLucka force-pushed the feat/world-cup-predict-section branch from eca1bf4 to f3c90a9 Compare May 20, 2026 13:05
Comment thread app/components/Views/Homepage/Sections/Predictions/utils/marketResolvers.ts Outdated
cortisiko
cortisiko previously approved these changes May 20, 2026
Comment thread tests/feature-flags/feature-flag-registry.ts Outdated
vinnyhoward
vinnyhoward previously approved these changes May 20, 2026
@PatrykLucka PatrykLucka enabled auto-merge May 20, 2026 16:09
@PatrykLucka PatrykLucka dismissed stale reviews from vinnyhoward and cortisiko via aa798c5 May 21, 2026 10:00
@PatrykLucka PatrykLucka force-pushed the feat/world-cup-predict-section branch from c1ec576 to aa798c5 Compare May 21, 2026 10:00
@PatrykLucka PatrykLucka disabled auto-merge May 21, 2026 10:00
Comment thread app/components/UI/Predict/constants/worldCupTabs.ts
…toUpDownMarketCard and PredictMarket components
Comment thread app/components/UI/Predict/constants/worldCupTabs.ts
Comment thread app/components/Views/Homepage/Sections/Predictions/PredictionsSection.tsx Outdated

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

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

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

E2E Test Selection:
The PR is focused on the Predictions/Polymarket feature area with the following key changes:

  1. Feature flags (CRITICAL file): Two new remote feature flags added - predictHomepageDiscoveryNbaChampionEnabled and coreMCU747AbtestPredictPositionsEmptyState (A/B test for carousel vs sports discovery list layout in the Predictions homepage section).

  2. Analytics events (CRITICAL file): Two new Predict empty state analytics events added (PREDICT_EMPTY_STATE_VIEWED, PREDICT_EMPTY_STATE_CTA_CLICKED). Additive change, low risk.

  3. Predictions UI refactoring: Major refactoring of PredictionsSection.tsx - extracted into sub-components (HomepagePredictPositions, HomepagePredictTrendingMarkets, HomepagePredictWorldCupDiscovery). New hooks for A/B test management (usePredictHomepageDiscoveryExperiment, usePredictionsDefaultSectionModel, useTreatmentDiscoveryFeedsLoading). New NBA champion discovery row. transactionActiveAbTests propagation through navigation.

  4. PredictWorldCup: Updated to pass transactionActiveAbTests through navigation params.

Tag selection rationale:

  • SmokePredictions: Primary tag - all changes are in the Predictions feature area (Polymarket integration, positions, markets, homepage section)
  • SmokeWalletPlatform: Required per SmokePredictions description - "Predictions is also a section inside the Trending tab (SmokeWalletPlatform); changes to Predictions views affect Trending"
  • SmokeConfirmations: Required per SmokePredictions description - "opening/closing positions are on-chain transactions - also select SmokeConfirmations"

No changes to swap, stake, accounts, network, browser, snaps, or other unrelated areas.

Performance Test Selection:
The PredictionsSection has been significantly refactored with new sub-components and an A/B test that switches between carousel and list layouts. The new usePredictionsDefaultSectionModel hook adds new loading state logic, and the HomepagePredictWorldCupDiscovery component introduces new market rows (BTC live row, championship row, world cup row, bracket pills). These layout changes and new rendering paths could impact prediction market list loading and display performance, making @PerformancePredict relevant.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@PatrykLucka PatrykLucka added this pull request to the merge queue May 21, 2026
Merged via the queue into main with commit aec07ab May 21, 2026
197 of 200 checks passed
@PatrykLucka PatrykLucka deleted the feat/world-cup-predict-section branch May 21, 2026 15:29
@github-actions github-actions Bot locked and limited conversation to collaborators May 21, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.79.0 Issue or pull request that will be included in release 7.79.0 label May 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.79.0 Issue or pull request that will be included in release 7.79.0 size-XL team-mobile-ux Mobile UX team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants