Repository navigation
chore: track token table sort metrics - #47845
Conversation
|
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. |
✨ Files requiring CODEOWNER review ✨💎 @MetaMask/metamask-assets (5 files, +96 -12)
|
Builds ready [6123ddb]
⚡ Performance Benchmarks (Total: 🟢 6 pass · 🟡 4 warn · 🔴 3 fail)
Bundle Size Diffs
|
|
|
No release label on PR. Adding release label release-13.58.0 on PR, as PR was added to branch 13.58.0 when release was cut. |




Description
Clicking a token table sort header in widescreen view now sends the existing
Token Sort Preference Updatedevent. The sort menu sends the same event withlocation: Sort Menu.token_sort_preferencestaystitleortokenFiatAmountfor the name and balance sorts, and ispriceorpercentChangefor the new header sorts. Those values live onMetaMetricsTokenSortPreference. The saved sort keys are unchanged.On the wide table, the sort menu button is now hidden because the column headers are the sort control.
Changelog
CHANGELOG entry: null
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/CEUX-1373
Manual testing steps
Token Sort Preference UpdatedwithlocationToken Column Headerandtoken_sort_preferenceoftitle,price,percentChange, ortokenFiatAmount.locationSort Menuandtoken_sort_preferenceoftitleortokenFiatAmount, and that the saved sort updates.Example new event
Updated existing event with location
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Analytics and UI-only changes; no auth, persistence, or transaction logic affected.
Overview
Token sort analytics now distinguish where sorting happened and use typed preference values. New enums
MetaMetricsTokenSortLocation(Sort Menu,Token Column Header) andMetaMetricsTokenSortPreference(title,tokenFiatAmount,price,percentChange) standardize the existingToken Sort Preference Updatedevent.Clicking a token table column header emits that event with
location: Token Column Headerand the column-mappedtoken_sort_preference. The sort menu still updates saved preferences but now sends the same event withlocation: Sort Menuand enum-backed values instead of raw sort keys.On wide/table layout, the separate Sort control is hidden because headers handle sorting (header sorts remain session-only; persisted config is unchanged). Tests cover analytics for both surfaces.
Reviewed by Cursor Bugbot for commit 6123ddb. Bugbot is set up for automated code reviews on this repo. Configure here.