feat(rewards): Ondo GM portfolio position and leaderboard section#27971
Conversation
- Rename OndoCampaignPortfolio* → OndoPortfolio* for consistency - Move leaderboard section header into OndoCampaignDetailsView (pressable) - Add "Your Position" title to OndoLeaderboardPosition component - Wire portfolio position backend hook and reducer selectors - Add i18n strings for new leaderboard position and portfolio keys Co-authored-by: VGR-GIT <vangulckrik@gmail.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
|
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. |
…lio render `if (hasFetched)` unconditionally returned the empty-state banner after any completed fetch, making the portfolio rendering path unreachable. Changed to `if (hasFetched && !portfolio)` to match the pattern used by OndoLeaderboardPosition. Adds OndoPortfolio unit tests covering loading, error, empty, unfetched, and data-display states. Co-authored-by: VGR-GIT <vangulckrik@gmail.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
…leaderboard, and CampaignDtoState types - Replace deprecated `phases` with `steps` in OndoCampaignHowItWorks test fixtures - Add missing `isLeaderboardNotYetComputed` to OndoLeaderboardView test hookDefaults - Add required `image` field to CampaignDtoState inline test fixtures - Remove `castDraft` import from `@reduxjs/toolkit` (not re-exported); use direct assignment instead Co-authored-by: VGR-GIT <vangulckrik@gmail.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
…tests - Add ondoCampaignPortfolio to initial-background-state.json fixture - Add setOndoCampaignLeaderboardNotYetComputed mock to useGetOndoLeaderboard test - Remove unused sumPositionField and ZERO from OndoPortfolio.utils.ts Co-authored-by: VGR-GIT <vangulckrik@gmail.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
…ty banner Remove !hasFetched from showSkeleton so that isLoading && !portfolio correctly triggers the skeleton on retry, preventing the empty-state banner from flashing while a re-fetch is in progress. Update snapshots for ondoCampaignPortfolio state. Co-authored-by: VGR-GIT <vangulckrik@gmail.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #27971 +/- ##
===========================================
- Coverage 82.56% 58.82% -23.74%
===========================================
Files 4825 4844 +19
Lines 123955 124692 +737
Branches 27617 27809 +192
===========================================
- Hits 102346 73355 -28991
- Misses 14560 45344 +30784
+ Partials 7049 5993 -1056 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…andling - Fix RewardsController cache test to include image:null in expected result - Fix formatComputedAt to return '' for invalid dates using isNaN check - Update 'Up next' label to 'Coming soon' across tests and en.json - Tighten OndoLeaderboard formatComputedAt test assertion Co-authored-by: VGR-GIT <vangulckrik@gmail.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
172345c to
4ec5b08
Compare
- useGetOndoLeaderboard: add tests for isLeaderboardNotYetComputed selector, 404 error handling (dispatches notYetComputed instead of error), and setOndoCampaignLeaderboardNotYetComputed dispatch on early return/success path - useRewardCampaigns: add tests for hasLoadedRef optimization — dispatches setCampaignsLoading(true) only when hasLoaded=false - OndoPortfolio.utils: add full test coverage for formatPnlPercent and isPnlNonNegative functions - OndoPortfolio: add navigation press tests, PnL rendering (positive/negative/ non-numeric), units text, updatedAt text, and empty positions state - OndoLeaderboardPosition: add RewardsInfoBanner mock and tests for isLeaderboardNotYetComputed=true state (NOT_YET_COMPUTED banner shown/hidden) - OndoLeaderboardView: add test for isLeaderboardNotYetComputed=true rendering Co-authored-by: VGR-GIT <vangulckrik@gmail.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
…al state Remove ondoCampaignLeaderboardNotYetComputed from the Redux store entirely. The flag is transient UI state owned by useGetOndoLeaderboard, so it now lives in useState. OndoLeaderboardPosition no longer accepts the prop — the not-yet-computed banner it showed was driven by the wrong data source (the general leaderboard 404, not the position endpoint). Co-authored-by: VGR-GIT <vangulckrik@gmail.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
SmokeWalletPlatform is selected because:
SmokePerps is selected because:
No other tags are warranted - the changes are isolated to the Rewards/Ondo campaign feature area and don't touch confirmations, accounts, identity, network, trade, or other feature areas. Performance Test Selection: |
|
|
✅ E2E Fixture Validation — Schema is up to date |




This is mostly about implementing the positions section on the ondo campaign details page, but it also has some changes to the leaderboard components.
Jira
RWDS-1102
Changelog
CHANGELOG entry: Ondo GM campaign portfolio positions
Screenshots/Recordings
Note
Medium Risk
Adds a new authenticated portfolio endpoint, cache/state plumbing, and new UI on the Ondo campaign details screen; moderate risk due to new data flow and cache invalidation paths in
RewardsControllerand Redux state.Overview
Adds an Ondo GM portfolio “Your Positions” section to the Ondo campaign details page (opted-in users only), including loading/error/empty states and navigation to RWA token list or specific asset details.
Extends rewards data flow to fetch/cache portfolio positions: introduces
useGetOndoPortfolioPosition, Redux state/actions/selectors forondoCampaignPortfolio, and a newRewardsController:getOndoCampaignPortfolioPositionaction backed by a new authenticated data-service endpoint/ondo-gm/:campaignId/portfolio/me, with cache invalidation on opt-in/logout/subscription cache invalidation.Refactors Ondo campaign/leaderboard payloads and UI: switches multiple DTO fields from snake_case to camelCase, adds
isLeaderboardNotYetComputed(404) handling with an info banner, updatesCampaignHowItWorksto use flatstepsinstead of phased data, and tightensCampaignTileparticipant-status fetching to active Ondo campaigns only.Written by Cursor Bugbot for commit 0e4fc3e. This will update automatically on new commits. Configure here.