fix(predict): show predict claim button and carousel when claimable positions#28927
Conversation
|
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. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ 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 68b3cf4. Configure here.
eb323ed to
da17d89
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #28927 +/- ##
==========================================
+ Coverage 82.19% 82.20% +0.01%
==========================================
Files 5040 5042 +2
Lines 132405 132404 -1
Branches 29550 29560 +10
==========================================
+ Hits 108824 108837 +13
+ Misses 16175 16167 -8
+ Partials 7406 7400 -6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The claim button on the homepage Predictions section was only visible when the user had active (open) positions. When all positions were resolved/claimable with no active ones, the render gate fell through to the trending markets carousel — hiding the claim button entirely. - Add hasClaimablePositions flag to the section data hook so the render gate considers claimable positions alongside active ones - Show the featured markets carousel above the claim button when the user has no active positions (claimable-only state) - Add showHeader prop to both HomepagePredictPositions and HomepagePredictTrendingMarkets to avoid duplicate section headers - Apply the same fix to positions-only mode - Add 6 tests covering claimable-only scenarios for both default and positions-only modes
da17d89 to
8b5487e
Compare
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
SmokePredictions: Directly required — the changes affect the Predictions section UI, position display, claim button rendering, and the claimable-only state flow. E2E tests for predictions (opening positions, cashing out, claiming winnings, balance sync) need to be validated. SmokeWalletPlatform: Required per SmokePredictions tag description — Predictions is a section inside the Trending tab. Changes to Predictions views (headers, lists, full views) affect Trending. The SmokeConfirmations: Required per SmokePredictions tag description — opening/closing positions and claiming winnings are on-chain transactions that go through the confirmations flow. Performance Test Selection: |
|
|
✅ E2E Fixture Validation — Schema is up to date |




Description
The Claim button on the homepage Predictions section was invisible when the user had only resolved/claimable positions and no active (open) positions. The render gate in
PredictionsSectionDefaultonly checked for active positions (hasPositions), so when all positions were settled the section fell through to the trending markets carousel — which has no claim button.Root cause:
usePredictPositionsForHomepage()(called without options) defaults toclaimable: falseand returns only active positions. The gateif (hasPositions || isLoadingPositions)therefore evaluated tofalsewhen only claimable positions existed, skipping the entire positions view (which contains the claim button).Fix:
hasClaimablePositionsderived fromtotalClaimableValue > 0after loading completes.PredictionsSectionDefaultandPredictionsSectionPositionsOnlyto consider claimable positions alongside active ones.showHeaderprop toHomepagePredictTrendingMarketsandHomepagePredictPositionsto avoid duplicate "Predictions >" section headers in the combined view.Changelog
CHANGELOG entry: null
Related issues
Fixes: PRED-825
Manual testing steps
Screenshots/Recordings
Screen.Recording.2026-04-16.at.10.58.34.mov
Before
After
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Low Risk
Low risk UI/render-logic change limited to the homepage Predictions section; main risk is unintended empty/loading gating or duplicated headers affecting what renders and analytics counts.
Overview
Fixes the homepage Predictions section so it renders when users only have claimable (settled) positions, ensuring the
Claimbutton is visible even with no active positions.When in this claimable-only state, the section can now show the trending markets carousel above the claim button/positions container while avoiding duplicate headers via a new
showHeaderoption on the shared header components, and it updates loading/empty/error gating +itemCountcalculations accordingly (includingmode="positions-only").Adds tests covering claimable-only rendering (claim button shown, optional carousel presence, no active rows) and the positions-only null/claimable behaviors.
Reviewed by Cursor Bugbot for commit 8b5487e. Bugbot is set up for automated code reviews on this repo. Configure here.