Skip to content

chore: track token table sort metrics - #47845

Merged
ameliejyc merged 12 commits into
mainfrom
track-token-sort-header-metrics
Nov 11, 2026
Merged

ameliejyc merged 12 commits into
mainfrom
track-token-sort-header-metrics

Conversation

@ameliejyc

@ameliejyc ameliejyc commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Description

Clicking a token table sort header in widescreen view now sends the existing Token Sort Preference Updated event. The sort menu sends the same event with location: Sort Menu.

token_sort_preference stays title or tokenFiatAmount for the name and balance sorts, and is price or percentChange for the new header sorts. Those values live on MetaMetricsTokenSortPreference. 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

  1. Open the wallet wide enough to show the token table.
  2. Confirm the sort menu button is not shown next to the network filter.
  3. Click Token, Price, 24h change, and Balance, including a second click on the same header.
  4. In the MetaMetrics debugger, confirm each click sends Token Sort Preference Updated with location Token Column Header and token_sort_preference of title, price, percentChange, or tokenFiatAmount.
  5. Narrow the wallet until the token list replaces the table.
  6. Open the sort menu and choose Alphabetically, then Declining balance.
  7. Confirm those events use location Sort Menu and token_sort_preference of title or tokenFiatAmount, and that the saved sort updates.

Example new event

{
  "category": "Settings",
  "token_sort_preference": "title",
  "location": "Token Column Header",
  "environment_type": "fullscreen",
  "locale": "en",
  "chain_id": "0x1",
  "profile_id": "be2ccf24-a244-45d1-b3b5-c5ae833c8702",
  "canonical_profile_id": "3ad7e304-c059-4d3d-a349-5fb7f9c15e3a"
}

Updated existing event with location

{
  "category": "Settings",
  "token_sort_preference": "title",
  "location": "Sort Menu",
  "environment_type": "fullscreen",
  "locale": "en",
  "chain_id": "0x1",
  "profile_id": "be2ccf24-a244-45d1-b3b5-c5ae833c8702",
  "canonical_profile_id": "3ad7e304-c059-4d3d-a349-5fb7f9c15e3a"
}

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

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) and MetaMetricsTokenSortPreference (title, tokenFiatAmount, price, percentChange) standardize the existing Token Sort Preference Updated event.

Clicking a token table column header emits that event with location: Token Column Header and the column-mapped token_sort_preference. The sort menu still updates saved preferences but now sends the same event with location: Sort Menu and 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.

@github-actions

Copy link
Copy Markdown
Contributor

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.

@metamask-ci metamask-ci Bot added the team-core-extension-ux Core Extension UX team label Nov 11, 2026
@metamask-ci

metamask-ci Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

✨ Files requiring CODEOWNER review ✨

💎 @MetaMask/metamask-assets (5 files, +96 -12)
  • 📁 ui/
    • 📁 components/
      • 📁 app/
        • 📁 assets/
          • 📁 asset-list/
            • 📁 sort-control/
              • 📄 sort-control.test.tsx +6 -2
              • 📄 sort-control.tsx +16 -7
              • 📄 asset-list.tsx +1 -1
          • 📁 token-table/
            • 📄 token-table.test.tsx +43 -1
            • 📄 token-table.tsx +30 -1

@ameliejyc
ameliejyc marked this pull request as ready for review November 11, 2026 16:55
@ameliejyc
ameliejyc requested a review from a team as a code owner November 11, 2026 16:55
@ameliejyc ameliejyc changed the title chore: track token sort header metrics chore: track token table sort metrics Nov 11, 2026
@metamask-ci

metamask-ci Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor
Builds ready [6123ddb]
⚡ Performance Benchmarks (Total: 🟢 6 pass · 🟡 4 warn · 🔴 3 fail)

Baseline (latest main): f693520 | Date: 11/3/2026 | Pipeline: 43062099703 | Baseline logs

Metricschrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🔴 load_new_account(p95) [CI log]🔴 load_new_account(p95) [CI log]
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🔴 [CI log]

Regressions (🔴 3 failures)

