feat(perps-controller): add perps_mode analytics property for Lite/Pro UI - #9819
Merged
Merged
Conversation
…o UI Keep existing MODE as search intent so clients can attribute events by interface mode without colliding with discovery/intent/browse.
Resolve CHANGELOG conflict by keeping perps_mode analytics entry alongside main Unreleased additions.
oxfmt and changelog validation both require a single blank line before the next version heading.
The changelog check requires Unreleased entries to reference this PR number.
aganglada
approved these changes
Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
Clients need to attribute Perps analytics events by Lite/Pro interface mode (
'lite' | 'pro'). Search already usesPERPS_EVENT_PROPERTY.MODE(mode) for search intent (discovery/intent/browse), so reusing that key would collide and break dashboards.This PR adds
PERPS_EVENT_PROPERTY.PERPS_MODE = 'perps_mode'in@metamask/perps-controllerso mobile and extension can import a single shared key for Lite/Pro UI mode. ExistingMODEis left unchanged and clarified with a comment. Tests and the package changelog are updated accordingly.References
N/A
Checklist
Note
Low Risk
Constants-only change with no controller runtime or trading behavior; clients opt in when they attach the property to events.
Overview
Adds
PERPS_EVENT_PROPERTY.PERPS_MODE(perps_mode) so mobile and extension can tag Perps analytics with Lite vs Pro UI mode ('lite' | 'pro') from a single shared constant.MODE(mode) is unchanged but documented in code as search intent (discovery/intent/browse), not interface mode, so dashboards are not conflated. Package changelog andeventNamestests cover the new key.Reviewed by Cursor Bugbot for commit 34d59b6. Bugbot is set up for automated code reviews on this repo. Configure here.