refactor(analytics): migrate assets defi empty state metrics#43437
Conversation
✨ Files requiring CODEOWNER review ✨💎 @MetaMask/metamask-assets (1 files, +11 -6)
|
|
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. |
c895e17 to
166d85e
Compare
Builds ready [166d85e]
⚡ Performance Benchmarks (Total: 🟢 20 pass · 🟡 5 warn · 🔴 0 fail)
Bundle size diffs
|
166d85e to
676a406
Compare
Builds ready [676a406]
⚡ Performance Benchmarks (Total: 🟢 17 pass · 🟡 7 warn · 🔴 1 fail)
Bundle size diffs
|
676a406 to
ace2ac2
Compare
Builds ready [ace2ac2] [reused from 676a406]
⚡ Performance Benchmarks (Total: 🟢 17 pass · 🟡 7 warn · 🔴 1 fail)
Bundle size diffs
|
Refresh slice from main-synced monolithic branch.
ace2ac2 to
02f7faa
Compare
Builds ready [02f7faa]
⚡ Performance Benchmarks (Total: 🟢 19 pass · 🟡 6 warn · 🔴 0 fail)
Bundle size diffs
|
There was a problem hiding this comment.
Pull request overview
Migrates the DeFi empty state component off legacy MetaMetrics selectors to the Phase B canonical analytics selectors, aligning consent gating with AnalyticsController-backed state.
Changes:
- Replaces
getMetaMetricsId/getParticipateInMetaMetricsusage withgetAnalyticsId,getCompletedMetaMetricsOnboarding, andgetOptedIn. - Derives
isMetaMetricsEnabledfromcompletedMetaMetricsOnboarding && isOptedInand continues to pass the consent booleans intogetPortfolioUrl.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
## **Description** Part 8 of the Analytics Phase B split (supersedes monolithic #43406). **Owner:** @MetaMask/metamask-assets **Reason:** Defi empty state still uses legacy metrics selectors. **Solution:** Update `defi-empty-state.tsx` to use canonical analytics selectors. **Depends on:** #43430 ## **Changelog** CHANGELOG entry: null ## **Related issues** Part of MetaMask/MetaMask-planning#7331 ## **Manual testing steps** 1. Run `yarn start` and verify defi empty state renders and links work with metrics enabled and disabled <!-- ## **Screenshots/Recordings** ### **Before** ### **After** --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/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.
Description
Part 8 of the Analytics Phase B split (supersedes monolithic #43406).
Owner: @MetaMask/metamask-assets
Reason: Defi empty state still uses legacy metrics selectors.
Solution: Update
defi-empty-state.tsxto use canonical analytics selectors.Depends on: #43430
Changelog
CHANGELOG entry: null
Related issues
Part of https://github.com/MetaMask/MetaMask-planning/issues/7331
Manual testing steps
yarn startand verify defi empty state renders and links work with metrics enabled and disabledPre-merge author checklist
Pre-merge reviewer checklist