Skip to content

feat: update World Cup event count in PredictionsSection and related components#31465

Merged
PatrykLucka merged 3 commits into
mainfrom
update-world-cup-events-counts
Jun 11, 2026
Merged

feat: update World Cup event count in PredictionsSection and related components#31465
PatrykLucka merged 3 commits into
mainfrom
update-world-cup-events-counts

Conversation

@PatrykLucka

@PatrykLucka PatrykLucka commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Description

This PR updates the homepage Predictions World Cup discovery row so the “events in total” count comes from Polymarket’s lightweight pagination endpoint instead of the loaded World Cup market list.
The row now uses:
https://gamma-api.polymarket.com/events/pagination?tag_slug=fifa-world-cup&limit=1&active=true&closed=false&archived=false
and reads pagination.totalResults.
This prevents the UI from showing partial loaded counts like 19+ or 20+ when the real total is much higher. The + suffix is preserved.

Changelog

CHANGELOG entry: Fixed the World Cup events count shown in the homepage Predictions discovery row.

Related issues

Fixes:

Manual testing steps

Feature: Homepage Predictions World Cup event count

  Scenario: user views the World Cup discovery row in Predictions
    Given Predict is enabled
    And the homepage Predictions discovery layout is shown

    When the user views the FIFA World Cup 2026 row
    Then the row shows the total event count from the Polymarket pagination API
    And the count keeps the plus suffix
    And the row does not show a partial loaded market count such as "19+" or "20+"

Screenshots/Recordings

Before

Screenshot 2026-06-10 at 13 07 25

After

Screenshot 2026-06-10 at 12 59 32

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

Low Risk
Read-only UI and a lightweight external count API; no auth, payments, or data writes.

Overview
Fixes the homepage Predictions FIFA World Cup 2026 row so “events in total” reflects Polymarket’s full catalog instead of how many markets are already loaded.

A new useHomepagePredictWorldCupEventCount hook calls Gamma /events/pagination with limit=1 and the remote-configured World Cup tag, then surfaces pagination.totalResults via React Query (with refetch on section pull-to-refresh). PredictionsSection loads that count alongside existing World Cup/NBA discovery feeds and treats event-count fetching as part of discovery loading.

HomepagePredictWorldCupDiscovery stops deriving the label from marketData.length / hasMore and always formats the API total with the overflow copy (e.g. 48+ events in total). MensWorldCupRow hides the subtitle until a count is available so partial loaded counts are not shown while the pagination request is in flight.

Hook and section tests cover the pagination URL, invalid/missing totals, disabled queries, and the new UI assertion.

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

@PatrykLucka PatrykLucka self-assigned this Jun 10, 2026
@PatrykLucka PatrykLucka added the team-mobile-ux Mobile UX team label Jun 10, 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.

@mm-token-exchange-service mm-token-exchange-service Bot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Jun 10, 2026
@mm-token-exchange-service

mm-token-exchange-service Bot commented Jun 10, 2026

Copy link
Copy Markdown

PR template — items to address before "Ready for review"

Warnings — informational, address before merging:

  • Related issues section is empty. Add Fixes: #123 / Closes: <URL> / Refs: <Jira key>, or write a short rationale after the colon.
  • Pre-merge author checklist has unchecked items (e.g. "I've tested on Android"). Every box must be consciously checked — see docs/readme/ready-for-review.md.

See docs/readme/ready-for-review.md for the full Definition of Ready for Review.

@codecov-commenter

codecov-commenter commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.77778% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.12%. Comparing base (819ae64) to head (8854d8b).
⚠️ Report is 43 commits behind head on main.

Files with missing lines Patch % Lines
...ictions/hooks/useHomepagePredictWorldCupMarkets.ts 84.61% 2 Missing and 2 partials ⚠️
...mepage/Sections/Predictions/PredictionsSection.tsx 66.66% 2 Missing ⚠️
...mepagePredictWorldCupDiscovery/MensWorldCupRow.tsx 0.00% 0 Missing and 1 partial ⚠️
...ponents/HomepagePredictWorldCupDiscovery/index.tsx 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #31465      +/-   ##
==========================================
+ Coverage   83.10%   83.12%   +0.01%     
==========================================
  Files        5700     5709       +9     
  Lines      146961   147218     +257     
  Branches    34249    34323      +74     