Interaction Benchmarks · Samples: 5 🔴 2
Benchmarkchrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🔴 [CI log]
🔴 load_new_account
🔴 [CI log]
🔴 load_new_account
confirmTx
[Sentry log · main/release]
🟡 [CI log]🟡 [CI log]
bridgeUserActions
[Sentry log · main/release]
🟡 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↑ loadNewAccount/load_new_account: +183%
  • ↑ loadNewAccount/total: +183%
  • ↓ loadNewAccount/inp: -10%
  • ↑ loadNewAccount/lcp: +979%
  • ↑ loadNewAccount/cls: +629%
  • ↑ confirmTx/longTaskCount: +67%
  • ↑ confirmTx/longTaskTotalDuration: +77%
  • ↑ confirmTx/longTaskMaxDuration: +60%
  • ↑ confirmTx/tbt: +88%
  • ↓ confirmTx/inp: -21%
  • ↑ confirmTx/lcp: +985%
  • ↑ bridgeUserActions/bridge_load_page: +132%
  • ↑ bridgeUserActions/bridge_load_asset_picker: +36%
  • ↑ bridgeUserActions/tbt: +39%
  • ↑ bridgeUserActions/total: +20%
  • ↑ bridgeUserActions/inp: +18%
  • ↑ bridgeUserActions/fcp: +10%
  • ↑ bridgeUserActions/lcp: +989%
  • ↑ bridgeUserActions/cls: +387%
  • ↑ loadNewAccount/load_new_account: +182%
  • ↑ loadNewAccount/total: +182%
  • ↓ loadNewAccount/inp: -10%
  • ↑ loadNewAccount/fcp: +18%
  • ↑ loadNewAccount/lcp: +1275%
  • ↓ confirmTx/longTaskCount: -100%
  • ↓ confirmTx/longTaskTotalDuration: -100%
  • ↓ confirmTx/longTaskMaxDuration: -100%
  • ↓ confirmTx/tbt: -100%
  • ↓ confirmTx/inp: -21%
  • ↑ confirmTx/fcp: +20%
  • ↑ confirmTx/lcp: +1299%
  • ↑ bridgeUserActions/bridge_load_page: +240%
  • ↑ bridgeUserActions/bridge_load_asset_picker: +107%
  • ↓ bridgeUserActions/longTaskCount: -100%
  • ↓ bridgeUserActions/longTaskTotalDuration: -100%
  • ↓ bridgeUserActions/longTaskMaxDuration: -100%
  • ↓ bridgeUserActions/tbt: -100%
  • ↑ bridgeUserActions/total: +59%
  • ↑ bridgeUserActions/inp: +54%
  • ↓ bridgeUserActions/fcp: -33%
  • ↑ bridgeUserActions/lcp: +1316%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 loadNewAccount/FCP: p75 1.9s
  • 🟡 confirmTx/FCP: p75 1.9s
  • 🟡 bridgeUserActions/FCP: p75 1.9s
  • 🟡 loadNewAccount/FCP: p75 2.0s
  • 🟡 confirmTx/FCP: p75 2.1s
Startup Benchmarks · Samples: 100
Benchmarkchrome-webpackfirefox-webpack
startupStandardHome
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↑ startupStandardHome/uiStartup: +32%
  • ↑ startupStandardHome/load: +58%
  • ↑ startupStandardHome/domContentLoaded: +56%
  • ↓ startupStandardHome/firstPaint: -38%
  • ↓ startupStandardHome/backgroundConnect: -22%
  • ↓ startupStandardHome/firstReactRender: -98%
  • ↓ startupStandardHome/initialActions: -64%
  • ↑ startupStandardHome/loadScripts: +55%
  • ↑ startupStandardHome/setupStore: +56%
  • ↑ startupStandardHome/longTaskTotalDuration: +50%
  • ↑ startupStandardHome/longTaskMaxDuration: +80%
  • ↑ startupStandardHome/tbt: +64%
  • ↓ startupStandardHome/inp: -24%
  • ↑ startupStandardHome/fcp: +51%
  • ↑ startupStandardHome/lcp: +578%
  • ↓ startupStandardHome/cls: -72%
  • ↓ startupStandardHome/uiStartup: -38%
  • ↓ startupStandardHome/load: -34%
  • ↓ startupStandardHome/domContentLoaded: -36%
  • ↓ startupStandardHome/domInteractive: -56%
  • ↓ startupStandardHome/backgroundConnect: -32%
  • ↓ startupStandardHome/firstReactRender: -99%
  • ↓ startupStandardHome/initialActions: -50%
  • ↓ startupStandardHome/loadScripts: -34%
  • ↑ startupStandardHome/setupStore: +41%
  • ↓ startupStandardHome/fcp: -46%
  • ↓ startupStandardHome/lcp: -32%
