metamask-extension
metamask-extension copied to clipboard
fix: update useHistoricalPrices getShouldShowFiat selector
Description
Changelog
CHANGELOG entry: show token charts when adding new network
Related issues
Fixes: #38298
Manual testing steps
See issue repro steps.
Screenshots/Recordings
Before
After
Pre-merge author checklist
- [x] I've followed MetaMask Contributor Docs and MetaMask Extension Coding Standards.
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using JSDoc format if applicable
- [x] I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
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] Update useHistoricalPrices to pass a hex chainId to getShouldShowFiat by converting CAIP IDs when needed.
- UI Hooks (
ui/pages/asset/hooks/useHistoricalPrices.ts):
- Selector update: Call
getShouldShowFiat(state, hexChainId)instead of a global selector.- Chain ID handling: Add
toHexChainIdhelper and importconvertCaipToHexChainIdto convert CAIP chain IDs to hex before selector use.Written by Cursor Bugbot for commit 9f8fffec0d348d5fa4d32d99752f3b0be003a2d8. This will update automatically on new commits. Configure here.
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.
Builds ready [9f8fffe]
- builds: chrome, firefox
- builds (beta): chrome, firefox
- builds (flask): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- bundle size: Bundle Size Stats
- user-actions-benchmark: User Actions Stats
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
UI Startup Metrics (1268 ± 121 ms)
| Platform | BuildType | Page | Metric | Mean (ms) | Min (ms) | Max (ms) | Std Dev (ms) | P 75 (ms) | P 95 (ms) |
|---|---|---|---|---|---|---|---|---|---|
| Chrome | Browserify | Standard Home | uiStartup | 1268 | 1023 | 1596 | 121 | 1339 | 1449 |
| load | 1040 | 857 | 1359 | 105 | 1114 | 1231 | |||
| domContentLoaded | 1033 | 851 | 1351 | 105 | 1108 | 1224 | |||
| domInteractive | 26 | 16 | 109 | 19 | 22 | 80 | |||
| firstPaint | 522 | 89 | 1373 | 407 | 1014 | 1183 | |||
| backgroundConnect | 213 | 193 | 261 | 13 | 218 | 239 | |||
| firstReactRender | 45 | 30 | 109 | 15 | 47 | 80 | |||
| getState | 37 | 17 | 123 | 20 | 39 | 92 | |||
| initialActions | 1 | 0 | 4 | 1 | 1 | 2 | |||
| loadScripts | 828 | 653 | 1124 | 100 | 894 | 1015 | |||
| setupStore | 11 | 7 | 27 | 4 | 12 | 19 | |||
| numNetworkReqs | 13 | 6 | 83 | 20 | 6 | 73 | |||
| Browserify | Power User Home | uiStartup | 1884 | 1392 | 2820 | 185 | 1972 | 2200 | |
| load | 1050 | 868 | 1713 | 139 | 1133 | 1309 | |||
| domContentLoaded | 1040 | 860 | 1704 | 138 | 1126 | 1297 | |||
| domInteractive | 30 | 17 | 137 | 25 | 25 | 98 | |||
| firstPaint | 636 | 112 | 1403 | 399 | 1013 | 1223 | |||
| backgroundConnect | 255 | 187 | 809 | 119 | 229 | 566 | |||
| firstReactRender | 50 | 38 | 93 | 9 | 54 | 69 | |||
| getState | 204 | 150 | 697 | 59 | 221 | 279 | |||
| initialActions | 1 | 0 | 3 | 1 | 1 | 2 | |||
| loadScripts | 839 | 670 | 1462 | 134 | 921 | 1090 | |||
| setupStore | 16 | 7 | 221 | 22 | 13 | 37 | |||
| numNetworkReqs | 71 | 58 | 146 | 21 | 67 | 135 | |||
| Webpack | Standard Home | uiStartup | 811 | 671 | 990 | 75 | 876 | 934 | |
| load | 653 | 571 | 842 | 75 | 689 | 815 | |||
| domContentLoaded | 647 | 566 | 836 | 74 | 685 | 810 | |||
| domInteractive | 25 | 16 | 110 | 19 | 22 | 78 | |||
| firstPaint | 215 | 82 | 774 | 150 | 205 | 690 | |||
| backgroundConnect | 13 | 6 | 223 | 22 | 13 | 27 | |||
| firstReactRender | 50 | 31 | 178 | 28 | 53 | 121 | |||
| getState | 28 | 14 | 132 | 16 | 36 | 48 | |||
| initialActions | 1 | 0 | 4 | 1 | 1 | 2 | |||
| loadScripts | 644 | 561 | 834 | 74 | 683 | 806 | |||
| setupStore | 11 | 5 | 31 | 5 | 12 | 21 | |||
| numNetworkReqs | 13 | 6 | 83 | 19 | 6 | 68 | |||
| Webpack | Power User Home | uiStartup | 1423 | 1113 | 1777 | 178 | 1577 | 1747 | |
| load | 737 | 588 | 968 | 99 | 809 | 919 | |||
| domContentLoaded | 729 | 583 | 957 | 98 | 799 | 910 | |||
| domInteractive | 33 | 18 | 166 | 28 | 28 | 109 | |||
| firstPaint | 366 | 88 | 942 | 257 | 643 | 892 | |||
| backgroundConnect | 90 | 8 | 616 | 142 | 113 | 586 | |||
| firstReactRender | 53 | 41 | 71 | 6 | 56 | 65 | |||
| getState | 201 | 150 | 371 | 42 | 209 | 327 | |||
| initialActions | 1 | 0 | 2 | 0 | 1 | 2 | |||
| loadScripts | 726 | 580 | 954 | 97 | 796 | 903 | |||
| setupStore | 15 | 9 | 41 | 8 | 14 | 37 | |||
| numNetworkReqs | 71 | 56 | 223 | 26 | 67 | 137 | |||
| Firefox | Browserify | Standard Home | uiStartup | 1453 | 1158 | 2444 | 219 | 1525 | 1952 |
| load | 1156 | 957 | 2186 | 163 | 1202 | 1315 | |||
| domContentLoaded | 1155 | 957 | 2186 | 163 | 1202 | 1315 | |||
| domInteractive | 84 | 34 | 1087 | 107 | 95 | 147 | |||
| firstPaint | - | - | - | - | - | - | |||
| backgroundConnect | 60 | 20 | 238 | 47 | 82 | 186 | |||
| firstReactRender | 42 | 32 | 73 | 8 | 46 | 60 | |||
| getState | 15 | 7 | 105 | 14 | 14 | 31 | |||
| initialActions | 1 | 0 | 3 | 1 | 2 | 2 | |||
| loadScripts | 1123 | 942 | 2119 | 157 | 1175 | 1284 | |||
| setupStore | 17 | 5 | 223 | 28 | 12 | 49 | |||
| numNetworkReqs | 15 | 6 | 79 | 20 | 9 | 75 | |||
| Browserify | Power User Home | uiStartup | 2630 | 1576 | 3908 | 570 | 3040 | 3566 | |
| load | 1580 | 959 | 2655 | 501 | 2041 | 2480 | |||
| domContentLoaded | 1579 | 959 | 2655 | 501 | 2041 | 2479 | |||
| domInteractive | 89 | 28 | 964 | 110 | 85 | 283 | |||
| firstPaint | - | - | - | - | - | - | |||
| backgroundConnect | 188 | 28 | 1319 | 246 | 194 | 972 | |||
| firstReactRender | 57 | 40 | 103 | 13 | 61 | 86 | |||
| getState | 133 | 73 | 408 | 45 | 157 | 199 | |||
| initialActions | 2 | 0 | 33 | 3 | 3 | 7 | |||
| loadScripts | 1497 | 944 | 2512 | 465 | 1912 | 2317 | |||
| setupStore | 63 | 5 | 1039 | 149 | 61 | 232 | |||
| numNetworkReqs | 75 | 57 | 135 | 22 | 73 | 127 | |||
| Webpack | Standard Home | uiStartup | 1675 | 1365 | 4881 | 379 | 1745 | 2020 | |
| load | 1361 | 1150 | 2536 | 161 | 1401 | 1583 | |||
| domContentLoaded | 1361 | 1150 | 2536 | 161 | 1401 | 1582 | |||
| domInteractive | 96 | 28 | 1348 | 132 | 115 | 149 | |||
| firstPaint | - | - | - | - | - | - | |||
| backgroundConnect | 61 | 23 | 257 | 43 | 63 | 161 | |||
| firstReactRender | 74 | 36 | 2939 | 288 | 48 | 58 | |||
| getState | 17 | 8 | 149 | 21 | 15 | 61 | |||
| initialActions | 1 | 0 | 3 | 0 | 2 | 2 | |||
| loadScripts | 1330 | 1135 | 2512 | 158 | 1371 | 1555 | |||
| setupStore | 16 | 6 | 113 | 17 | 15 | 58 | |||
| numNetworkReqs | 15 | 6 | 79 | 21 | 8 | 76 | |||
| Webpack | Power User Home | uiStartup | 2729 | 1799 | 4546 | 587 | 3155 | 3739 | |
| load | 1844 | 1151 | 3489 | 514 | 2321 | 2538 | |||
| domContentLoaded | 1844 | 1151 | 3488 | 514 | 2321 | 2537 | |||
| domInteractive | 204 | 32 | 1179 | 320 | 122 | 1002 | |||
| firstPaint | - | - | - | - | - | - | |||
| backgroundConnect | 143 | 26 | 1100 | 175 | 188 | 294 | |||
| firstReactRender | 57 | 38 | 97 | 10 | 63 | 74 | |||
| getState | 145 | 80 | 319 | 53 | 181 | 240 | |||
| initialActions | 3 | 0 | 49 | 6 | 2 | 8 | |||
| loadScripts | 1769 | 1133 | 2668 | 466 | 2238 | 2471 | |||
| setupStore | 76 | 6 | 1097 | 168 | 60 | 354 | |||
| numNetworkReqs | 75 | 55 | 135 | 24 | 67 | 126 |
📊 Page Load Benchmark Results
Current Commit: 9f8fffe | Date: 12/10/2025
📄 Localhost MetaMask Test Dapp
Samples: 100
Summary
- pageLoadTime-> current mean value: 1.03s (±44ms) 🟡 | historical mean value: 1.03s ⬆️ (historical data)
- domContentLoaded-> current mean value: 719ms (±36ms) 🟢 | historical mean value: 717ms ⬆️ (historical data)
- firstContentfulPaint-> current mean value: 77ms (±12ms) 🟢 | historical mean value: 77ms ⬇️ (historical data)
📈 Detailed Results
| Metric | Mean | Std Dev | Min | Max | P95 | P99 |
|---|---|---|---|---|---|---|
| pageLoadTime | 1.03s | 44ms | 1.01s | 1.33s | 1.07s | 1.33s |
| domContentLoaded | 719ms | 36ms | 699ms | 997ms | 742ms | 997ms |
| firstPaint | 77ms | 12ms | 60ms | 180ms | 84ms | 180ms |
| firstContentfulPaint | 77ms | 12ms | 60ms | 180ms | 84ms | 180ms |
| largestContentfulPaint | 0ms | 0ms | 0ms | 0ms | 0ms | 0ms |
Bundle size diffs [🚀 Bundle size reduced!]
- background: 58 Bytes (0%)
- ui: 344 Bytes (0%)
- common: -68 Bytes (0%)