Skip to content

chore(predict): add world cup tab to main predict feed#30205

Merged
matallui merged 4 commits into
mainfrom
predict/PRED-874-predict-world-cup-add-world-cup-tab-to-main-predict-feed
May 15, 2026
Merged

chore(predict): add world cup tab to main predict feed#30205
matallui merged 4 commits into
mainfrom
predict/PRED-874-predict-world-cup-add-world-cup-tab-to-main-predict-feed

Conversation

@caieu
Copy link
Copy Markdown
Contributor

@caieu caieu commented May 14, 2026

Description

This PR adds the World Cup tab to the main Predict feed behind the existing predictWorldCup.enabled && showMainFeedTab configuration.

It does this by:

  • adding world-cup as a Predict tab/category key and rendering it before Hot and Trending when enabled
  • moving tab-specific query params onto each FeedTab, so Hot and World Cup can coexist without special casing Hot in PredictFeed
  • using buildPredictWorldCupAllQuery for the main feed World Cup tab so it mirrors the dedicated World Cup screen All tab market universe
  • extending Polymarket event query handling so exact custom params are respected for Hot and World Cup categories
  • preserving existing tab behavior by falling back to the first visible tab when a requested tab is hidden

Automated coverage was added or updated for tab injection/order, disabled behavior, custom query params, and World Cup event query generation.

Verified with:

  • yarn jest app/components/UI/Predict/hooks/usePredictTabs.test.ts
  • yarn jest app/components/UI/Predict/views/PredictFeed/PredictFeed.test.tsx
  • yarn jest app/components/UI/Predict/providers/polymarket/utils.test.ts

Changelog

CHANGELOG entry: Added a World Cup tab to the Predict feed when enabled.

Related issues

Fixes: PRED-874

Manual testing steps

Feature: Predict World Cup main feed tab

  Scenario: World Cup tab appears first when enabled
    Given Predict is available
    And the predictWorldCup flag is enabled with showMainFeedTab true
    When user opens the main Predict feed
    Then the World Cup tab appears before Trending
    And World Cup markets load from the World Cup All tab query

  Scenario: World Cup and Hot tabs coexist when both flags are enabled
    Given predictWorldCup is enabled with showMainFeedTab true
    And predictHotTab is enabled
    When user opens the main Predict feed
    Then World Cup appears first
    And Hot appears after World Cup
    And selecting Hot loads Hot tab markets

  Scenario: World Cup tab remains hidden when disabled
    Given predictWorldCup is disabled or showMainFeedTab is false
    When user opens the main Predict feed
    Then the World Cup tab is not shown
    And Trending is the first standard tab

  Scenario: World Cup tab can be opened from the main feed tab deeplink
    Given predictWorldCup is enabled with showMainFeedTab true
    When user opens https://link.metamask.io/predict?tab=world-cup
    Then the main Predict feed opens with the World Cup tab selected

Screenshots/Recordings

Screen.Recording.2026-05-14.at.16.35.35.mov

Before

N/A

After

To be added after manual testing.

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
Changes tab composition and Polymarket event query generation for new world-cup category, which can affect which markets are fetched and shown when feature flags/deeplinks are used.

Overview
Adds a new world-cup category/tab to the main Predict feed (gated by selectPredictWorldCupMainFeedTabEnabledFlag), rendered ahead of Hot/Trending and selectable via deeplink when available.

Refactors tab handling so each FeedTab carries optional customQueryParams, letting Hot and World Cup supply their own Polymarket query strings without PredictFeed special-casing.

Updates fetchEventsFromPolymarketApi to treat Hot and World Cup as exact-query categories (skip default liquidity/volume filters when customQueryParams are provided) and adds a World Cup default query fallback using PREDICT_WORLD_CUP_DEFAULT_TAG_SLUG. Tests are expanded across usePredictTabs, PredictFeed, and Polymarket utils to cover ordering, deeplink fallback when tabs are hidden, and query param behavior.

Reviewed by Cursor Bugbot for commit 94108b7. 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 14, 2026
@caieu caieu marked this pull request as ready for review May 14, 2026 20:49
@caieu caieu requested a review from a team as a code owner May 14, 2026 20:49
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

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 9d708fe. Configure here.

Comment thread app/components/UI/Predict/providers/polymarket/utils.ts Outdated
@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: 90%
click to see 🤖 AI reasoning details

E2E Test Selection:
All 8 changed files are within the app/components/UI/Predict/ directory, focused on adding a new "World Cup" tab to the Polymarket prediction market feed.

Key changes:

  1. types/index.ts: Added 'world-cup' as a new PredictCategory type
  2. constants/feedTabs.ts: Added PREDICT_WORLD_CUP_TAB constant and included it in PREDICT_ALL_TABS array
  3. hooks/usePredictTabs.ts: Added World Cup tab support via feature flags (selectPredictWorldCupMainFeedTabEnabledFlag, selectPredictWorldCupConfig); refactored customQueryParams to be per-tab (moved from hotTabQueryParams return value to per-tab property); added tab validation to ensure requested tab exists in current tab list
  4. providers/polymarket/utils.ts: Added 'world-cup' to EXACT_QUERY_PARAM_CATEGORIES; added fallback query params for world-cup category using PREDICT_WORLD_CUP_DEFAULT_TAG_SLUG; updated categoryTagMap type to exclude 'world-cup'
  5. views/PredictFeed/PredictFeed.tsx: Removed hotTabQueryParams prop from PredictFeedTabs; now uses tab.customQueryParams directly (cleaner per-tab approach)
  6. Test files: Updated unit tests to cover new World Cup tab behavior

Tag selection rationale:

  • SmokePredictions: Directly affected — the Predict feed tabs, market data fetching, and Polymarket API integration are all modified. The World Cup tab is a new feature in the prediction market.
  • SmokeWalletPlatform: Per SmokePredictions tag description: "Predictions is also a section inside the Trending tab (SmokeWalletPlatform); changes to Predictions views affect Trending." The PredictFeed component is embedded in Trending.
  • SmokeConfirmations: Per SmokePredictions tag description: "opening/closing positions are on-chain transactions — when selecting SmokePredictions, also select SmokeConfirmations."

No other tags are needed as changes are entirely self-contained within the Predict feature area and don't touch shared infrastructure, navigation, controllers, or other wallet features.

Performance Test Selection:
The changes modify the PredictFeed tab rendering and market data fetching logic. Adding a new World Cup tab with custom query params could affect prediction market list loading performance. The refactoring of customQueryParams from a single hotTabQueryParams to per-tab params changes how market data is fetched for each tab, which could impact @PerformancePredict metrics for feed loading and tab switching.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

@matallui matallui added this pull request to the merge queue May 15, 2026
Merged via the queue into main with commit 2692fda May 15, 2026
102 checks passed
@matallui matallui deleted the predict/PRED-874-predict-world-cup-add-world-cup-tab-to-main-predict-feed branch May 15, 2026 15:51
@github-actions github-actions Bot locked and limited conversation to collaborators May 15, 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 15, 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-M team-predict Predict team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants