refactor(analytics): migrate Batch 3-17: mobile-platform#26679
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-17_mobile-platform
…3-17_mobile-platform
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Key factors for no E2E tests needed:
This is a straightforward internal refactoring with no user-facing impact. Performance Test Selection: |
Cal-L
left a comment
There was a problem hiding this comment.
Accidentally approved. LMK once it's ready and I can approve
Description
Phase 3 analytics migration (Batch 3-17): migrate Sample Feature's components and hooks from
useMetrics/MetricsEventBuilderto the newuseAnalytics/AnalyticsEventBuilderanalytics system.Reason: Deprecate MetaMetrics in favour of the shared analytics utility and AnalyticsController.
Changes:
SamplePetNamesForm,SampleCounterPane, andSampleFeatureDevSettingsEntryPointnow useuseAnalytics()fromapp/components/hooks/useAnalytics/useAnalyticsandcreateEventBuilderfrom the hook instead ofuseMetrics()andMetricsEventBuilder; test mocks updated to mock theuseAnalyticshook with a chainable builder instead ofuseMetrics.Changelog
CHANGELOG entry: null
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/MCWP-302 (Batch 3-17)
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: this is a refactor of analytics event building/tracking in a non-production sample feature, with corresponding unit test updates. Main risk is mis-tracked or missing events due to the new builder/mocking semantics.
Overview
Updates SampleFeature event tracking to use
useAnalytics()and itscreateEventBuilderinstead ofuseMetrics()/MetricsEventBuilderinSampleCounterPane,SamplePetNamesForm, and the dev-settings entry point.Adjusts analytics event definitions (
analytics/events.ts) and rewrites unit tests to mock/verify the newuseAnalyticshook and builder chaining, plus updates SampleFeature docs/e2e docs to refer to Analytics (not MetaMetrics).Written by Cursor Bugbot for commit 2dce2e4. This will update automatically on new commits. Configure here.