chore: create network enablement controller
Explanation
The NetworkEnablementController is a core implementation of network enablement functionality that was previously only available in the extension. This PR moves and expands this functionality from the extension's NetworkOrder controller to core, enabling networ visibility features across both extension and mobile platforms. It also renames it to NetworkEnablementController to more accurately represent what it does. Maybe in the future this can be expanded to include other UX enhancements that don't need to be tightly coupled with the NetworkController
Key motivations for this change:
Network Enablement Feature: This work is part of the broader Network Enablement initiative (https://github.com/MetaMask/core/issues/5737). The controller has been expanded to include enabledNetworkMap state, allowing us to:
Track which networks are enabled/disabled Support the new network enablement feature Code Quality Improvements: The move to core has provided an opportunity to:
Improve test coverage of the existing network ordering logic The controller now handles three key aspects:
Network enablement (new functionality. recently introduced on extension)
References
- Moves functionality from NetworkOrder controller in extension to core
- Part of Network Enablement initiative (#5737)
- Related to ongoing work related to Global Network Selector Removal
Changelog
Checklist
- [ ] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
- [ ] I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
- [ ] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes