Skip to content

chore: show entries closed toast when passed cutoff date#28000

Merged
VGR-GIT merged 7 commits into
mainfrom
Enforce-deposit-cutoff-date
Mar 27, 2026
Merged

chore: show entries closed toast when passed cutoff date#28000
VGR-GIT merged 7 commits into
mainfrom
Enforce-deposit-cutoff-date

Conversation

@sophieqgu

@sophieqgu sophieqgu commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

Description

https://consensyssoftware.atlassian.net/browse/RWDS-1109

Changelog

CHANGELOG entry: prevent ondo campaign opt in based on cut off date

Screenshots/Recordings

image

Note

Medium Risk
Changes opt-in eligibility and leaderboard rendering based on a new depositCutoffDate, which can affect user ability to join campaigns and what data is fetched/rendered. Risk is moderate due to time-based logic and UI state/loading interactions, but scoped to Rewards campaign details.

Overview
Adds depositCutoffDate support for ONDO_HOLDING campaigns and introduces isOptinAllowed to centralize the time-based opt-in gating.

Updates OndoCampaignDetailsView and CampaignJoinCTA to hide the join CTA once entries close, show a new dismissible CampaignEntriesClosedBanner, and treat active-but-closed campaigns similar to completed campaigns for leaderboard fetching/rendering (with a skeleton while participant status loads).

Extends types and i18n strings for the new cutoff field and banner text, and adds/updates unit tests to cover cutoff, banner visibility, and loading behaviors.

Written by Cursor Bugbot for commit 94596b3. This will update automatically on new commits. Configure here.

@sophieqgu sophieqgu requested a review from a team as a code owner March 26, 2026 21:04
@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.

@metamaskbot metamaskbot added the team-rewards Rewards team label Mar 26, 2026
@sophieqgu sophieqgu changed the title Show entries closed toast when passed cutoff date chore: show entries closed toast when passed cutoff date Mar 26, 2026
@github-actions github-actions Bot added size-L risk-low Low testing needed · Low bug introduction risk labels Mar 26, 2026
Comment thread app/components/UI/Rewards/hooks/useRewardsToast.tsx Outdated
Comment thread app/components/UI/Rewards/hooks/useRewardsToast.tsx Outdated
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Mar 26, 2026
Comment thread app/components/UI/Rewards/hooks/useRewardsToast.tsx Outdated
Comment thread app/components/UI/Rewards/hooks/useRewardsToast.tsx Outdated
Comment thread app/components/UI/Rewards/components/Campaigns/CampaignJoinCTA.test.tsx Outdated
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Mar 26, 2026
https://consensyssoftware.atlassian.net/browse/RWDS-1109

## Changelog

### Added
- `CampaignEntriesClosedBanner` component shown when deposit cutoff date has passed
- Entries-closed toast notification via `useRewardsToast`

### Changed
- `CampaignJoinCTA` hides the join button when opt-in is no longer allowed past cutoff date
- `useGetCampaignParticipantStatus` reflects cutoff-date awareness
- `OndoCampaignDetailsView` renders the entries-closed banner and leaderboard for campaigns past cutoff

## Screenshots

<!-- Add screenshots here -->

Co-authored-by: VGR-GIT <vangulckrik@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Mar 27, 2026
Comment thread app/components/UI/Rewards/Views/OndoCampaignDetailsView.tsx
…larity

The variable canOptIn was true when opt-in was NOT allowed (entries closed),
making its name the exact opposite of its value. Renamed to areEntriesClosed
to match the actual semantics.

Also fixes a latent bug in leaderboardCampaignId: the original !canOptIn
evaluated to true when entries were still open, contradicting the documented
intent of enabling the leaderboard for "active campaign past cutoff date".
The fix uses areEntriesClosed directly so the leaderboard fetches correctly
when entries are closed.

Co-authored-by: VGR-GIT <vangulckrik@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Mar 27, 2026
@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Mar 27, 2026
Show CampaignHowItWorks when entries are still open (!areEntriesClosed),
not after they close. Fix the inverted condition in OndoCampaignDetailsView
and update the two affected test cases to match the correct behaviour.

Co-authored-by: VGR-GIT <vangulckrik@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Mar 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

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

E2E Test Selection:
All changes are confined to the Rewards feature area (Ondo campaign details view, campaign utility functions, a new banner component, and a hook fix). Specifically:

  1. types.ts: Purely additive — adds optional depositCutoffDate field to two interfaces. No breaking changes to the rewards controller or Engine.
  2. CampaignTile.utils.ts: New isOptinAllowed() utility function — isolated to campaign logic.
  3. OndoCampaignDetailsView.tsx: UI logic changes for "entries closed" state — affects only the Ondo campaign details screen.
  4. CampaignEntriesClosedBanner.tsx: New dismissible banner component — purely additive.
  5. CampaignJoinCTA.tsx: Minor logic update to hide CTA when opt-in is not allowed.
  6. useGetCampaignParticipantStatus.ts: Fix for initial loading state initialization.
  7. locales/en.json: Two new strings added — no existing strings modified.

No existing E2E tests cover the Rewards/Ondo campaign functionality (confirmed by searching e2e and tests directories). The changes do not touch any shared infrastructure: no TabBar, no navigation structure changes, no confirmation flows, no wallet core, no controllers with side effects. The rewards controller type change is non-breaking (optional field addition). No E2E tags are applicable or necessary for these changes.

Performance Test Selection:
No performance-sensitive changes. The modifications are limited to UI component logic (banner display, CTA visibility), a utility function, and a hook initialization fix. No list rendering changes, no state management overhaul, no startup/initialization impact, no data loading pipeline changes.

View GitHub Actions results

@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.

Comment thread app/components/UI/Rewards/Views/OndoCampaignDetailsView.tsx
@VGR-GIT VGR-GIT enabled auto-merge March 27, 2026 11:19
@sonarqubecloud

Copy link
Copy Markdown

@VGR-GIT VGR-GIT added this pull request to the merge queue Mar 27, 2026
Merged via the queue into main with commit 98aae07 Mar 27, 2026
70 checks passed
@VGR-GIT VGR-GIT deleted the Enforce-deposit-cutoff-date branch March 27, 2026 11:54
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 27, 2026
@metamaskbot metamaskbot added the release-7.73.0 Issue or pull request that will be included in release 7.73.0 label Mar 27, 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.73.0 Issue or pull request that will be included in release 7.73.0 risk-low Low testing needed · Low bug introduction risk size-L team-rewards Rewards team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants