Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/perps-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
4 changes: 4 additions & 0 deletions packages/perps-controller/src/constants/eventNames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down