Skip to content

fix: less than 6 items on explore predictions cp-7.80.0#30949

Merged
juanmigdr merged 8 commits into
mainfrom
fix/less-than-6-items-on-explore-predictions
Jun 3, 2026
Merged

fix: less than 6 items on explore predictions cp-7.80.0#30949
juanmigdr merged 8 commits into
mainfrom
fix/less-than-6-items-on-explore-predictions

Conversation

@juanmigdr

@juanmigdr juanmigdr commented Jun 2, 2026

Copy link
Copy Markdown
Member

Description

Seems like client side filtering on prediction markets was added with these 2 PRs:

This has caused Explore sections showing less than 6 items in multiple cases. Why? Because we fetch 6 items and there is a high chance at least one of them gets filtered out. To overcome this, we have updated the request to use the default of 20 items instead of 6

Changelog

CHANGELOG entry: fix less than 6 items on explore predictions cp-7.80.0

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-3308

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

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

Low Risk
UI-only feed sizing and display cap in Explore predictions; no auth, payments, or security paths.

Overview
Explore predictions carousels were showing fewer than six cards because feeds only requested six markets while client-side filtering dropped some results.

usePredictionsFeed, useWorldCupPredictionsFeed, and useExploreSearch no longer pass a six-item pageSize, so underlying predict hooks use their default (20) and return a larger pool after filtering. PredictionsCarouselSection still shows at most six items by passing feed.data.slice(0, 6) into the horizontal carousel. Tests were updated to stop expecting pageSize: 20 on explore search.

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

@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
@github-actions github-actions Bot added size-M risk:medium AI analysis: medium risk labels Jun 2, 2026
@juanmigdr juanmigdr 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
@juanmigdr juanmigdr enabled auto-merge June 2, 2026 17:35
@github-actions github-actions Bot added size-S and removed size-M labels Jun 2, 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 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 3405810. Configure here.

query,
refresh,
enabled = true,
pageSize = 6,

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.

Home carousel shows twenty items

Medium Severity

Removing pageSize from usePredictionsFeed drops the previous default of six and lets usePredictMarketData fetch twenty markets. Explore uses PredictionsCarouselSection with slice(0, 6), but Predict home’s featured carousel still passes full predictions.data to HorizontalCarousel, so it can show up to twenty cards instead of six.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3405810. Configure here.

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokePredictions, SmokeWalletPlatform
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 92%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes are confined to the TrendingView predictions feed components:

  1. PredictionsCarouselSection.tsx: Now slices data client-side to max 6 items (feed.data.slice(0, 6)) instead of passing pageSize to the API.
  2. usePredictionsFeed.ts: Removed pageSize option from the hook - no longer passes page size to API calls.
  3. useWorldCupPredictionsFeed.ts: Same removal of pageSize option.
  4. useExploreSearch.ts: Removed PREDICTIONS_SEARCH_PAGE_SIZE = 20 constant and its usage when calling usePredictionsFeed for search.
  5. useExploreSearch.test.ts: Updated unit test to remove pageSize: 20 assertion.

This is a refactoring of how prediction market data is paginated - moving from API-level page size control to client-side slicing for the carousel display. The search path no longer requests a larger page size (20) from the API.

Tag selection rationale:

  • SmokePredictions: Directly tests the Predictions/Polymarket integration including market browsing and position flows. The carousel data slicing change could affect what markets are displayed.
  • SmokeWalletPlatform: Required per SmokePredictions tag description - "Predictions is also a section inside the Trending tab (SmokeWalletPlatform); changes to Predictions views affect Trending. When selecting SmokePredictions, also select SmokeWalletPlatform."

No other tags are needed - no confirmations flow changes, no controller changes, no navigation changes, no account/network changes.

Performance Test Selection:
The changes are a minor refactoring of data pagination - moving from API-level page size to client-side slicing. This does not introduce new rendering complexity, additional API calls, or changes to data loading patterns that would meaningfully impact performance metrics. No performance tests are warranted.

View GitHub Actions results

@juanmigdr juanmigdr added this pull request to the merge queue Jun 3, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 3, 2026
@juanmigdr juanmigdr added this pull request to the merge queue Jun 3, 2026
Merged via the queue into main with commit 6ba76b4 Jun 3, 2026
334 of 343 checks passed
@juanmigdr juanmigdr deleted the fix/less-than-6-items-on-explore-predictions branch June 3, 2026 09:04
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 3, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.81.0 Issue or pull request that will be included in release 7.81.0 label Jun 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.81.0 Issue or pull request that will be included in release 7.81.0 risk:medium AI analysis: medium risk size-S team-assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants