chore(runway): cherry-pick feat(earn): gate Tron unstaked claim button behind remote flag cp-7.71.0#27959
Conversation
…n behind remote flag (#27908) ## **Description** Adds the remote boolean flag **`tronClaimUnstakedTrxButtonEnabled`** so we can hide the **claim** action on the Tron unstaked banner if something goes wrong in production, without removing the banner copy. **Why:** We need a safe kill switch for the claim CTA only. **How:** - Register the flag in `FeatureFlagNames` with default `false` (missing/undefined → button hidden; opt-in). - **`selectTronClaimUnstakedTrxButtonEnabled`** in `app/selectors/featureFlagController/tronClaimUnstakedTrxButtonEnabled/` reads merged remote flags (same pattern as other boolean flags). - `TronUnstakedBanner` uses `useSelector(selectTronClaimUnstakedTrxButtonEnabled)` and renders the primary claim button only when the flag is `true`; title and description stay visible when the button is hidden. - Register the flag in **`tests/feature-flags/feature-flag-registry.ts`** (`inProd: true`, `productionDefault: false`) so CI/E2E mocks match production client-config. **Ops:** Ensure **`tronClaimUnstakedTrxButtonEnabled`** exists in LaunchDarkly / client-config; set to **`true`** where the claim button should appear. ## **Changelog** CHANGELOG entry: Added a remote feature flag to control visibility of the Tron unstaked TRX claim button on the token details banner. ## **Related issues** Fixes: NEB-838 ## **Manual testing steps** ```gherkin Feature: Tron unstaked banner claim button behind remote flag Scenario: user views TRX token details with claimable unstaked balance and flag enabled Given a Tron account with TRX ready for withdrawal and remote flag `tronClaimUnstakedTrxButtonEnabled` is true (or overridden in dev tools) When user opens native TRX token details and the unstaked banner is shown Then the banner shows title, description, and the claim button, and tapping claim still triggers the existing flow Scenario: user views TRX token details when flag is off or unset Given the same balance state but `tronClaimUnstakedTrxButtonEnabled` is false, missing, or undefined in remote flags When user opens native TRX token details and the unstaked banner is shown Then the banner shows title and description but does not show the claim button ``` ## **Screenshots/Recordings** ### **Before** See prior screenshots on this PR (token details with banner). ### **After** Feature flag disabled / enabled — screenshots attached in thread (banner with and without claim CTA). ## **Pre-merge author checklist** - [ ] 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). - [ ] I've completed the PR template to the best of my ability - [ ] I've included tests if applicable - [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] 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. ## **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.
|
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. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
No shared components (navigation, modals, confirmations, TabBar), no Engine/controllers, no critical paths are affected. The Tron staking feature is niche and doesn't have a dedicated E2E tag. The feature flag defaults to Performance Test Selection: |
|



Description
Adds the remote boolean flag
tronClaimUnstakedTrxButtonEnabledsowe can hide the claim action on the Tron unstaked banner if
something goes wrong in production, without removing the banner copy.
Why: We need a safe kill switch for the claim CTA only.
How:
FeatureFlagNameswith defaultfalse(missing/undefined → button hidden; opt-in).
selectTronClaimUnstakedTrxButtonEnabledinapp/selectors/featureFlagController/tronClaimUnstakedTrxButtonEnabled/reads merged remote flags (same pattern as other boolean flags).
TronUnstakedBannerusesuseSelector(selectTronClaimUnstakedTrxButtonEnabled)and renders theprimary claim button only when the flag is
true; title and descriptionstay visible when the button is hidden.
tests/feature-flags/feature-flag-registry.ts(inProd: true,productionDefault: false) so CI/E2E mocks match productionclient-config.
Ops: Ensure
tronClaimUnstakedTrxButtonEnabledexists inLaunchDarkly / client-config; set to
truewhere the claim buttonshould appear.
Changelog
CHANGELOG entry: Added a remote feature flag to control visibility of
the Tron unstaked TRX claim button on the token details banner.
Related issues
Fixes: NEB-838
Manual testing steps
Screenshots/Recordings
Before
See prior screenshots on this PR (token details with banner).
After
Feature flag disabled / enabled — screenshots attached in thread (banner
with and without claim CTA).
Pre-merge author checklist
Docs and MetaMask Mobile
Coding
Standards.
if applicable
guidelines).
Not required for external contributors.
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. ef5e684