Skip to content

feat(earn): gate Tron unstaked claim button behind remote flag cp-7.71.0#27908

Merged
ulissesferreira merged 1 commit into
mainfrom
NEB-838-feature-flag-claim-unstaked-trx-button
Mar 25, 2026
Merged

feat(earn): gate Tron unstaked claim button behind remote flag cp-7.71.0#27908
ulissesferreira merged 1 commit into
mainfrom
NEB-838-feature-flag-claim-unstaked-trx-button

Conversation

@ulissesferreira

@ulissesferreira ulissesferreira commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

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.

@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-networks Networks team label Mar 25, 2026
@ulissesferreira ulissesferreira force-pushed the NEB-838-feature-flag-claim-unstaked-trx-button branch 2 times, most recently from b1077c4 to 36797d2 Compare March 25, 2026 13:17
@ulissesferreira ulissesferreira marked this pull request as ready for review March 25, 2026 13:26
@ulissesferreira ulissesferreira requested review from a team as code owners March 25, 2026 13:26
Matt561
Matt561 previously approved these changes Mar 25, 2026
FeatureFlagNames,
} from '../../../constants/featureFlags';

export const selectTronShowClaimUnstakedTrxButton = createSelector(

@Matt561 Matt561 Mar 25, 2026

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.

Nit/non-blocking: Earn killswitches usually have the *Enabled suffix.

For example

export const selectTronClaimUnstakedEnabled

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done!

aganglada
aganglada previously approved these changes Mar 25, 2026

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

LGTM on perps changes app/components/UI/Perps/utils/wait.test.ts

@ulissesferreira ulissesferreira dismissed stale reviews from aganglada and Matt561 via 1746e09 March 25, 2026 15:14
@ulissesferreira ulissesferreira force-pushed the NEB-838-feature-flag-claim-unstaked-trx-button branch from 36797d2 to 1746e09 Compare March 25, 2026 15:14
@github-actions github-actions Bot added the risk-low Low testing needed · Low bug introduction risk label Mar 25, 2026
@ulissesferreira ulissesferreira force-pushed the NEB-838-feature-flag-claim-unstaked-trx-button branch from 1746e09 to 3436a59 Compare March 25, 2026 15:27
@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 25, 2026

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

Add tronShowClaimUnstakedTrxButton (default false) and selectTronShowClaimUnstakedTrxButton. Hide claim CTA unless LaunchDarkly serves true.

Register the flag in tests/feature-flags/feature-flag-registry.ts (inProd true, productionDefault false per production client-config API).

NEB-838
@ulissesferreira ulissesferreira force-pushed the NEB-838-feature-flag-claim-unstaked-trx-button branch from 3436a59 to d8ac2f1 Compare March 25, 2026 15:42
@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 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeTrade, SmokePerps, SmokeWalletPlatform, SmokeConfirmations
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 82%
click to see 🤖 AI reasoning details

E2E Test Selection:

The PR introduces:

  1. New feature flag tronClaimUnstakedTrxButtonEnabled (default: false): Added to featureFlags.ts enum and DEFAULT_FEATURE_FLAG_VALUES. This is purely additive and doesn't change existing behavior.

  2. New selector selectTronClaimUnstakedTrxButtonEnabled: A reselect selector that reads the new feature flag. Only used in TronUnstakedBanner.

  3. TronUnstakedBanner.tsx update: The claim button is now conditionally rendered based on the feature flag. Since the default is false, the button is hidden by default — no visible change to existing users. The text padding also adjusts conditionally.

  4. tests/feature-flags/feature-flag-registry.ts update: Adds the new flag to the E2E mock server registry (additive, production default false). Also updates the sync date comment.

  5. app/components/UI/Perps/utils/wait.test.ts: Minor test quality fix — adds await before expect(...).resolves calls. No functional code change.

Tag selection rationale:

  • SmokeTrade: Covers staking flows (ETH staking from wallet actions menu). Tron staking/unstaking is part of the Earn ecosystem which SmokeTrade covers. The TronUnstakedBanner change is in the Earn component tree.
  • SmokeConfirmations: Required as a dependent tag when selecting SmokeTrade (swap/bridge/staking flows involve transaction confirmations).
  • SmokePerps: The Perps wait.test.ts was touched (minor fix). Perps is also part of the TradeWalletActions entry point. Including as a precaution.
  • SmokeWalletPlatform: Required as a dependent tag when selecting SmokePerps (Perps section is inside Trending tab). Also covers activity display related to trades.

The feature flag registry update is additive and shouldn't break any existing E2E tests. The risk is low since the new flag defaults to false and the UI change is purely conditional rendering of an existing button.

Performance Test Selection:
The changes are: (1) a new feature flag defaulting to false with no UI impact for most users, (2) conditional rendering of a button in TronUnstakedBanner (minor UI change, not a performance-sensitive component), (3) a feature flag registry update (additive), and (4) a minor test fix in Perps utils. None of these changes affect rendering performance, data loading, state management at scale, or critical user flows in a way that would impact measurable performance metrics. No performance tests are warranted.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

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

@ulissesferreira ulissesferreira added this pull request to the merge queue Mar 25, 2026
Merged via the queue into main with commit ef5e684 Mar 25, 2026
183 of 187 checks passed
@ulissesferreira ulissesferreira deleted the NEB-838-feature-flag-claim-unstaked-trx-button branch March 25, 2026 17:02
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 25, 2026
@metamaskbot metamaskbot added the release-7.72.0 Issue or pull request that will be included in release 7.72.0 label Mar 25, 2026
@vivek-consensys vivek-consensys changed the title feat(earn): gate Tron unstaked claim button behind remote flag feat(earn): gate Tron unstaked claim button behind remote flag cp-7.71.0 Mar 26, 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 risk-low Low testing needed · Low bug introduction risk size-M team-networks Networks team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants