refactor(analytics): migrate Batch 3-13: mobile-platform#26584
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. |
…3-13_mobile-platform
…3-13_mobile-platform
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
The changes are purely internal - swapping one analytics hook for another with the same API ( The test files have been updated to mock Since all affected components are network management related,
Performance Test Selection: |
Description
Phase 3 analytics migration (Batch 3-13): migrate Network Management's components and hooks from
useMetricsto the new analytics system (useAnalytics).Reason: Deprecate MetaMetrics in favour of the shared analytics utility and AnalyticsController.
Changes:
ManageNetworks,NetworkMultiSelector,NetworkManager, andMultiRpcModalnow useuseAnalyticsfromapp/components/hooks/useAnalytics/useAnalyticsand importMetaMetricsEventsfromapp/core/Analytics; test mocks updated to mockuseAnalyticsinstead ofuseMetrics.Changelog
CHANGELOG entry: null
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/MCWP-302 (Batch 3-13)
Manual testing steps
Screenshots/Recordings
N/A – analytics migration, no UI change.
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Low risk UI refactor that only swaps analytics plumbing; primary risk is missing/misnamed events if the new
useAnalyticshook orMetaMetricsEventsimport differs from the olduseMetricsbehavior.Overview
Switches Network Management UI surfaces (e.g.,
ManageNetworks,NetworkManager,NetworkMultiSelector, andMultiRpcModal) fromuseMetricsto the shareduseAnalyticshook while keeping existing event tracking calls (trackEvent/createEventBuilder).Updates unit tests to mock
useAnalyticsinstead ofuseMetrics, and adjusts event constant imports/expectations to useMetaMetricsEventsfromcore/Analytics/MetaMetrics.eventswhere applicable.Written by Cursor Bugbot for commit 3c6fb53. This will update automatically on new commits. Configure here.