Skip to content

feat: hide Speed up and Cancel when gas is paid with alternate token#27404

Merged
vinistevam merged 3 commits into
mainfrom
vs/hide-cancel-speedup-btn-gasfeetoken
Mar 24, 2026
Merged

feat: hide Speed up and Cancel when gas is paid with alternate token#27404
vinistevam merged 3 commits into
mainfrom
vs/hide-cancel-speedup-btn-gasfeetoken

Conversation

@vinistevam
Copy link
Copy Markdown
Contributor

@vinistevam vinistevam commented Mar 12, 2026

Description

Hides the Speed up and Cancel actions in the activity list and in transaction details when the user has chosen a non‑native token to pay for gas (selectedGasFeeToken), because those flows are not supported for gas‑fee‑token transactions.

Changelog

CHANGELOG entry: Added check to hide Speed up and Cancel buttons in the activity list and transaction details when the user has selected another token to pay for gas

Related issues

Fixes: https://github.com/MetaMask/mobile-planning/issues/2424

Manual testing steps

Feature: Hide Speed up and Cancel when gas is paid with alternate token

  Scenario: User does not see Speed up and Cancel for a pending transaction paid with alternate token
    Given the user has created a transaction
    And the user has chosen a non-native token in the gas/token selector to pay for gas
    And the transaction has been submitted and is pending

    When the user opens the activity list
    And the user locates that pending transaction

    Then the Speed up button is not displayed for that transaction
    And the Cancel button is not displayed for that transaction

  Scenario: User sees Speed up and Cancel for a pending transaction paid with native token
    Given the user has created a transaction
    And the user has not selected a different token for gas (native token is used)
    And the transaction has been submitted and is pending

    When the user opens the activity list
    And the user locates that pending transaction

    Then the Speed up button is displayed for that transaction
    And the Cancel button is displayed for that transaction

  Scenario: User does not see Speed up and Cancel in transaction details when gas was paid with alternate token
    Given the user has a pending transaction paid with a non-native gas token
    And the user is viewing the activity list

    When the user opens the details of that pending transaction

    Then the Speed up button is not displayed in the transaction details
    And the Cancel button is not displayed in the transaction details

Screenshots/Recordings

gasless.webm

Before

After

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.

Note

Low Risk
Low risk UI-logic change that only gates rendering of existing actions based on selectedGasFeeToken, with unit tests added to prevent regressions.

Overview
Hides Speed up and Cancel actions for pending/approved transactions when selectedGasFeeToken is set (i.e., gas is paid with a non-native token) in both the activity list (TransactionElement) and the transaction details sheet (TransactionDetails).

Adds a shared utility hasGasFeeTokenSelected in confirmations/utils/transaction and extends test coverage to assert the buttons are suppressed when a gas fee token is selected (and still shown otherwise).

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

@vinistevam vinistevam added the team-confirmations Push issues to confirmations team label Mar 12, 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.

@vinistevam vinistevam marked this pull request as ready for review March 12, 2026 09:43
@vinistevam vinistevam requested review from a team as code owners March 12, 2026 09:43
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.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

@github-actions github-actions Bot added the risk-medium Moderate testing recommended · Possible bug introduction risk label Mar 23, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

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

E2E Test Selection:
The changes introduce a new utility function hasGasFeeTokenSelected() and use it in two transaction UI components to hide "Speed up" and "Cancel" actions when a transaction uses a non-native gas fee token (EIP-7702 gas abstraction feature).

Key changes:

  1. transaction.ts: New hasGasFeeTokenSelected() utility that checks transactionMeta.selectedGasFeeToken
  2. TransactionElement/index.js: Hides speed up/cancel actions when gas fee token is selected
  3. TransactionDetails/index.js: Same logic in the transaction details view

Tag selection reasoning:

  • SmokeConfirmations: Directly relevant because this change is about EIP-7702 advanced account abstraction features (gas fee token payments). The tag description explicitly mentions "advanced EIP-7702 account abstraction features like batch transactions and gas fee token payments." The selectedGasFeeToken field is set during the confirmation flow, and this change affects what actions are available post-confirmation.

  • SmokeWalletPlatform: Directly relevant because this tag tests "transaction history: displaying incoming/outgoing ETH transactions, token transfer details." The TransactionElement and TransactionDetails components are core to the transaction history/activity view. The change modifies which action buttons (speed up/cancel) appear in the activity list for submitted transactions.

Tags NOT selected:

  • SmokeTrade: While swap/bridge transactions appear in history, the change specifically targets selectedGasFeeToken which is an EIP-7702 feature, not swap/bridge specific
  • Other tags: No impact on accounts, networks, ramps, snaps, or other features

Risk level: Medium - The change is a targeted UI behavior fix (hiding buttons for a specific transaction type), well-tested with unit tests, but affects core transaction display components used across the app.

Performance Test Selection:
The changes are purely UI logic changes (adding a boolean check to hide/show buttons in transaction list items). There is no impact on rendering performance, data loading, state management, or any performance-sensitive paths. The hasGasFeeTokenSelected() function is a simple boolean check on an existing object property, adding negligible overhead.

View GitHub Actions results

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ E2E Fixture Validation — Structural changes detected

Category Count
New keys 46
Missing keys 0
Type mismatches 0
Value mismatches 12 (informational)

The committed fixture schema is out of date. To update, comment:

@metamaskbot update-mobile-fixture

View full details | Download diff report

@sonarqubecloud
Copy link
Copy Markdown

@vinistevam vinistevam added this pull request to the merge queue Mar 24, 2026
Merged via the queue into main with commit ed6585a Mar 24, 2026
100 of 101 checks passed
@vinistevam vinistevam deleted the vs/hide-cancel-speedup-btn-gasfeetoken branch March 24, 2026 09:32
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 24, 2026
@metamaskbot metamaskbot added the release-7.72.0 Issue or pull request that will be included in release 7.72.0 label Mar 24, 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-medium Moderate testing recommended · Possible bug introduction risk size-M team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants