Commit 4aedbb4
authored
fix: show transaction fee, est. time, and total rows for same-chain payments (#28652)
## **Description**
PR #28588 added a `hasQuoteResults` guard to hide fee/time/total rows
when bridge quotes fail (preventing incorrect data from displaying).
However, this also hid the rows for same-chain payments (USDC.E on
Polygon → Predict deposit on Polygon) where no bridge quote is needed
but valid fee data still exists.
This PR refines the visibility logic so rows are shown for same-chain
payments while still being hidden when quotes fail with a blocking
alert. It also removes the per-row `!hasQuotes` guards in `BridgeFeeRow`
and `ReceiveRow` since the parent component now handles the "no quotes"
error case.
**Changes:**
- `custom-amount-info.tsx`: `hasQuoteResults` now considers
`!hasSourceAmount && !hasBlockingAlerts` — shows rows for same-chain,
hides on quote failure
- `bridge-fee-row.tsx`: Removed `!hasQuotes` guard from fee calculation
— totals are trusted when the parent decides to render
- `bridge-time-row.tsx`: Added `isSameChain` to `showEstimate` —
displays "< 10 sec" for same-chain payments
- `receive-row.tsx`: Removed `!hasQuotes` guard and unused
`useTransactionPayQuotes` import
## **Changelog**
CHANGELOG entry: Fixed transaction fee, estimated time, and total rows
not appearing for same-chain Predict deposits/withdrawals
## **Related issues**
Fixes:
## **Manual testing steps**
1. Open Add Prediction funds with USDC.E on Polygon
2. Enter an amount and press Done
3. Verify Transaction fee, Est. time, and Total rows appear with values
4. Open Predict Withdraw, select USDC.E on Polygon as receive token
5. Enter a withdrawal amount and press Done
6. Verify Transaction fee, Est. time, and You'll receive rows appear
with values
7. Trigger a "no quotes" scenario (e.g. select a token/amount with no
available route)
8. Verify fee/time/total rows are hidden and the button shows "No
quotes" disabled
## **Screenshots/Recordings**
### **Before**
N/A
### **After**
N/A
## **Pre-merge author checklist**
- [x] 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).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] 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.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Adjusts confirmation UI gating for fee/time/total rows based on
quotes, source amount, and alerts; mistakes could hide or show incorrect
cost details during transaction confirmation.
>
> **Overview**
> Fixes confirmation amount review so **fee/estimated time/total (or
receive) rows render for same-chain payments even when no bridge quotes
exist**, while still hiding those rows when a blocking
`AlertKeys.NoPayTokenQuotes` alert is present.
>
> Moves the “no quotes” error handling to the parent
(`CustomAmountInfo`) via `showPaymentDetails`, and simplifies
`BridgeFeeRow` and `ReceiveRow` to compute from `totals` even without
quotes (with `BridgeFeeRow` only showing its tooltip when quotes exist).
`BridgeTimeRow` now also shows an estimate for same-chain payments
without quotes. Tests are updated/added to cover these scenarios.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
39e0f79. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>1 parent 9f195d0 commit 4aedbb4
File tree
8 files changed
+110
-31
lines changed- app/components/Views/confirmations/components
- info/custom-amount-info
- rows
- bridge-fee-row
- bridge-time-row
- receive-row
8 files changed
+110
-31
lines changedLines changed: 65 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| 28 | + | |
27 | 29 | | |
| 30 | + | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
| |||
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
| 53 | + | |
| 54 | + | |
50 | 55 | | |
51 | 56 | | |
52 | 57 | | |
| |||
184 | 189 | | |
185 | 190 | | |
186 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
187 | 198 | | |
188 | 199 | | |
189 | 200 | | |
| |||
255 | 266 | | |
256 | 267 | | |
257 | 268 | | |
| 269 | + | |
| 270 | + | |
258 | 271 | | |
259 | 272 | | |
260 | 273 | | |
| |||
537 | 550 | | |
538 | 551 | | |
539 | 552 | | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
540 | 604 | | |
541 | 605 | | |
542 | 606 | | |
| |||
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| |||
169 | 170 | | |
170 | 171 | | |
171 | 172 | | |
172 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
173 | 182 | | |
174 | 183 | | |
175 | 184 | | |
| |||
272 | 281 | | |
273 | 282 | | |
274 | 283 | | |
275 | | - | |
| 284 | + | |
276 | 285 | | |
277 | 286 | | |
278 | 287 | | |
| |||
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | | - | |
112 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
113 | 119 | | |
114 | 120 | | |
115 | 121 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
105 | 119 | | |
106 | 120 | | |
107 | 121 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | | - | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| |||
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
47 | | - | |
48 | | - | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
Lines changed: 4 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
| 11 | + | |
17 | 12 | | |
18 | 13 | | |
19 | 14 | | |
| |||
40 | 35 | | |
41 | 36 | | |
42 | 37 | | |
43 | | - | |
44 | 38 | | |
45 | 39 | | |
46 | 40 | | |
| |||
54 | 48 | | |
55 | 49 | | |
56 | 50 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | 51 | | |
61 | 52 | | |
62 | 53 | | |
| |||
97 | 88 | | |
98 | 89 | | |
99 | 90 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
105 | 94 | | |
106 | 95 | | |
Lines changed: 2 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| |||
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
34 | | - | |
35 | | - | |
36 | 33 | | |
37 | 34 | | |
38 | | - | |
| 35 | + | |
39 | 36 | | |
40 | 37 | | |
41 | 38 | | |
| |||
53 | 50 | | |
54 | 51 | | |
55 | 52 | | |
56 | | - | |
| 53 | + | |
57 | 54 | | |
58 | 55 | | |
59 | 56 | | |
| |||
0 commit comments