Skip to content

feat(predict): Add World Cup tab data hooks and content#30162

Merged
matallui merged 6 commits into
mainfrom
predict/pred-879
May 14, 2026
Merged

feat(predict): Add World Cup tab data hooks and content#30162
matallui merged 6 commits into
mainfrom
predict/pred-879

Conversation

@matallui

@matallui matallui commented May 13, 2026

Copy link
Copy Markdown
Contributor

Description

Adds the World Cup Predict data layer and wires it into the dedicated World Cup screen so the tab row and tab content are driven by Polymarket data instead of placeholders.

This includes:

  • World Cup-specific query builders/options for All, Live, Props, and configured stage tabs.
  • Lightweight availability checks for tabs that should be hidden when empty.
  • A unified cached usePredictWorldCupMarkets hook using React Query for tab content.
  • Prefetching visible World Cup tab content after availability resolves to reduce skeletons during tab switches.
  • World Cup screen tab rendering and market list content using existing Predict market cards.
  • Unit tests for query shapes, availability behavior, caching, hidden tabs, and World Cup game parsing.

Changelog

CHANGELOG entry: null

Related issues

Fixes: PRED-879

Manual testing steps

Feature: Predict World Cup tab data

  Scenario: user views and switches World Cup tabs
    Given the Predict World Cup feature flag is enabled with World Cup identifiers and stage event IDs
    And the user opens the World Cup Predict screen

    When tab availability finishes loading
    Then tabs with active content are visible
    And tabs without active content are hidden

    When user switches between All, Props, Live, and configured stage tabs
    Then market content loads for the selected tab
    And previously loaded tabs reuse cached data without showing the full loading skeleton again

Screenshots/Recordings

N/A — data/query wiring and existing UI composition. Manually validated in simulator during development.

Before

N/A

After

Screen.Recording.2026-05-14.at.8.36.08.AM.mov

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
Medium risk because it adds new React Query data-fetching/prefetching paths and changes the World Cup screen to render paginated market lists and conditional tabs based on API-driven availability.

Overview
World Cup Predict is now data-driven instead of placeholder-driven. The PR introduces a World Cup-specific data layer (query keys/options, services, and hooks) to fetch Polymarket markets for All, Live, Props, and configured stage tabs, including pagination where appropriate and deterministic start-time sorting for stage/game markets.

Tabs are now conditionally shown/hidden based on lightweight availability checks, and resolvePredictWorldCupInitialTab/getPredictWorldCupAvailableTabKeys take this availability into account. The World Cup screen is rewired to use usePredictWorldCupAvailableTabs + usePredictWorldCupMarkets, rendering a FlashList of PredictMarket cards with skeleton/loading, pull-to-refresh, error state, and prefetching of visible tabs to reduce reloads on tab switches.

Adds/updates unit tests covering query shapes, tab availability + initial-tab fallback, market hook caching/pagination behavior, stage edge cases (no event IDs), and World Cup game parsing in Polymarket utils.

Reviewed by Cursor Bugbot for commit 240a4a1. Bugbot is set up for automated code reviews on this repo. 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.

@metamaskbotv2 metamaskbotv2 Bot added the team-predict Predict team label May 13, 2026
@matallui matallui changed the title [PRED-879] Add World Cup tab data hooks and content feat(predict): Add World Cup tab data hooks and content May 13, 2026
@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:
All 13 changed files are new additions within app/components/UI/Predict/ implementing a World Cup prediction market feature:

  1. constants/worldCupTabs.ts - New tab key constants (ALL, LIVE, PROPS) and availability resolution logic for World Cup tabs
  2. hooks/usePredictWorldCup.ts - New hooks for fetching World Cup markets with infinite pagination, availability checks, and tab prefetching via React Query
  3. hooks/index.ts - Updated exports to include new World Cup hooks
  4. queries/worldCup.ts - New React Query options for World Cup market data (markets, availability, stages)
  5. services/worldCup.ts - New service layer using PredictController.getMarkets() to fetch World Cup markets with sorting
  6. utils/worldCup.ts - Utility functions for building Polymarket query strings (all, props, live, stage queries)
  7. views/PredictWorldCup/PredictWorldCup.tsx - New screen component with tabbed navigation, FlashList rendering, pull-to-refresh, and pagination

SmokePredictions: Directly applicable - these changes add new World Cup prediction market functionality within the Predictions (Polymarket) feature. The new PredictWorldCup screen, hooks, queries, and services all extend the Predictions feature area.

SmokeWalletPlatform: Per SmokePredictions tag description, "Predictions is also a section inside the Trending tab (SmokeWalletPlatform); changes to Predictions views (headers, lists, full views) affect Trending." The new PredictWorldCup view is a Predictions view accessible from the Trending tab.

SmokeConfirmations: Per SmokePredictions tag description, "opening/closing positions are on-chain transactions - when selecting SmokePredictions, also select SmokeConfirmations." The World Cup screen leads to market position flows that involve transaction confirmations.

All changes are self-contained new additions with no modifications to shared infrastructure (Engine, navigation, controllers). No existing E2E tests appear to cover the World Cup feature specifically, but the existing SmokePredictions tests validate the broader Predictions flow that this feature integrates with.

Performance Test Selection:
The new PredictWorldCup screen introduces a FlashList-based market list with infinite pagination, pull-to-refresh, and multiple concurrent React Query fetches for tab availability. These patterns could impact prediction market list loading performance. The @PerformancePredict tag covers prediction market list loading and balance display, which is directly relevant to the new World Cup market listing functionality.

View GitHub Actions results

@matallui matallui marked this pull request as ready for review May 13, 2026 23:14
@matallui matallui requested a review from a team as a code owner May 13, 2026 23:14
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
62.1% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@matallui matallui added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label May 14, 2026
@matallui

matallui commented May 14, 2026

Copy link
Copy Markdown
Contributor Author

Skipping Sonar Cloud due to the nature of these changes, since most of this code is temporary for the world cup event.

@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 added this pull request to the merge queue May 14, 2026
Merged via the queue into main with commit 0c60aeb May 14, 2026
210 of 217 checks passed
@matallui matallui deleted the predict/pred-879 branch May 14, 2026 15:13
@github-actions github-actions Bot locked and limited conversation to collaborators May 14, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.78.0 Issue or pull request that will be included in release 7.78.0 label May 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.78.0 Issue or pull request that will be included in release 7.78.0 size-XL 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