Commit 5180a8c
authored
chore: remove MM_REMOVE_GLOBAL_NETWORK_SELECTOR from hooks, lists, and control bars (MetaMask#22574)
## **Description**
This is part of a series of PRs removing the
`MM_REMOVE_GLOBAL_NETWORK_SELECTOR` feature flag.
**Master PR for reference:**
MetaMask#22067
This PR removes the feature flag from hooks, list components, control
bars, and navigation components. The changes enable Network Manager
behavior by default across all affected components.
#### Key Changes:
**Hooks:**
- `useTransactionConfirm` - Now always calls `tryEnableEvmNetwork` after
transaction confirmation
- `useExistingAddress` - Always filters addresses across all enabled
networks
- `useSelectedAccountMultichainBalances` - Uses
`selectEVMEnabledNetworks` to calculate balances
- `useNetworkSwitch` - Removed feature flag from test mocks
**Control Bars:**
- `BaseControlBar` - Removed feature flag logic, always navigates to
Network Manager
- `TokenListControlBar` - Removed conditional navigation, always shows
enabled networks
- `DeFiPositionsControlBar` - Always navigates to Network Manager
instead of TokenFilter
**List Components:**
- `DeFiPositionsList` - Always uses
`selectDefiPositionsByEnabledNetworks` selector
- `TokenFilterBottomSheet` - Always calls `selectNetwork` for Network
Manager integration
**Navigation:**
- `Navbar` - Removed old `PickerNetwork` component and feature flag
checks
- `ActivityView` - Removed feature flag import and conditional logic
- `Wallet` - Updated to use Network Manager behavior
#### Test Updates:
- Removed all `isRemoveGlobalNetworkSelectorEnabled` feature flag mocks
- Removed obsolete test cases that covered old behavior (flag OFF)
- Updated test descriptions from "when feature flag is enabled/disabled"
to describe actual
behavior
- Fixed duplicate test in `useExistingAddress.test.ts` with stale
feature flag reference
#### Behavior Change:
The default behavior is now equivalent to the feature flag being ON. All
components use Network Manager with `NetworkEnablementController` to
determine enabled networks instead of relying on the feature flag or
legacy network selection logic.
## **Changelog**
CHANGELOG entry: Removed `MM_REMOVE_GLOBAL_NETWORK_SELECTOR` feature
flag from hooks, list
components, control bars, and navigation. Components now use Network
Manager behavior by default.
## **Related issues**
Fixes: Fixes: https://consensyssoftware.atlassian.net/browse/MUL-1132
## **Manual testing steps**
```gherkin
Feature: my feature name
Scenario: user [verb for user action]
Given [describe expected initial app state]
When user [verb for user action]
Then [describe expected outcome]
```
## **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**
- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] 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]
> Removes the MM_REMOVE_GLOBAL_NETWORK_SELECTOR flag and makes Network
Manager the default across hooks, lists, navbars, and activity view,
updating logic, styles, and tests accordingly.
>
> - **Network Manager as default**:
> - Navigation and UI now always route filter actions to
`NetworkManager` (replaces `TokenFilter` flows).
> - Removed `PickerNetwork` usage and related flag checks in `Navbar`
and `ActivityView`.
> - **Hooks**:
> - `useTransactionConfirm`: always calls `tryEnableEvmNetwork(chainId)`
post-confirm.
> - `useExistingAddress`: always aggregates `AddressBook` across
networks.
> - `useSelectedAccountMultichainBalances`: aggregates via
`selectEVMEnabledNetworks` and always across enabled EVM chains.
> - `useNetworkSwitch` tests simplified to remove flag logic.
> - **Lists and Filters**:
> - `DeFiPositionsList`: always uses
`selectDefiPositionsByEnabledNetworks` for data.
> - `TokenFilterBottomSheet`: always updates Preferences and calls
`selectNetwork`.
> - **Control Bars**:
> - `BaseControlBar`, `TokenListControlBar`, `DeFiPositionsControlBar`:
remove flag branches; always show enabled networks label and navigate to
`NetworkManager`.
> - **Styles**:
> - Control bar button styles standardized (always bordered, rounded,
padded).
> - **Tests/Snapshots**:
> - Removed flag mocks and obsolete cases; updated expectations to
`NetworkManager` navigation and new labels/styles.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
750c2cd. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 27e3f35 commit 5180a8c
22 files changed
Lines changed: 299 additions & 931 deletions
File tree
- app/components
- UI
- DeFiPositions
- Tokens
- TokenListControlBar
- TokensBottomSheet
- Views
- ActivityView
- __snapshots__
- NetworkSelector
- confirmations/hooks/transactions
- hooks
- useMultichainBalances
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
87 | 86 | | |
88 | 87 | | |
89 | | - | |
90 | 88 | | |
91 | 89 | | |
92 | 90 | | |
| |||
98 | 96 | | |
99 | 97 | | |
100 | 98 | | |
101 | | - | |
102 | 99 | | |
103 | 100 | | |
104 | 101 | | |
| |||
301 | 298 | | |
302 | 299 | | |
303 | 300 | | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
| 301 | + | |
308 | 302 | | |
309 | 303 | | |
310 | 304 | | |
| |||
Lines changed: 4 additions & 98 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
160 | 159 | | |
161 | 160 | | |
162 | 161 | | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
| 162 | + | |
217 | 163 | | |
218 | 164 | | |
219 | 165 | | |
| |||
226 | 172 | | |
227 | 173 | | |
228 | 174 | | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
| 175 | + | |
233 | 176 | | |
234 | 177 | | |
235 | 178 | | |
| |||
260 | 203 | | |
261 | 204 | | |
262 | 205 | | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
| 206 | + | |
267 | 207 | | |
268 | 208 | | |
269 | 209 | | |
| |||
292 | 232 | | |
293 | 233 | | |
294 | 234 | | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
| 235 | + | |
299 | 236 | | |
300 | 237 | | |
301 | 238 | | |
| |||
323 | 260 | | |
324 | 261 | | |
325 | 262 | | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | 263 | | |
358 | 264 | | |
359 | 265 | | |
| |||
Lines changed: 35 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
194 | 193 | | |
195 | 194 | | |
196 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
197 | 200 | | |
198 | 201 | | |
199 | 202 | | |
200 | 203 | | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
| 204 | + | |
207 | 205 | | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
208 | 210 | | |
209 | 211 | | |
210 | 212 | | |
| |||
229 | 231 | | |
230 | 232 | | |
231 | 233 | | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
232 | 245 | | |
233 | 246 | | |
234 | 247 | | |
| |||
344 | 357 | | |
345 | 358 | | |
346 | 359 | | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
| 360 | + | |
| 361 | + | |
354 | 362 | | |
355 | 363 | | |
356 | 364 | | |
| |||
463 | 471 | | |
464 | 472 | | |
465 | 473 | | |
466 | | - | |
| 474 | + | |
467 | 475 | | |
468 | 476 | | |
469 | 477 | | |
| |||
629 | 637 | | |
630 | 638 | | |
631 | 639 | | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
632 | 652 | | |
633 | 653 | | |
634 | 654 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | 5 | | |
10 | 6 | | |
11 | 7 | | |
| |||
32 | 28 | | |
33 | 29 | | |
34 | 30 | | |
35 | | - | |
36 | 31 | | |
37 | 32 | | |
38 | 33 | | |
| |||
43 | 38 | | |
44 | 39 | | |
45 | 40 | | |
46 | | - | |
47 | | - | |
48 | 41 | | |
49 | 42 | | |
50 | 43 | | |
| |||
60 | 53 | | |
61 | 54 | | |
62 | 55 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
77 | 59 | | |
78 | 60 | | |
79 | 61 | | |
| |||
100 | 82 | | |
101 | 83 | | |
102 | 84 | | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
| 85 | + | |
110 | 86 | | |
111 | 87 | | |
112 | 88 | | |
| |||
0 commit comments