feat(rewards): campaign end winner UX — gap fixes for RWDS-1168#29027
feat(rewards): campaign end winner UX — gap fixes for RWDS-1168#29027VGR-GIT wants to merge 11 commits into
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. |
- Add useOndoCampaignWinnerCode hook (subscription-scoped, returns claim
code + loading state) replacing direct useSelector calls in the winning view
- Remove misleading prizeDisplay (currentUsdValue is portfolio value, not
a prize amount); winning view now shows: You won → rank → rate of return
- Fix mailto subject to include the claim code:
"Ondo campaign prize claim - {code}"
- useMaybeShowCampaignEndToast: winner path no longer dispatches
markCampaignEndToastShown so the campaignWon toast re-appears on every
app open (session-only dismissal); loser path unchanged (persisted)
- OndoCampaignDetailsView: add useFocusEffect auto-navigation to
OndoCampaignWinningView for winners on every campaign page session open
- Fix test mocks for OndoCampaignWinningView and useMaybeShowCampaignEndToast
to break transitive Engine import chains that prevented tests from running
Co-authored-by: VGR-GIT <vangulckrik@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
a1b5d22 to
1b37ec5
Compare
…innerCode
The hook only returned { code, isLoading }, causing hasFetched, hasError,
and retry to be undefined at runtime in OndoCampaignWinningView — breaking
auto-redirect for non-winners, hiding the error banner on fetch failures,
and making the retry button a no-op.
Co-authored-by: VGR-GIT <vangulckrik@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
…, winning code retry - Show primary CTA as loading while winning code is fetching - Hide rank/rate section silently when position unavailable (no error UI) - Wire retry into winning code error banner - Full test coverage for all states Co-authored-by: VGR-GIT <vangulckrik@gmail.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
|
✅ E2E Fixture Validation — Schema is up to date |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #29027 +/- ##
===========================================
- Coverage 82.26% 49.78% -32.49%
===========================================
Files 5055 5101 +46
Lines 133121 134507 +1386
Branches 29795 30200 +405
===========================================
- Hits 109518 66959 -42559
- Misses 16173 61778 +45605
+ Partials 7430 5770 -1660 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
No existing E2E tests cover the Rewards feature directly (confirmed by searching tests/smoke//*.ts and tests/e2e//*.ts). The changes don't touch shared navigation components (TabBar, MainNavigator structure), confirmations, browser, or any other cross-cutting infrastructure. SmokeWalletPlatform is selected conservatively because: (1) Rewards is part of the wallet platform ecosystem, (2) the Routes.ts change adds a new route, and (3) the RewardsNavigator refactoring could theoretically affect wallet platform navigation state. This provides a safety net without over-testing unrelated areas. No other tags are warranted since: the changes don't affect confirmations, accounts, identity, networks, trade, browser, snaps, ramps, card, perps, predictions, or multichain APIs. Performance Test Selection: |
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 ad34f57. Configure here.
|
AI PR Analysis🚫 Merge safe: false | 🟠 Risk: high
|



Context
Builds on top of #29017 (
feat(rewards): Add ondo campaign winning toast). Makes it so the scope of the piece of work for this & the targeting pr branch is only about the winning view that can be navigated to from a card/banner shown in stats section on details page OR on dedicated stats page.Changelog
CHANGELOG entry: null
Screenshots
Winning page, auto opened when qualified and user visits detail page. Skip for now or X at top right closes/navigates back to detail page.
Primary CTA opens mail and has the winning code in subject
Details page showing banner that you won; tapping it navigates back to winning page
Stats page also showing the winning banner. If user skips or taps the x at top right it closes/navigates back to stats page
If for some reason the position isn't available and not loading
If for some reason the position isn't available and we are loading it
If for some reason the winning code isn't available and we had an error fetching it
If for some reason the winning code isn't available and we're loading it
Note there's a animated border effect on the winning banner just like in the figma design. It loops in an interval.
The winning code hook/controller/service function is right now just a placeholder until the backend implements an api endpoint for it.
Note
Medium Risk
Introduces a new navigation route and winner auto-redirect logic plus a new authenticated rewards API call path; regressions would mainly affect rewards UX/flow rather than core wallet security.
Overview
Adds a new Ondo campaign winner experience: a
RewardsOndoCampaignWinningscreen with hero UI that shows rank/return, fetches a per-user winning code, supports copy-to-clipboard + analytics, and opens a prefilledmailto:to claim the prize (with loading/error/retry handling).Updates Ondo campaign details/stats flows to detect top-5 qualified winners (
isOndoCampaignWinner), show an animatedOndoWinnerBanner, and deep-link/navigate into the winning screen (including passingcampaignNamein nav params); details view also auto-navigates to the winning screen on focus when a completed campaign winner is detected.Extends the Rewards engine surface area with a new controller + data-service action
getOndoCampaignWinnerCode(plain-text endpoint, no caching, errors propagated), adds new toast presets (campaignWon/campaignEnded) and i18n strings/assets, and refactors Rewards stack side-effect hooks into aRewardsSubscribermounted only when not version-blocked.Reviewed by Cursor Bugbot for commit a83843c. Bugbot is set up for automated code reviews on this repo. Configure here.