feat: add edit gas from cancel/speed up modal #27194
Conversation
|
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. |
There was a problem hiding this comment.
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.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
These directly affect transaction confirmation flows, particularly cancel/speed-up transactions and gas fee handling logic. This falls squarely under the SmokeConfirmations coverage, which includes:
Cancel and speed-up flows are part of the confirmation and transaction lifecycle, so SmokeConfirmations is required to validate:
No changes touch swaps, perps, predictions, network management, identity, multi-SRP, snaps, card, or ramps, so no additional tags are required. No Engine or Controller changes were introduced, and scope is limited to confirmation UI/hooks, so broad cross-feature regression risk is moderate but contained within confirmations. Performance Test Selection: |
|
|
✅ E2E Fixture Validation — Schema is up to date |



Description
Adds the ability to edit gas (network fee) from the cancel/speed up modal before confirming. Users can tap the network fee row to open the gas fee modal, adjust gas, then confirm cancel or speed up. A new context allows the gas modal to operate on the cancel/speed up transaction instead of only the current approval request.
Changes
Cancel/Speed up modal
getBumpParamsForCancelSpeedupandupdateTransactionGasFees, so the gas modal shows the recommended values when the user taps edit.useCancelSpeedupGasnow takestxIdand reads the transaction from the store. Gas edits from the gas modal (viaupdateTransactionGasFees) are reflected in the cancel/speed up modal.Gas fee modal transaction context
GasFeeModalTransactionProvideranduseGasFeeModalTransactionlet the gas modal work with a specific transaction id (e.g. the cancel/speed up tx) instead of only the approval request.useTransactionMetadataRequestuses the context; whentransactionIdis set (e.g. from cancel/speed up), it uses that id for transaction metadata instead of the approval request id.useCancelSpeedupGas refactor
{ tx, isCancel }to{ txId }. Hook reads the transaction withselectTransactionMetadataById(state, txId).getBumpParamsForCancelSpeedup(tx, isCancel, gasFeeEstimates)is exported and used to compute bump params when the cancel/speed up modal opens.Cancel / Speed Up + Edit Gas — Flow (Happy Path)
One-line: Pending Tx → Open modal (seed bump) → [Confirm or Edit gas → Confirm] → Submit.
Legend
getBumpParamsForCancelSpeedup+updateTransactionGasFeesso modal shows suggested feeuseCancelSpeedupGas(txId); updates when user edits in gas modalGasFeeModalTransactionProvider(transactionId)so it edits the cancel/speedup txData flow (compact)
updateTransactionGasFees.useCancelSpeedupGasreads tx from store, so fee row updates.onConfirm(paramsForController)uses whatever is on the tx (default bump or user-edited).Changelog
CHANGELOG entry: Added edit gas from cancel/speed up modal: users can tap the network fee row to open the gas fee modal and adjust gas before confirming cancel or speed up
Related issues
Fixes: https://github.com/MetaMask/mobile-planning/issues/2419 https://consensyssoftware.atlassian.net/browse/CONF-1007
Manual testing steps
Screenshots/Recordings
Screencast.from.2026-03-09.11-22-02.webm
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Touches transaction gas-fee handling by seeding/updating on-chain fee params and routing the gas modal to a different transaction via new context; mistakes could lead to incorrect fee values being applied to cancel/speed-up submissions.
Overview
Adds an editable network fee flow to the cancel/speed up modal: the network fee row becomes tappable (with an edit icon) and opens the existing
GasFeeModalto adjust gas before confirming.When the modal opens, it now seeds bumped gas params onto the pending tx via
getBumpParamsForCancelSpeedup+updateTransactionGasFees, anduseCancelSpeedupGasis refactored to take atxIdand read current gas fields from the store so UI/confirm uses whatever the gas modal last wrote.Introduces
GasFeeModalTransactionProvider/useGasFeeModalTransactionso gas modal internals can target a specific transaction (not just the approval request), and updatesuseTransactionMetadataRequestto honor this override. Tests are updated/added to cover the new hook API, bump-param helper, and gas modal dismissal when the parent modal closes.Written by Cursor Bugbot for commit 3d80379. This will update automatically on new commits. Configure here.