==========================================
+ Hits       122126   122368     +242     
+ Misses      16593    16588       -5     
- Partials     8242     8262      +20     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@PatrykLucka PatrykLucka marked this pull request as ready for review June 11, 2026 09:17
@PatrykLucka PatrykLucka requested a review from a team as a code owner June 11, 2026 09:17
@mm-token-exchange-service mm-token-exchange-service Bot removed the INVALID-PR-TEMPLATE PR's body doesn't match template label Jun 11, 2026

@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 2 potential issues.

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 8854d8b. Configure here.

@github-actions github-actions Bot added the risk:medium AI analysis: medium risk label Jun 11, 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: 90%
click to see 🤖 AI reasoning details

E2E Test Selection:
The PR modifies the Predictions section of the Homepage, specifically:

  1. New hook useHomepagePredictWorldCupEventCount: Adds a dedicated API call to /events/pagination to fetch the total World Cup event count, replacing the previous approach of deriving it from marketData.length + hasMore.

  2. PredictionsSection.tsx: Integrates the new hook into all three section variants (Default, TrendingOnly, SportsOnly), adding it to loading state checks and refresh logic.

  3. HomepagePredictWorldCupDiscovery/index.tsx: Changes event count label logic to use the new dedicated count from the API rather than local data.

  4. MensWorldCupRow.tsx: Makes eventCountLabel optional (renders nothing when undefined/loading).

Tag selection rationale:

  • SmokePredictions: Directly affected - changes to Predictions views, hooks, and the World Cup discovery rail display logic.
  • SmokeWalletPlatform: Required per SmokePredictions tag description since Predictions is a section inside the Trending tab; changes to Predictions views affect Trending.
  • SmokeConfirmations: Required per SmokePredictions tag description (opening/closing positions are on-chain transactions).

The changes are medium risk as they introduce a new network request and modify how event counts are displayed, but don't touch core infrastructure, navigation, or transaction flows directly.

Performance Test Selection:
The PR adds a new API call (useHomepagePredictWorldCupEventCount fetching /events/pagination) that runs on the Predictions homepage section. This additional network request could impact the loading performance of the Predictions/Predict market section. The @PerformancePredict tag covers prediction market list loading, market details, deposit flows, and balance display - all of which could be affected by the additional fetch and the changed loading state logic.

View GitHub Actions results

@github-actions

Copy link
Copy Markdown
Contributor

⚡ Performance Test Results

ℹ️ Performance test results are currently non-blocking and will not block this PR.

All tests passed · 3 tests · 1 device

📱 Devices tested (1)

Android: Google Pixel 8 Pro (v14.0)

✅ Passed Tests (3)
Test Platform Device Duration Team Recording
Predict Available Balance - Complete Flow Performance Android Google Pixel 8 Pro (v14.0) 0.78s @team-predict 📹 Watch
Predict Deposit - Complete Flow Performance Android Google Pixel 8 Pro (v14.0) 11.86s @team-predict 📹 Watch
Predict Market Details - Complete Flow Performance Android Google Pixel 8 Pro (v14.0) 7.32s @team-predict 📹 Watch

Branch: update-world-cup-events-counts · Build: Normal · Commit: 1749937 · View full run

@PatrykLucka PatrykLucka added this pull request to the merge queue Jun 11, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 11, 2026
@PatrykLucka PatrykLucka added this pull request to the merge queue Jun 11, 2026
Merged via the queue into main with commit 3f60d87 Jun 11, 2026
130 of 132 checks passed
@PatrykLucka PatrykLucka deleted the update-world-cup-events-counts branch June 11, 2026 13:05
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 11, 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 team-mobile-ux Mobile UX team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants