Skip to content

feat(rewards): update campaigns feature flag behavior on dashboard#27803

Merged
VGR-GIT merged 1 commit into
mainfrom
rwds-change-campaigns-feature-flag
Mar 23, 2026
Merged

feat(rewards): update campaigns feature flag behavior on dashboard#27803
VGR-GIT merged 1 commit into
mainfrom
rwds-change-campaigns-feature-flag

Conversation

@VGR-GIT
Copy link
Copy Markdown
Contributor

@VGR-GIT VGR-GIT commented Mar 23, 2026

Description

Updates how the campaigns feature flag controls behavior on the Rewards Dashboard:

  • Dashboard always renders CampaignsPreview and EarnRewardsPreview components regardless of feature flag state
  • Feature flag logic moved to useRewardCampaigns hook - when disabled:
    • Shows only upcoming campaigns (filtered by start date)
    • Falls back to previous season campaigns if no upcoming campaigns exist
  • Campaign tiles become non-interactive when disabled - users cannot navigate to campaign details
  • Adds fetchUpcomingOrPreviousSeasonCampaigns method to RewardsController for the fallback logic

Key Changes

Before After
Feature flag hides entire campaigns section Always shows campaigns section
N/A When disabled: shows upcoming campaigns only
N/A When disabled: falls back to previous season
All tiles navigable Non-interactive tiles when flag disabled

Changelog

CHANGELOG entry: null

Related issues

N/A

Manual testing steps

  1. Enable campaigns feature flag → Full campaigns functionality
  2. Disable campaigns feature flag → Only upcoming campaigns shown, tiles non-interactive
  3. Disable flag with no upcoming campaigns → Previous season campaigns displayed

Screenshots/Recordings

  • Feature flag off: only show upcoming campaign as featured
Screenshot from 2026-03-23 14-16-10
  • Feature flag off: tapping section or featured tile on rewards dashboard leads to campaign overview page. Only previous season tile is tappable
Screenshot from 2026-03-23 14-16-17
  • Feature flag off: what would happen if no upcoming campaigns are found, we can fallback to the previous season tile, which would take you to the previous season summary if it/the section is tapped.
Screenshot from 2026-03-23 14-17-30
  • If feature flag is on, then we will not filter on upcoming and allow users to actually navigate to the campaign details page via campaign tiles.

Pre-merge author checklist

  • I've followed MetaMask Contributor Docs
  • I've completed the PR template
  • I've included tests
  • I've documented any changes (if applicable)

Pre-merge reviewer checklist

  • I've verified the changes follow established patterns
  • I've verified the test coverage is adequate

Made with Cursor


Note

Medium Risk
Moderate UI/behavior change around the campaigns feature flag that alters what content is shown and which navigation paths are enabled; risk is mainly regressions in campaign visibility and tap behavior when the flag toggles.

Overview
Rewards dashboard now always renders CampaignsPreview and EarnRewardsPreview, removing the prior conditional/previous-season UI paths (including the referral header action).

Campaign feature flag behavior is pushed down into campaigns components/hooks: useRewardCampaigns always fetches campaigns when subscribed but filters results to upcoming-only when the flag is off, while CampaignTile adds isInteractive/onPress to disable deep-link navigation and allow alternate navigation. CampaignsPreview adds a no-campaigns fallback that shows PreviousSeasonTile and navigates to Routes.PREVIOUS_SEASON_VIEW.

Tests were updated accordingly across RewardsDashboard, CampaignsPreview, CampaignTile, useRewardCampaigns, and RewardsController to reflect the new fetch/filtering and interactivity rules.

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

- Remove campaigns feature flag conditional rendering from dashboard
- Always show CampaignsPreview and EarnRewardsPreview components
- Move feature flag logic to useRewardCampaigns hook
- When campaigns disabled: show only upcoming campaigns or fallback to previous season
- Add isInteractive prop to CampaignTile to prevent navigation to details when disabled
- Add fetchUpcomingOrPreviousSeasonCampaigns method to RewardsController

Made-with: Cursor
@VGR-GIT VGR-GIT self-assigned this Mar 23, 2026
@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 23, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

⏭️ Smart E2E selection skipped - draft PR

All E2E tests pre-selected.

View GitHub Actions results

@VGR-GIT VGR-GIT marked this pull request as ready for review March 23, 2026 13:45
@VGR-GIT VGR-GIT requested a review from a team as a code owner March 23, 2026 13:45
@github-actions
Copy link
Copy Markdown
Contributor

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

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.

)}

{featuredCampaign && <CampaignTile campaign={featuredCampaign} />}
{featuredCampaign && (
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.

Error banner with retry is unreachable dead code

Medium Severity

The RewardsErrorBanner at line 107 is unreachable. showPreviousSeasonTile (line 57) evaluates to !isLoading && !featuredCampaign, which triggers an early return at line 59. The error banner requires the same !isLoading && !featuredCampaign condition, but that path already returned. The second return block only executes when isLoading || featuredCampaign, making the error banner condition always false. Users who hit a campaign fetch error with no cached data see a PreviousSeasonTile with no way to retry.

Additional Locations (1)
Fix in Cursor Fix in Web

@sonarqubecloud
Copy link
Copy Markdown

@VGR-GIT VGR-GIT enabled auto-merge March 23, 2026 14:15
@VGR-GIT VGR-GIT added this pull request to the merge queue Mar 23, 2026
Merged via the queue into main with commit a4522a3 Mar 23, 2026
134 of 140 checks passed
@VGR-GIT VGR-GIT deleted the rwds-change-campaigns-feature-flag branch March 23, 2026 16:56
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 23, 2026
@metamaskbot metamaskbot added the release-7.72.0 Issue or pull request that will be included in release 7.72.0 label Mar 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.72.0 Issue or pull request that will be included in release 7.72.0 size-XL team-rewards Rewards team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants