Skip to content

feat(perps-controller): add perps_mode analytics property for Lite/Pro UI - #9819

Merged
michalconsensys merged 4 commits into
mainfrom
feat/core-perps-mode-analytics-property
Aug 13, 2026
Merged

feat(perps-controller): add perps_mode analytics property for Lite/Pro UI#9819
michalconsensys merged 4 commits into
mainfrom
feat/core-perps-mode-analytics-property

Conversation

@michalconsensys

@michalconsensys michalconsensys commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Explanation

Clients need to attribute Perps analytics events by Lite/Pro interface mode ('lite' | 'pro'). Search already uses PERPS_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-controller so mobile and extension can import a single shared key for Lite/Pro UI mode. Existing MODE is left unchanged and clarified with a comment. Tests and the package changelog are updated accordingly.

References

N/A

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
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

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 and eventNames tests cover the new key.

Reviewed by Cursor Bugbot for commit 34d59b6. Bugbot is set up for automated code reviews on this repo. Configure here.

…o UI

Keep existing MODE as search intent so clients can attribute events by interface mode without colliding with discovery/intent/browse.
@michalconsensys
michalconsensys requested review from a team as code owners August 11, 2026 08:46
@michalconsensys
michalconsensys deployed to default-branch August 11, 2026 08:46 — with GitHub Actions Active
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.
@michalconsensys
michalconsensys added this pull request to the merge queue Aug 13, 2026
Merged via the queue into main with commit e47094f Aug 13, 2026
46 checks passed
@michalconsensys
michalconsensys deleted the feat/core-perps-mode-analytics-property branch August 13, 2026 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants