Skip to content

chore(runway): cherry-pick feat(earn): gate Tron unstaked claim button behind remote flag cp-7.71.0#27959

Merged
chloeYue merged 1 commit into
release/7.71.0from
runway-cherry-pick-7.71.0-1774502974
Mar 26, 2026
Merged

chore(runway): cherry-pick feat(earn): gate Tron unstaked claim button behind remote flag cp-7.71.0#27959
chloeYue merged 1 commit into
release/7.71.0from
runway-cherry-pick-7.71.0-1774502974

Conversation

@runway-github
Copy link
Copy Markdown
Contributor

@runway-github runway-github Bot commented Mar 26, 2026

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

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

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

…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.
@runway-github runway-github Bot requested review from a team as code owners March 26, 2026 05:29
@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-bots Bot team (for MetaMask Bot, Runway Bot, etc.) label Mar 26, 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:
The changes in this PR are narrowly scoped and low-risk:

  1. New feature flag tronClaimUnstakedTrxButtonEnabled (default: false): Added to featureFlags.ts constants and the feature flag registry. This is purely additive and doesn't affect any existing functionality.

  2. New selector (selectTronClaimUnstakedTrxButtonEnabled): A simple reselect selector wrapping the new feature flag. No side effects.

  3. TronUnstakedBanner.tsx: The claim button is now conditionally rendered based on the feature flag. Since the default is false, the button is hidden by default — this is a behavior change but only for Tron staking users, and the flag defaults to off, meaning existing behavior (no button shown) is preserved for most users.

  4. tests/feature-flags/feature-flag-registry.ts: Additive change — registers the new flag in the E2E mock server registry. Non-breaking.

  5. app/components/UI/Perps/utils/wait.test.ts: Pure unit test fix (added await to expect().resolves calls). No E2E impact.

  6. Unit test files (selector test, banner test, registry test): Unit test additions/updates only.

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 false so no existing E2E test behavior changes. No E2E tags need to be run for this PR.

Performance Test Selection:
No performance-sensitive changes. The modifications are: a new feature flag (boolean selector), conditional rendering of a single button in TronUnstakedBanner, and unit test fixes. None of these affect rendering performance, data loading, account/network lists, or critical user flows in a measurable way.

View GitHub Actions results

@github-actions github-actions Bot added the risk-low Low testing needed · Low bug introduction risk label Mar 26, 2026
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@chloeYue chloeYue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chloeYue chloeYue merged commit 16da3b1 into release/7.71.0 Mar 26, 2026
59 checks passed
@chloeYue chloeYue deleted the runway-cherry-pick-7.71.0-1774502974 branch March 26, 2026 09:45
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

risk-low Low testing needed · Low bug introduction risk size-M team-bots Bot team (for MetaMask Bot, Runway Bot, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants