Skip to content

feat(rewards): ondo campaign winner page#29158

Merged
VGR-GIT merged 5 commits into
mainfrom
RWDS-1168-show-a-persistent-toast-to-users-who-participated-at-end-of-campaign-1
Apr 22, 2026
Merged

feat(rewards): ondo campaign winner page#29158
VGR-GIT merged 5 commits into
mainfrom
RWDS-1168-show-a-persistent-toast-to-users-who-participated-at-end-of-campaign-1

Conversation

@VGR-GIT
Copy link
Copy Markdown
Contributor

@VGR-GIT VGR-GIT commented Apr 22, 2026

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.

image

Primary CTA opens mail and has the winning code in subject

image

Details page showing banner that you won; tapping it navigates back to winning page

image

Stats page also showing the winning banner. If user skips or taps the x at top right it closes/navigates back to stats page

image

If for some reason the position isn't available and not loading

image

If for some reason the position isn't available and we are loading it

image

If for some reason the winning code isn't available and we had an error fetching it

image

If for some reason the winning code isn't available and we're loading it

image

Note there's a animated border effect on the winning banner just like in the figma design. It loops in an interval.


Note

Medium Risk
Adds a new authenticated rewards endpoint and client auto-navigation to a new winner flow; issues could mis-route users or surface incorrect winner/claim state if winner detection or API handling is wrong.

Overview
Adds a new RewardsOndoCampaignWinning flow for completed Ondo campaigns, including a dedicated winning screen that displays rank/return, fetches a per-user winner code, supports copy-to-clipboard, and launches a prefilled mailto: claim email (with retry/error/loading states).

Updates Ondo campaign details and stats screens to detect top-5 qualified winners (isOndoCampaignWinner), show a tappable animated winner banner, and auto-navigate to the winning screen once per session on screen focus; also threads campaignName through stats navigation and adds route fallback behavior when campaignId is missing. Backend wiring includes new RewardsController:getOndoCampaignWinnerCode + data-service endpoint (/ondo-gm/:campaignId/winner-code/me) and supporting tests/i18n/assets.

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

@VGR-GIT VGR-GIT requested a review from a team as a code owner April 22, 2026 08:34
@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.

@metamaskbotv2 metamaskbotv2 Bot added team-rewards Rewards team INVALID-PR-TEMPLATE PR's body doesn't match template labels Apr 22, 2026
@VGR-GIT VGR-GIT changed the title Rwds 1168 show a persistent toast to users who participated at end of campaign 1 feat(rewards): ondo campaign winner page Apr 22, 2026
Comment thread app/components/UI/Rewards/utils/ondoCampaignConstants.ts
@github-actions github-actions Bot added the risk:medium AI analysis: medium risk label Apr 22, 2026
@MetaMask MetaMask deleted a comment from github-actions Bot Apr 22, 2026
@VGR-GIT VGR-GIT enabled auto-merge April 22, 2026 08:55
Comment thread app/components/UI/Rewards/Views/OndoCampaignWinningView.tsx Outdated
Comment thread app/components/UI/Rewards/Views/OndoCampaignDetailsView.tsx
cursor[bot]

This comment was marked as resolved.

- 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>
@VGR-GIT VGR-GIT force-pushed the RWDS-1168-show-a-persistent-toast-to-users-who-participated-at-end-of-campaign-1 branch from 7f38e78 to a6d2247 Compare April 22, 2026 09:48
@MetaMask MetaMask deleted a comment from github-actions Bot Apr 22, 2026
@github-actions github-actions Bot added risk:low AI analysis: low risk and removed risk:medium AI analysis: medium risk labels Apr 22, 2026
@github-actions
Copy link
Copy Markdown
Contributor

AI PR Analysis

Merge safe: true | 🟢 Risk: low

Merge decision: The changes are purely additive, introducing new functionality for displaying winner codes in completed Ondo campaigns without modifying existing behavior. New tests cover the added API and UI logic, and the blast radius is confined to the Rewards UI module with no impact on core systems or other features.

  • New API endpoint and controller method for winner codes: additive, tested, no impact on existing rewards fetches like leaderboard or deposits. Could break if API fails, but propagates errors for UI handling; blast radius: 1 new UI screen.
  • UI additions (winning view, banner, navigation): confined to Rewards module, only shown post-campaign end. No alterations to active campaign displays; importers limited to 5-6 local files.
  • No test gaps for core changes; new backend/UI tests added. Existing Ondo flows (stats, details) enhanced with winner guards but unchanged behavior.

View run

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

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

E2E Test Selection:
The PR introduces a new Ondo campaign winner flow within the Rewards feature: a new OndoCampaignWinningView screen, OndoWinnerBanner component, useOndoCampaignWinnerCode hook, getOndoCampaignWinnerCode method on RewardsController/RewardsDataService, a new route constant (REWARDS_ONDO_CAMPAIGN_WINNING_VIEW), and updates to OndoCampaignStatsView, OndoCampaignDetailsView, and CampaignStatsSummary to show winner state.

All changes are self-contained within the Rewards/Ondo campaign feature area. The RewardsController changes are purely additive (new method only, no modification of existing methods). The Routes.ts change adds a new constant without modifying existing ones.

SmokeWalletPlatform is selected because the Rewards feature (Ondo campaigns, campaign stats, campaign details views) is part of the Trending/wallet platform area. The tag description explicitly covers Trending subsections and wallet platform features.

No other tags are warranted:

  • SmokeConfirmations: No transaction confirmation flows changed
  • SmokePerps: No perps-specific code changed (Rewards is separate from Perps)
  • SmokeTrade: No swap/bridge flows changed
  • SmokeAccounts/SmokeIdentity: No account management changes
  • SmokeNetworkAbstractions/SmokeNetworkExpansion: No network changes
  • All other tags: Unrelated to these changes

No performance tests needed: Changes are additive UI features (new screen, new banner component) within the Rewards flow. No list rendering performance, no account/network selectors, no startup/initialization code affected.

Performance Test Selection:
The changes are additive UI features within the Rewards/Ondo campaign winner flow. No performance-sensitive code paths are affected: no list rendering changes, no account/network selector components, no app startup/initialization code, no Redux state management changes that would impact render performance. The new OndoCampaignWinningView is a simple screen shown only to campaign winners, not a frequently-rendered component.

View GitHub Actions results

Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

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 470485c. Configure here.

Comment thread app/components/UI/Rewards/Views/OndoCampaignWinningView.test.tsx
@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Schema is up to date
12 value mismatches detected (expected — fixture represents an existing user).
View details

@VGR-GIT VGR-GIT added this pull request to the merge queue Apr 22, 2026
Merged via the queue into main with commit edf69ec Apr 22, 2026
99 of 100 checks passed
@VGR-GIT VGR-GIT deleted the RWDS-1168-show-a-persistent-toast-to-users-who-participated-at-end-of-campaign-1 branch April 22, 2026 12:38
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 22, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.75.0 Issue or pull request that will be included in release 7.75.0 label Apr 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

INVALID-PR-TEMPLATE PR's body doesn't match template release-7.75.0 Issue or pull request that will be included in release 7.75.0 risk:low AI analysis: low risk size-XL team-rewards Rewards team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants