-
Notifications
You must be signed in to change notification settings - Fork 5.5k
fix: added virtualization to nfts list #38773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✨ Files requiring CODEOWNER review ✨💎 @MetaMask/metamask-assets (1 files, +111 -18)
|
Builds ready [40f721c]
UI Startup Metrics (1291 ± 118 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [caddf96]
UI Startup Metrics (1287 ± 119 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [f3fe616]
UI Startup Metrics (1251 ± 103 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [828c4c5]
UI Startup Metrics (1276 ± 104 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [a4099ab]
UI Startup Metrics (1265 ± 112 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [c41aa56]
UI Startup Metrics (1266 ± 108 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [b18e657]
UI Startup Metrics (1284 ± 103 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [2081b66]
UI Startup Metrics (1341 ± 99 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [da8b645]
UI Startup Metrics (1299 ± 112 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
@Montoya raised the following issue he was experiencing:
Auto detection on mainnet is working, it's just very slow and it fails to replace the content when switching networks so it's basically not possible to view NFTs on different networks, see belowvideo_1280.mp4
After an investigation into the matter I found out we were not virtualizing the list of NFTs which meant that every time the NFTs tab was opened, we were rendering all NFTs at once. For a wallet that has hundreds of NFTs this can be very noticeable. After adding virtualization to the list, no degradation can be seen (Look at the before and after videos)
NOTE: in the benchmarking videos you will see that the initil load time has been reduces by a LOT. In my test we have moved from 20+ seconds load time to 2 second. Since my test had hundreds of NFTs it was taking 20+ seconds but with more NFTs it would have taken even longer
Changelog
CHANGELOG entry: add virtualization to NFTs list
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-2118
Manual testing steps
Screenshots/Recordings
Before
Screen.Recording.2025-12-11.at.15.00.23.mov
before.mov
After
Screen.Recording.2025-12-11.at.14.57.19.mov
after.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Virtualizes the NFT grid using
@tanstack/react-virtual, grouping NFTs into responsive rows and stubbingwindow.matchMediain tests.ui/components/app/assets/nfts/nft-grid/nft-grid.tsxwithuseVirtualizerto render rows of NFTs.window.matchMedia(4 cols > 767px, else 3) anditemsPerRowstate.useScrollContainer) or whennfts.length <= 20.test/helpers/setup-helper.jsto stubwindow.matchMediawithaddEventListenersupport for virtualization.Written by Cursor Bugbot for commit da8b645. This will update automatically on new commits. Configure here.