Commit a679e8e
authored
fix: cp-7.60.0 show all blocking alerts if keyboard not visible (#22837)
## **Description**
Ensure all blocking alerts are visible in MetaMask Pay if keyboard is
not visible.
## **Changelog**
CHANGELOG entry: null
## **Related issues**
Fixes: #22756
## **Manual testing steps**
## **Screenshots/Recordings**
### **Before**
### **After**
## **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]
> Refactors alert filtering to surface blocking and pending alerts
appropriately (respecting keyboard visibility and input-change rules)
and updates tests accordingly.
>
> - **Hooks** (`useTransactionCustomAmountAlerts`):
> - Filter confirmation alerts to only blocking, then exclude alerts
based on:
> - No input change for `ON_CHANGE_ALERTS`.
> - Keyboard visible for non-`KEYBOARD_ALERTS`.
> - Keyboard visible for `PENDING_AMOUNT_ALERTS`.
> - Combine `pendingTokenAlerts` with filtered confirmation alerts and
select the first alert for display.
> - **Tests** (`useTransactionCustomAmountAlerts.test.ts`):
> - Add test ensuring pending alert is returned when applicable.
> - Add test ensuring pending alerts are suppressed when keyboard is
visible.
> - Adjust test names to clarify keyboard and on-change behaviors.
> - Verify non-blocking alerts are ignored.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
5bb7b96. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 80584b2 commit a679e8e
File tree
2 files changed
+57
-24
lines changed- app/components/Views/confirmations/hooks/transactions
2 files changed
+57
-24
lines changedLines changed: 34 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
120 | 134 | | |
121 | 135 | | |
122 | 136 | | |
| |||
131 | 145 | | |
132 | 146 | | |
133 | 147 | | |
134 | | - | |
| 148 | + | |
135 | 149 | | |
136 | 150 | | |
137 | 151 | | |
| |||
160 | 174 | | |
161 | 175 | | |
162 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
163 | 195 | | |
Lines changed: 23 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 41 | + | |
| 42 | + | |
48 | 43 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
53 | 61 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | | - | |
| 67 | + | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| |||
0 commit comments