fix: perps withdraw metrics, UI, and fee display improvements#28588
fix: perps withdraw metrics, UI, and fee display improvements#28588
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. |
app/components/Views/confirmations/hooks/alerts/useInsufficientPerpsBalanceAlert.test.ts
Show resolved
Hide resolved
Override headerTintColor to colors.text.default in the transaction details screen so the title no longer inherits the blue primary tint from the shared navbar helper. Fixes CONF-1159
The metric was always false because hasSourceAmount is never true for post-quote flows — the native token source amount only matches a skipIfBalance required token. Use isPostQuote as an alternative gate since post-quote transactions always request a relay quote.
When no child transactions exist (e.g. gasless HyperLiquid withdrawals where the batch has no requiredTransactionIds), fall back to the parent's own submittedTime so the metric is still reported on finalized pay transactions.
On the confirmation screen, check if total fees are greater than or equal to the withdraw amount and show an insufficient funds alert. Gated on quotes being available so controller fallback fees don't trigger false positives. Skipped during input since totals may be stale while the user is typing.
When no relay quotes exist the controller falls back to raw gas estimation, producing nonsensical multi-million dollar fees. Hide the fee, time, and receive rows at the parent level when loading is complete but no quotes were returned. Move alert message above the Receive token selector per the redesign.
Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>
d35df47 to
e33f629
Compare
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
The changes are bug fixes rather than architectural changes, reducing risk. No changes to core Engine controllers, navigation, or shared infrastructure that would affect unrelated test areas. Performance Test Selection: |
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.
Reviewed by Cursor Bugbot for commit e33f629. Configure here.
app/components/Views/confirmations/components/rows/bridge-fee-row/bridge-fee-row.test.tsx
Show resolved
Hide resolved
|
|
✅ E2E Fixture Validation — Schema is up to date |




Description
Fixes several things with the Perps Withdraw to any token flow:
hasSourceAmountwhich is never true for post-quote flows. Now usesisPostQuoteas an alternative gate.submittedTimewhen no child transactions exist (gasless HyperLiquid withdrawals).headerTintColortotext.defaultso the transaction details title is no longer blue.Changelog
CHANGELOG entry: Fixed perps withdraw metrics tracking, hide rows when no quotes are available, and fixed blue title in transaction details
Related issues
Fixes: CONF-1159
Manual testing steps
Feature: Perps Withdraw
Scenario: user withdraws to BNB
Scenario: user enters tiny amount
Scenario: user views completed withdrawal in activity
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Touches confirmation-screen fee/receive rendering and blocking alert logic for withdraws, plus metrics emission paths, which could affect user-visible values and analytics if quote/totals availability is misdetected.
Overview
Fixes Perps Withdraw confirmation UX by only showing fee/time/receive totals when relay quotes are loading or available, avoiding misleading fallback fee values; it also moves the inline
AlertMessageabove the receive/account selector.Tightens quote-dependent calculations by returning empty values for
BridgeFeeRowandReceiveRowwhen there are no quotes, and adds a confirmation-only insufficient-funds check that blocks when total fees would consume the entire withdraw amount.Improves MetaMask Pay metrics:
mm_pay_quote_requestednow triggers for post-quote flows (viauseTransactionPayIsPostQuote), andmm_pay_time_to_complete_sfalls back to the parent transactionsubmittedTimewhen no child submitted times exist. Also fixes the activity details header color by overridingheaderTintColortocolors.text.default(with updated tests).Reviewed by Cursor Bugbot for commit e33f629. Bugbot is set up for automated code reviews on this repo. Configure here.