User Journey Benchmarks · Samples: 5 · mock API 🔴 1
Benchmarkchrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
🟡 total
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🔴 [CI log]
🔴 total

📈 Results compared to the previous 5 runs on main

  • ↑ onboardingImportWallet/srpButtonToSrpForm: +24%
  • ↑ onboardingImportWallet/confirmSrpToPwForm: +27%
  • ↑ onboardingImportWallet/pwFormToMetricsScreen: +37%
  • ↑ onboardingImportWallet/metricsToWalletReadyScreen: +22%
  • ↓ onboardingImportWallet/doneButtonToHomeScreen: -92%
  • ↓ onboardingImportWallet/openAccountMenuToAccountListLoaded: -74%
  • ↓ onboardingImportWallet/longTaskCount: -82%
  • ↓ onboardingImportWallet/longTaskTotalDuration: -93%
  • ↓ onboardingImportWallet/longTaskMaxDuration: -89%
  • ↓ onboardingImportWallet/tbt: -98%
  • ↓ onboardingImportWallet/total: -85%
  • ↓ onboardingNewWallet/createWalletToSocialScreen: -11%
  • ↓ onboardingNewWallet/agreeButtonToOnboardingSuccess: -30%
  • ↓ onboardingNewWallet/doneButtonToAssetList: -80%
  • ↓ onboardingNewWallet/longTaskCount: -100%
  • ↓ onboardingNewWallet/longTaskTotalDuration: -100%
  • ↓ onboardingNewWallet/longTaskMaxDuration: -100%
  • ↓ onboardingNewWallet/tbt: -100%
  • ↓ onboardingNewWallet/total: -76%
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-webpack
dappPageLoad
[Sentry log · main/release]
🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↓ dappPageLoad/pageLoadTime: -49%
  • ↓ dappPageLoad/firstPaint: -23%
  • ↓ dappPageLoad/firstContentfulPaint: -23%
Bundle Size Diffs
Status Bundle Total Diff Change
✅ background 15.22 MiB +336 Bytes 0.00%
✅ ui 19.5 MiB +964 Bytes 0.00%
✅ common 0 Bytes 0 Bytes 0.00%
✅ other 4.46 MiB 0 Bytes 0.00%
✅ content scripts 3.22 MiB 0 Bytes 0.00%
🚨 unzipped 79.93 MiB +1.27 KiB 0.00%
✅ zip 24.01 MiB +510 Bytes 0.00%

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@ameliejyc
ameliejyc enabled auto-merge November 11, 2026 17:30
@ameliejyc
ameliejyc added this pull request to the merge queue Nov 11, 2026
Merged via the queue into main with commit e8b9146 Nov 11, 2026
280 of 283 checks passed
@ameliejyc
ameliejyc deleted the track-token-sort-header-metrics branch November 11, 2026 18:47
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 11, 2026
@metamaskbot metamaskbot added the release-13.58.0 Issue or pull request that will be included in release 13.58.0 label Nov 16, 2026
@gauthierpetetin

Copy link
Copy Markdown
Contributor

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.

This branch was previously deployed

1 inactive deployment
pr-comment — 6123ddb5 Deployed Nov 11, 2026 by ameliejyc via Publish prerelease / Publish prerelease #174139
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.58.0 Issue or pull request that will be included in release 13.58.0 size-M team-core-extension-ux Core Extension UX team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants