chore(runway): cherry-pick feat(rewards): show VIP tag in referral code input at onboarding fix: cp-7.82.0#31607
Open
runway-github[bot] wants to merge 1 commit into
Open
Conversation
…de input at onboarding fix: cp-7.82.0 (#31530) ## **Description** - Shows a gold "VIP" tag next to a referral code when that code belongs to a VIP member — during onboarding, in settings, and on the referral details page. - Makes it instantly clear to a user when they've been invited by a VIP. - Puts the whole VIP experience behind a feature flag, so nothing VIP-related shows unless VIP is switched on. - Fully backward-compatible: if VIP information isn't available, the app simply shows no tag and behaves exactly as before. > **Depends on:** consensys-vertical-apps/va-mmcx-rewards#636 — must be merged before this ships. ## **Changelog** CHANGELOG entry: null ## **Related issues** Refs: consensys-vertical-apps/va-mmcx-rewards#636 ## **Manual testing steps** 1. Enter a VIP referral code in the rewards onboarding referral input → gold "VIP" tag appears next to the confirmation checkmark 2. Enter a non-VIP valid referral code → only the confirmation checkmark, no VIP tag 3. Enter an invalid referral code → only the error icon, no VIP tag 4. Backend returns no `isVipCode` field (old backend) → defaults to `false`, no VIP tag, no crash ## **Screenshots/Recordings** ### **Before** <img width="485" height="162" alt="image" src="https://github.com/user-attachments/assets/dc199908-53da-49af-9370-5d7fe8a32f80" /> <img width="485" height="162" alt="image" src="https://github.com/user-attachments/assets/0989863b-bfe8-4e3f-99a2-825c605cbe76" /> ### **After** - For vip referees <img width="1920" height="1080" alt="vip-referral-code" src="https://github.com/user-attachments/assets/e368d3d6-53e8-4438-ba9b-927d10ecae74" /> <img width="899" height="334" alt="image" src="https://github.com/user-attachments/assets/2429480d-eed1-45f4-aea8-10a231367b84" /> - For vips (in referral details page) <img width="902" height="659" alt="image" src="https://github.com/user-attachments/assets/bc8e4e27-476c-47b3-b134-dd76d068905e" /> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. #### Performance checks (if applicable) - [x] I've tested on Android - Ideally on a mid-range device; emulator is acceptable - [x] I've tested with a power user scenario - Use these [power-user SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93) to import wallets with many accounts and tokens - [x] I've instrumented key operations with Sentry traces for production performance metrics - See [`trace()`](/app/util/trace.ts) for usage and [`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274) for an example For performance guidelines and tooling, see the [Performance Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers). ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Touches rewards referral validation, controller caching, and new VIP API paths; mitigated by feature-flag gating and tests, but incorrect gating could leak VIP UI or stale referee state. > > **Overview** > Adds a **VIP referee** experience parallel to the existing VIP member flow: dashboard header entry (gold fox), splash → **VIP Pilot** stats screen, Redux persistence for splash acceptance, and `getVipRefereeDashboard` / referral-details fields (`isVipReferee`, `referredByVipCode`) wired through `RewardsController` with VIP feature-flag gating (including stripping stale VIP data from cache when VIP is off). > > Introduces a reusable **`RewardsVipReferralTag`** and shows it instead of the success checkmark when a code is VIP—on **onboarding**, **settings** (“referred by”), and **referral details** (for VIP subscribers’ own code)—all gated on `selectVipProgramEnabled`. Referral validation now consumes `{ valid, isVipCode }` from the backend (backward-safe when `isVipCode` is missing). > > Also adds **“Last updated”** on the main VIP dashboard from `computedAt`, extends `CopyableField` with `trailingAccessory`, and ships broad unit test coverage for the new surfaces. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit fb891c5. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: sophieqgu <sophieqgu@gmail.com>
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. |
Contributor
🔍 Smart E2E Test Selection⏭️ Smart E2E selection skipped - PR targets a release or stable branch (release/* or stable) All E2E tests pre-selected. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
to a VIP member — during onboarding, in settings, and on the referral
details page.
VIP-related shows unless VIP is switched on.
simply shows no tag and behaves exactly as before.
Changelog
CHANGELOG entry: null
Related issues
Refs: consensys-vertical-apps/va-mmcx-rewards#636
Manual testing steps
gold "VIP" tag appears next to the confirmation checkmark
checkmark, no VIP tag
isVipCodefield (old backend) → defaults tofalse, no VIP tag, no crashScreenshots/Recordings
Before
After
Pre-merge author checklist
Docs and MetaMask Mobile
Coding
Standards.
if applicable
guidelines).
Not required for external contributors.
Performance checks (if applicable)
SRPs
to import wallets with many accounts and tokens
performance metrics
trace()for usage andaddTokenfor an example
For performance guidelines and tooling, see the Performance
Guide.
Pre-merge reviewer checklist
app, test code being changed).
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
Note
Medium Risk
Touches rewards referral validation, controller caching, and new VIP
API paths; mitigated by feature-flag gating and tests, but incorrect
gating could leak VIP UI or stale referee state.
Overview
Adds a VIP referee experience parallel to the existing VIP member
flow: dashboard header entry (gold fox), splash → VIP Pilot stats
screen, Redux persistence for splash acceptance, and
getVipRefereeDashboard/ referral-details fields (isVipReferee,referredByVipCode) wired throughRewardsControllerwith VIPfeature-flag gating (including stripping stale VIP data from cache when
VIP is off).
Introduces a reusable
RewardsVipReferralTagand shows it insteadof the success checkmark when a code is VIP—on onboarding,
settings (“referred by”), and referral details (for VIP
subscribers’ own code)—all gated on
selectVipProgramEnabled. Referralvalidation now consumes
{ valid, isVipCode }from the backend(backward-safe when
isVipCodeis missing).Also adds “Last updated” on the main VIP dashboard from
computedAt, extendsCopyableFieldwithtrailingAccessory, andships broad unit test coverage for the new surfaces.
Reviewed by Cursor Bugbot for commit
fb891c5. Bugbot is set up for automated
code reviews on this repo. Configure
here.
Co-authored-by: Claude Sonnet 4.6 noreply@anthropic.com
Co-authored-by: sophieqgu sophieqgu@gmail.com e16e696