diff --git a/packages/perps-controller/CHANGELOG.md b/packages/perps-controller/CHANGELOG.md index 58e15499ef..a22b5c8bfe 100644 --- a/packages/perps-controller/CHANGELOG.md +++ b/packages/perps-controller/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Add `PERPS_EVENT_PROPERTY.PERPS_MODE` (`perps_mode`) for Lite/Pro interface mode analytics (`'lite' | 'pro'`), distinct from existing `PERPS_EVENT_PROPERTY.MODE` (`mode`) which is search intent (`discovery` / `intent` / `browse`) ([#9819](https://github.com/MetaMask/core/pull/9819)) - **BREAKING:** Add `positionsSideFilter`, `positionsSortField`, and `positionsSortDirection` to the flat `ProLayoutPreferences` object (defaults `'all'`, `'positionValue'`, `'desc'`) so Pro Positions/Orders panel sort and side-filter preferences persist across markets and app restarts via the existing `getProLayoutPreferences()` / `setProLayoutPreferences(patch)` API; export `ProPositionsSideFilter`, `ProPositionsSortField`, and `ProPositionsSortDirection` ([#9838](https://github.com/MetaMask/core/pull/9838)) - Consumers that construct a full `ProLayoutPreferences` object (instead of using `DEFAULT_PRO_LAYOUT_PREFERENCES`, the getter, or the patch setter) must include the new fields. Persisted state that predates them remains valid at runtime because the getter/selector merge over defaults. - **BREAKING:** Add strategy placement order types to `OrderType`: `twap`, `scale`, and `chase`, placeable through `placeOrder` alongside the existing `market`, `limit`, and trigger types ([#9832](https://github.com/MetaMask/core/pull/9832)) diff --git a/packages/perps-controller/src/constants/eventNames.ts b/packages/perps-controller/src/constants/eventNames.ts index 611448468a..c2be723d9d 100644 --- a/packages/perps-controller/src/constants/eventNames.ts +++ b/packages/perps-controller/src/constants/eventNames.ts @@ -231,9 +231,13 @@ export const PERPS_EVENT_PROPERTY = { SEARCH_QUERY: 'search_query', RESULTS_COUNT: 'results_count', RESULT_RANK: 'result_rank', + // Search intent (`discovery` / `intent` / `browse`) — not Lite/Pro UI mode MODE: 'mode', CURRENT_TOKEN: 'current_token', + // Lite/Pro interface mode (`'lite' | 'pro'`) + PERPS_MODE: 'perps_mode', + // Sort / filter properties SORT_FIELD: 'sort_field', SORT_DIRECTION: 'sort_direction', diff --git a/packages/perps-controller/tests/src/constants/eventNames.test.ts b/packages/perps-controller/tests/src/constants/eventNames.test.ts index e2b4b7bcea..59c109b71a 100644 --- a/packages/perps-controller/tests/src/constants/eventNames.test.ts +++ b/packages/perps-controller/tests/src/constants/eventNames.test.ts @@ -85,10 +85,15 @@ describe('PERPS_EVENT_PROPERTY', () => { expect(PERPS_EVENT_PROPERTY.SEARCH_QUERY).toBe('search_query'); expect(PERPS_EVENT_PROPERTY.RESULTS_COUNT).toBe('results_count'); expect(PERPS_EVENT_PROPERTY.RESULT_RANK).toBe('result_rank'); + // Search intent — distinct from PERPS_MODE (Lite/Pro UI) expect(PERPS_EVENT_PROPERTY.MODE).toBe('mode'); expect(PERPS_EVENT_PROPERTY.CURRENT_TOKEN).toBe('current_token'); }); + it('exports PERPS_MODE for Lite/Pro interface mode', () => { + expect(PERPS_EVENT_PROPERTY.PERPS_MODE).toBe('perps_mode'); + }); + it('exports sort / filter and time-on-screen keys', () => { expect(PERPS_EVENT_PROPERTY.SORT_FIELD).toBe('sort_field'); expect(PERPS_EVENT_PROPERTY.SORT_DIRECTION).toBe('sort_direction');