From 694b49db3f0b249aa6be7b6556d3962a4c15948e Mon Sep 17 00:00:00 2001 From: Francis Nepomuceno Date: Wed, 5 Nov 2025 23:20:11 -0500 Subject: [PATCH 01/21] introducing tanstack virtual --- package.json | 1 + .../assets/asset-list/cells/asset-title.tsx | 2 +- .../app/assets/token-list/token-list.tsx | 45 ++++++++++++++----- ui/contexts/scroll-container.tsx | 23 ++++++++++ ui/pages/home/home.component.js | 5 ++- yarn.lock | 20 +++++++++ 6 files changed, 83 insertions(+), 13 deletions(-) create mode 100644 ui/contexts/scroll-container.tsx diff --git a/package.json b/package.json index a2d68c7be66d..f85c249c1405 100644 --- a/package.json +++ b/package.json @@ -377,6 +377,7 @@ "@sentry/utils": "^8.33.1", "@solana/addresses": "2.0.0-rc.4", "@swc/core": "^1.13.2", + "@tanstack/react-virtual": "^3.10.8", "@trezor/connect-web": "~9.6.0", "@zxing/browser": "^0.1.5", "@zxing/library": "0.21.3", diff --git a/ui/components/app/assets/asset-list/cells/asset-title.tsx b/ui/components/app/assets/asset-list/cells/asset-title.tsx index 534f5bb4a079..9eadb667fa0f 100644 --- a/ui/components/app/assets/asset-list/cells/asset-title.tsx +++ b/ui/components/app/assets/asset-list/cells/asset-title.tsx @@ -19,7 +19,7 @@ type AssetCellTitleProps = { export const AssetCellTitle = ({ title }: AssetCellTitleProps) => { const t = useI18nContext(); - if (title && title.length > 12) { + if (false &&title && title.length > 12) { return ( void; @@ -45,6 +47,7 @@ type TokenListProps = { // TODO: Fix in https://github.com/MetaMask/metamask-extension/issues/31860 // eslint-disable-next-line @typescript-eslint/naming-convention function TokenList({ onTokenClick, safeChains }: TokenListProps) { + const scrollContainerRef = useScrollContainer(); const isEvm = useSelector(getIsEvmMultichainNetworkSelected); const newTokensImported = useSelector(getNewTokensImported); const currentNetwork = useSelector(getSelectedMultichainNetworkConfiguration); @@ -145,6 +148,13 @@ function TokenList({ onTokenClick, safeChains }: TokenListProps) { allEnabledNetworksForAllNamespaces, ]); + const virtualizer = useVirtualizer({ + count: sortedFilteredTokens.length, + getScrollElement: () => scrollContainerRef.current, + estimateSize: () => 62, // TokenCell height from generic-asset-cell-layout.tsx + overscan: 5, + }); + useEffect(() => { if (sortedFilteredTokens) { endTrace({ name: TraceName.AccountOverviewAssetListTab }); @@ -179,24 +189,39 @@ function TokenList({ onTokenClick, safeChains }: TokenListProps) { }); }; + const virtualItems = virtualizer.getVirtualItems(); + return ( - <> - {sortedFilteredTokens.map((token: TokenWithFiatAmount) => { +
+ {virtualItems.map((virtualItem) => { + const token = sortedFilteredTokens[virtualItem.index]; const isNonEvmTestnet = NON_EVM_TESTNET_IDS.includes( token.chainId as CaipChainId, ); return ( - + className="absolute top-0 left-0 w-full" + style={{ + transform: `translateY(${virtualItem.start}px)`, + }} + > + +
); })} - + ); } diff --git a/ui/contexts/scroll-container.tsx b/ui/contexts/scroll-container.tsx new file mode 100644 index 000000000000..3e7d4d4c798d --- /dev/null +++ b/ui/contexts/scroll-container.tsx @@ -0,0 +1,23 @@ +import React, { createContext, useContext, useRef } from 'react'; + +const ScrollContainerContext = + createContext | null>(null); + +export const ScrollContainer = ({ + children, + ...props +}: React.HTMLAttributes) => { + const scrollRef = useRef(null); + + return ( + +
+ {children} +
+
+ ); +}; + +export const useScrollContainer = () => { + return useContext(ScrollContainerContext); +}; diff --git a/ui/pages/home/home.component.js b/ui/pages/home/home.component.js index 6b59c1274b2d..32822af964d8 100644 --- a/ui/pages/home/home.component.js +++ b/ui/pages/home/home.component.js @@ -21,6 +21,7 @@ import ConnectedSites from '../connected-sites'; import ConnectedAccounts from '../connected-accounts'; import { isMv3ButOffscreenDocIsMissing } from '../../../shared/modules/mv3.utils'; import ActionableMessage from '../../components/ui/actionable-message/actionable-message'; +import { ScrollContainer } from '../../contexts/scroll-container'; import { FontWeight, @@ -887,7 +888,7 @@ export default class Home extends PureComponent { !isSocialLoginFlow; return ( -
+ {this.renderNotifications()}
- + ); } } diff --git a/yarn.lock b/yarn.lock index facb46ac59a4..12355b40170f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13630,6 +13630,25 @@ __metadata: languageName: node linkType: hard +"@tanstack/react-virtual@npm:^3.10.8": + version: 3.13.12 + resolution: "@tanstack/react-virtual@npm:3.13.12" + dependencies: + "@tanstack/virtual-core": "npm:3.13.12" + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + checksum: 10/7b64c728ae3666c22f6a1727d464f877c04ae02347480eab482c7a002c2a340167ded856e3dd52b19de34f965aeb01a1e223acdab44d646251c0aa89c3d69539 + languageName: node + linkType: hard + +"@tanstack/virtual-core@npm:3.13.12": + version: 3.13.12 + resolution: "@tanstack/virtual-core@npm:3.13.12" + checksum: 10/5cd2e8689c3f3e911747ef6719f161027f4e9eb0cd572eeaf58452a09c3f23458d2ec0930e328ed5c7955c2fd08b69d71f327f0f7bf25438c98d914779ad4998 + languageName: node + linkType: hard + "@testing-library/dom@npm:^10.4.0": version: 10.4.0 resolution: "@testing-library/dom@npm:10.4.0" @@ -32144,6 +32163,7 @@ __metadata: "@storybook/theming": "npm:^7.6.20" "@swc/core": "npm:^1.13.2" "@swc/helpers": "npm:^0.5.17" + "@tanstack/react-virtual": "npm:^3.10.8" "@testing-library/dom": "npm:^10.4.0" "@testing-library/jest-dom": "npm:^6.6.3" "@testing-library/react": "npm:^12.1.5" From 7a396f87add9084214d36465c83303fce486a0b5 Mon Sep 17 00:00:00 2001 From: Francis Nepomuceno Date: Thu, 6 Nov 2025 11:47:02 -0500 Subject: [PATCH 02/21] lavamoat --- lavamoat/browserify/beta/policy.json | 18 ++++++++++++++++++ lavamoat/browserify/experimental/policy.json | 18 ++++++++++++++++++ lavamoat/browserify/flask/policy.json | 18 ++++++++++++++++++ lavamoat/browserify/main/policy.json | 18 ++++++++++++++++++ 4 files changed, 72 insertions(+) diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index d4af795fc69b..d3ee442f0404 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -2598,6 +2598,24 @@ "browserify>browser-resolve": true } }, + "@tanstack/react-virtual": { + "globals": { + "document": true, + "scrollY": true + }, + "packages": { + "@tanstack/react-virtual>@tanstack/virtual-core": true, + "react": true, + "react-dom": true + } + }, + "@tanstack/react-virtual>@tanstack/virtual-core": { + "globals": { + "console.info": true, + "console.warn": true, + "requestAnimationFrame": true + } + }, "@toruslabs/eccrypto": { "globals": { "crypto": true, diff --git a/lavamoat/browserify/experimental/policy.json b/lavamoat/browserify/experimental/policy.json index d4af795fc69b..d3ee442f0404 100644 --- a/lavamoat/browserify/experimental/policy.json +++ b/lavamoat/browserify/experimental/policy.json @@ -2598,6 +2598,24 @@ "browserify>browser-resolve": true } }, + "@tanstack/react-virtual": { + "globals": { + "document": true, + "scrollY": true + }, + "packages": { + "@tanstack/react-virtual>@tanstack/virtual-core": true, + "react": true, + "react-dom": true + } + }, + "@tanstack/react-virtual>@tanstack/virtual-core": { + "globals": { + "console.info": true, + "console.warn": true, + "requestAnimationFrame": true + } + }, "@toruslabs/eccrypto": { "globals": { "crypto": true, diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index d4af795fc69b..d3ee442f0404 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -2598,6 +2598,24 @@ "browserify>browser-resolve": true } }, + "@tanstack/react-virtual": { + "globals": { + "document": true, + "scrollY": true + }, + "packages": { + "@tanstack/react-virtual>@tanstack/virtual-core": true, + "react": true, + "react-dom": true + } + }, + "@tanstack/react-virtual>@tanstack/virtual-core": { + "globals": { + "console.info": true, + "console.warn": true, + "requestAnimationFrame": true + } + }, "@toruslabs/eccrypto": { "globals": { "crypto": true, diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index d4af795fc69b..d3ee442f0404 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -2598,6 +2598,24 @@ "browserify>browser-resolve": true } }, + "@tanstack/react-virtual": { + "globals": { + "document": true, + "scrollY": true + }, + "packages": { + "@tanstack/react-virtual>@tanstack/virtual-core": true, + "react": true, + "react-dom": true + } + }, + "@tanstack/react-virtual>@tanstack/virtual-core": { + "globals": { + "console.info": true, + "console.warn": true, + "requestAnimationFrame": true + } + }, "@toruslabs/eccrypto": { "globals": { "crypto": true, From 7657d3227212a30b3b96f536c5800b8e935f4499 Mon Sep 17 00:00:00 2001 From: Francis Nepomuceno Date: Thu, 6 Nov 2025 12:03:23 -0500 Subject: [PATCH 03/21] extract constant --- .../assets/asset-list/cells/asset-title.tsx | 23 ------------------- .../cells/generic-asset-cell-layout.tsx | 3 ++- ui/components/app/assets/constants.ts | 2 ++ .../app/assets/token-list/token-list.tsx | 7 +++--- 4 files changed, 8 insertions(+), 27 deletions(-) diff --git a/ui/components/app/assets/asset-list/cells/asset-title.tsx b/ui/components/app/assets/asset-list/cells/asset-title.tsx index 9eadb667fa0f..6a86452ba376 100644 --- a/ui/components/app/assets/asset-list/cells/asset-title.tsx +++ b/ui/components/app/assets/asset-list/cells/asset-title.tsx @@ -1,6 +1,5 @@ import React from 'react'; import { - Display, FontWeight, TextVariant, } from '../../../../../helpers/constants/design-system'; @@ -10,7 +9,6 @@ import { networkTitleOverrides, } from '../../util/networkTitleOverrides'; import { useI18nContext } from '../../../../../hooks/useI18nContext'; -import Tooltip from '../../../../ui/tooltip'; type AssetCellTitleProps = { title: string; @@ -19,27 +17,6 @@ type AssetCellTitleProps = { export const AssetCellTitle = ({ title }: AssetCellTitleProps) => { const t = useI18nContext(); - if (false &&title && title.length > 12) { - return ( - - - {networkTitleOverrides(t as TranslateFunction, { title })} - - - ); - } - // non-ellipsized title return ( void; @@ -54,7 +55,7 @@ export default function GenericAssetCellLayout({ paddingRight={4} width={BlockSize.Full} style={{ - height: 62, + height: ASSET_CELL_HEIGHT, cursor: onClick ? 'pointer' : 'auto', backgroundColor: !disableHover && isHovered diff --git a/ui/components/app/assets/constants.ts b/ui/components/app/assets/constants.ts index 4d9fdef54b24..05bedaf9c878 100644 --- a/ui/components/app/assets/constants.ts +++ b/ui/components/app/assets/constants.ts @@ -9,3 +9,5 @@ export const ACCOUNT_TYPE_LABELS: Partial> = [BtcAccountType.P2wpkh]: 'Native SegWit', [BtcAccountType.P2tr]: 'Taproot', }; + +export const ASSET_CELL_HEIGHT = 62; diff --git a/ui/components/app/assets/token-list/token-list.tsx b/ui/components/app/assets/token-list/token-list.tsx index e202609a16a7..1b1804e82991 100644 --- a/ui/components/app/assets/token-list/token-list.tsx +++ b/ui/components/app/assets/token-list/token-list.tsx @@ -1,9 +1,10 @@ -import React, { useContext, useEffect, useMemo, useRef } from 'react'; +import React, { useContext, useEffect, useMemo } from 'react'; import { useSelector } from 'react-redux'; import { type CaipChainId, type Hex } from '@metamask/utils'; import { NON_EVM_TESTNET_IDS } from '@metamask/multichain-network-controller'; import { useVirtualizer } from '@tanstack/react-virtual'; import TokenCell from '../token-cell'; +import { ASSET_CELL_HEIGHT } from '../constants'; import { getEnabledNetworksByNamespace, getIsMultichainAccountsState2Enabled, @@ -150,8 +151,8 @@ function TokenList({ onTokenClick, safeChains }: TokenListProps) { const virtualizer = useVirtualizer({ count: sortedFilteredTokens.length, - getScrollElement: () => scrollContainerRef.current, - estimateSize: () => 62, // TokenCell height from generic-asset-cell-layout.tsx + getScrollElement: () => scrollContainerRef?.current || null, + estimateSize: () => ASSET_CELL_HEIGHT, overscan: 5, }); From 55673e8f596930a071338f1440f2748712cf71fb Mon Sep 17 00:00:00 2001 From: Francis Nepomuceno Date: Thu, 6 Nov 2025 12:10:24 -0500 Subject: [PATCH 04/21] annotate --- ui/contexts/scroll-container.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ui/contexts/scroll-container.tsx b/ui/contexts/scroll-container.tsx index 3e7d4d4c798d..22a8cdd42181 100644 --- a/ui/contexts/scroll-container.tsx +++ b/ui/contexts/scroll-container.tsx @@ -3,6 +3,12 @@ import React, { createContext, useContext, useRef } from 'react'; const ScrollContainerContext = createContext | null>(null); +/** + * Provides a ref to this container element for its child components + * + * @param props - HTML div attributes + * @returns A div element with a ref accessible via useScrollContainer + */ export const ScrollContainer = ({ children, ...props @@ -18,6 +24,11 @@ export const ScrollContainer = ({ ); }; +/** + * Hook to access the scroll container ref from any child component + * + * @returns Ref to the scroll container + */ export const useScrollContainer = () => { return useContext(ScrollContainerContext); }; From e0d6c20f297d69d1ba7d81b358c376c14510c31f Mon Sep 17 00:00:00 2001 From: Francis Nepomuceno Date: Thu, 6 Nov 2025 12:23:22 -0500 Subject: [PATCH 05/21] lavamoat 2 --- lavamoat/webpack/policy.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lavamoat/webpack/policy.json b/lavamoat/webpack/policy.json index b6252c5bd384..c535327c6697 100644 --- a/lavamoat/webpack/policy.json +++ b/lavamoat/webpack/policy.json @@ -2684,6 +2684,24 @@ "@metamask/profile-sync-controller>siwe>@stablelib/random>@stablelib/wipe": true } }, + "@tanstack/react-virtual": { + "globals": { + "document": true, + "scrollY": true + }, + "packages": { + "@tanstack/react-virtual>@tanstack/virtual-core": true, + "react": true, + "react-dom": true + } + }, + "@tanstack/react-virtual>@tanstack/virtual-core": { + "globals": { + "console.info": true, + "console.warn": true, + "requestAnimationFrame": true + } + }, "@toruslabs/eccrypto": { "globals": { "Buffer.alloc": true, From 62c5367fcdf5cc80e5a8a580f22433de7dd9d9d3 Mon Sep 17 00:00:00 2001 From: Francis Nepomuceno Date: Thu, 6 Nov 2025 12:24:29 -0500 Subject: [PATCH 06/21] lint --- ui/contexts/scroll-container.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/contexts/scroll-container.tsx b/ui/contexts/scroll-container.tsx index 22a8cdd42181..139e49aa285c 100644 --- a/ui/contexts/scroll-container.tsx +++ b/ui/contexts/scroll-container.tsx @@ -7,6 +7,7 @@ const ScrollContainerContext = * Provides a ref to this container element for its child components * * @param props - HTML div attributes + * @param props.children - Child components to render inside the container * @returns A div element with a ref accessible via useScrollContainer */ export const ScrollContainer = ({ From 67ae764139e4b2119bfd75adce6bf728655696de Mon Sep 17 00:00:00 2001 From: Francis Nepomuceno Date: Thu, 6 Nov 2025 13:21:28 -0500 Subject: [PATCH 07/21] lavamoat 3 --- lavamoat/browserify/beta/policy.json | 1 + lavamoat/browserify/experimental/policy.json | 1 + lavamoat/browserify/flask/policy.json | 1 + lavamoat/browserify/main/policy.json | 1 + lavamoat/browserify/policy-override.json | 5 +++++ 5 files changed, 9 insertions(+) diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index d3ee442f0404..6ee91db8659f 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -2611,6 +2611,7 @@ }, "@tanstack/react-virtual>@tanstack/virtual-core": { "globals": { + "ResizeObserver": true, "console.info": true, "console.warn": true, "requestAnimationFrame": true diff --git a/lavamoat/browserify/experimental/policy.json b/lavamoat/browserify/experimental/policy.json index d3ee442f0404..6ee91db8659f 100644 --- a/lavamoat/browserify/experimental/policy.json +++ b/lavamoat/browserify/experimental/policy.json @@ -2611,6 +2611,7 @@ }, "@tanstack/react-virtual>@tanstack/virtual-core": { "globals": { + "ResizeObserver": true, "console.info": true, "console.warn": true, "requestAnimationFrame": true diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index d3ee442f0404..6ee91db8659f 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -2611,6 +2611,7 @@ }, "@tanstack/react-virtual>@tanstack/virtual-core": { "globals": { + "ResizeObserver": true, "console.info": true, "console.warn": true, "requestAnimationFrame": true diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index d3ee442f0404..6ee91db8659f 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -2611,6 +2611,7 @@ }, "@tanstack/react-virtual>@tanstack/virtual-core": { "globals": { + "ResizeObserver": true, "console.info": true, "console.warn": true, "requestAnimationFrame": true diff --git a/lavamoat/browserify/policy-override.json b/lavamoat/browserify/policy-override.json index 60065c8ad1a8..4cf99f952979 100644 --- a/lavamoat/browserify/policy-override.json +++ b/lavamoat/browserify/policy-override.json @@ -103,6 +103,11 @@ "innerWidth": false, "matchMedia": false } + }, + "@tanstack/react-virtual>@tanstack/virtual-core": { + "globals": { + "ResizeObserver": true + } } } } From 446b78c5e2fee37c1304ab175e2e587b62e9958b Mon Sep 17 00:00:00 2001 From: Francis Nepomuceno Date: Thu, 6 Nov 2025 14:05:44 -0500 Subject: [PATCH 08/21] lavamoat 5 --- lavamoat/browserify/beta/policy.json | 1 + lavamoat/browserify/experimental/policy.json | 1 + lavamoat/browserify/flask/policy.json | 1 + lavamoat/browserify/main/policy.json | 1 + lavamoat/browserify/policy-override.json | 5 +++++ lavamoat/webpack/policy.json | 4 +++- 6 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 6ee91db8659f..0d290260001a 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -2600,6 +2600,7 @@ }, "@tanstack/react-virtual": { "globals": { + "ResizeObserver": true, "document": true, "scrollY": true }, diff --git a/lavamoat/browserify/experimental/policy.json b/lavamoat/browserify/experimental/policy.json index 6ee91db8659f..0d290260001a 100644 --- a/lavamoat/browserify/experimental/policy.json +++ b/lavamoat/browserify/experimental/policy.json @@ -2600,6 +2600,7 @@ }, "@tanstack/react-virtual": { "globals": { + "ResizeObserver": true, "document": true, "scrollY": true }, diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 6ee91db8659f..0d290260001a 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -2600,6 +2600,7 @@ }, "@tanstack/react-virtual": { "globals": { + "ResizeObserver": true, "document": true, "scrollY": true }, diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index 6ee91db8659f..0d290260001a 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -2600,6 +2600,7 @@ }, "@tanstack/react-virtual": { "globals": { + "ResizeObserver": true, "document": true, "scrollY": true }, diff --git a/lavamoat/browserify/policy-override.json b/lavamoat/browserify/policy-override.json index 4cf99f952979..cb2ff693e0fd 100644 --- a/lavamoat/browserify/policy-override.json +++ b/lavamoat/browserify/policy-override.json @@ -104,6 +104,11 @@ "matchMedia": false } }, + "@tanstack/react-virtual": { + "globals": { + "ResizeObserver": true + } + }, "@tanstack/react-virtual>@tanstack/virtual-core": { "globals": { "ResizeObserver": true diff --git a/lavamoat/webpack/policy.json b/lavamoat/webpack/policy.json index c535327c6697..f55f16e094d1 100644 --- a/lavamoat/webpack/policy.json +++ b/lavamoat/webpack/policy.json @@ -2686,6 +2686,7 @@ }, "@tanstack/react-virtual": { "globals": { + "ResizeObserver": true, "document": true, "scrollY": true }, @@ -2697,6 +2698,7 @@ }, "@tanstack/react-virtual>@tanstack/virtual-core": { "globals": { + "ResizeObserver": true, "console.info": true, "console.warn": true, "requestAnimationFrame": true @@ -6015,4 +6017,4 @@ } } } -} \ No newline at end of file +} From 4cc29cfeddb0423296ce758d0d08acc0c21020e4 Mon Sep 17 00:00:00 2001 From: Francis Nepomuceno Date: Thu, 6 Nov 2025 14:22:14 -0500 Subject: [PATCH 09/21] lavamoat 6 --- lavamoat/webpack/policy-override.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lavamoat/webpack/policy-override.json b/lavamoat/webpack/policy-override.json index 54ff1a23051d..fec7b5a706e1 100644 --- a/lavamoat/webpack/policy-override.json +++ b/lavamoat/webpack/policy-override.json @@ -242,6 +242,16 @@ "innerWidth": false, "matchMedia": false } + }, + "@tanstack/react-virtual": { + "globals": { + "ResizeObserver": true + } + }, + "@tanstack/react-virtual>@tanstack/virtual-core": { + "globals": { + "ResizeObserver": true + } } } } From 7db0573d16a5ade9a57a8bfed7a7aedcd1a7ddd7 Mon Sep 17 00:00:00 2001 From: Francis Nepomuceno Date: Thu, 6 Nov 2025 14:38:18 -0500 Subject: [PATCH 10/21] lavamoat 7 --- lavamoat/webpack/policy.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/lavamoat/webpack/policy.json b/lavamoat/webpack/policy.json index f55f16e094d1..e1081512344b 100644 --- a/lavamoat/webpack/policy.json +++ b/lavamoat/webpack/policy.json @@ -2686,7 +2686,6 @@ }, "@tanstack/react-virtual": { "globals": { - "ResizeObserver": true, "document": true, "scrollY": true }, @@ -2698,7 +2697,6 @@ }, "@tanstack/react-virtual>@tanstack/virtual-core": { "globals": { - "ResizeObserver": true, "console.info": true, "console.warn": true, "requestAnimationFrame": true From b14e98cb1857aff4304b92cfd1b4d750a27227ad Mon Sep 17 00:00:00 2001 From: Francis Nepomuceno Date: Thu, 6 Nov 2025 15:12:22 -0500 Subject: [PATCH 11/21] lavamoat 8 --- development/build/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/development/build/index.js b/development/build/index.js index 82597623f21b..620e6e969a99 100755 --- a/development/build/index.js +++ b/development/build/index.js @@ -154,6 +154,8 @@ async function defineAndRunBuildTasks() { 'opr', // for @popperjs/core and snap simple keyring site 'devicePixelRatio', + // for @tanstack/react-virtual + 'ResizeObserver', ]; if ( From 1bde564711184d23271ff04fc78801f920b97d4f Mon Sep 17 00:00:00 2001 From: MetaMask Bot Date: Thu, 6 Nov 2025 20:18:08 +0000 Subject: [PATCH 12/21] Update LavaMoat policies --- lavamoat/webpack/policy.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lavamoat/webpack/policy.json b/lavamoat/webpack/policy.json index e1081512344b..c535327c6697 100644 --- a/lavamoat/webpack/policy.json +++ b/lavamoat/webpack/policy.json @@ -6015,4 +6015,4 @@ } } } -} +} \ No newline at end of file From a6a13fec1d02563d393212a67bde0cdac576faef Mon Sep 17 00:00:00 2001 From: Francis Nepomuceno Date: Thu, 6 Nov 2025 15:57:35 -0500 Subject: [PATCH 13/21] lavamoat 9 --- development/build/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/development/build/index.js b/development/build/index.js index 620e6e969a99..144ce25137de 100755 --- a/development/build/index.js +++ b/development/build/index.js @@ -156,6 +156,7 @@ async function defineAndRunBuildTasks() { 'devicePixelRatio', // for @tanstack/react-virtual 'ResizeObserver', + 'clearTimeout', ]; if ( From f81e585a60a55e744eb8ef33c0651f7eef9ad8da Mon Sep 17 00:00:00 2001 From: Francis Nepomuceno Date: Thu, 6 Nov 2025 16:30:51 -0500 Subject: [PATCH 14/21] lavamoat 10 --- development/build/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/development/build/index.js b/development/build/index.js index 144ce25137de..86fbcc721e50 100755 --- a/development/build/index.js +++ b/development/build/index.js @@ -156,6 +156,7 @@ async function defineAndRunBuildTasks() { 'devicePixelRatio', // for @tanstack/react-virtual 'ResizeObserver', + 'setTimeout', 'clearTimeout', ]; From d9986ec3c75bf77390da0740e008b2e5edb4fa13 Mon Sep 17 00:00:00 2001 From: Francis Nepomuceno Date: Thu, 6 Nov 2025 22:51:01 -0500 Subject: [PATCH 15/21] lavamoat 11 --- lavamoat/webpack/policy.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lavamoat/webpack/policy.json b/lavamoat/webpack/policy.json index c535327c6697..e423fe97342b 100644 --- a/lavamoat/webpack/policy.json +++ b/lavamoat/webpack/policy.json @@ -2686,6 +2686,7 @@ }, "@tanstack/react-virtual": { "globals": { + "ResizeObserver": true, "document": true, "scrollY": true }, @@ -2697,6 +2698,7 @@ }, "@tanstack/react-virtual>@tanstack/virtual-core": { "globals": { + "ResizeObserver": true, "console.info": true, "console.warn": true, "requestAnimationFrame": true From 58a9e1a443e473fc1be093813ed429527f1a400a Mon Sep 17 00:00:00 2001 From: Francis Nepomuceno Date: Thu, 6 Nov 2025 23:10:18 -0500 Subject: [PATCH 16/21] lavamoat 12 --- lavamoat/webpack/policy-override.json | 10 ---------- lavamoat/webpack/policy.json | 4 +--- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/lavamoat/webpack/policy-override.json b/lavamoat/webpack/policy-override.json index fec7b5a706e1..54ff1a23051d 100644 --- a/lavamoat/webpack/policy-override.json +++ b/lavamoat/webpack/policy-override.json @@ -242,16 +242,6 @@ "innerWidth": false, "matchMedia": false } - }, - "@tanstack/react-virtual": { - "globals": { - "ResizeObserver": true - } - }, - "@tanstack/react-virtual>@tanstack/virtual-core": { - "globals": { - "ResizeObserver": true - } } } } diff --git a/lavamoat/webpack/policy.json b/lavamoat/webpack/policy.json index e423fe97342b..e1081512344b 100644 --- a/lavamoat/webpack/policy.json +++ b/lavamoat/webpack/policy.json @@ -2686,7 +2686,6 @@ }, "@tanstack/react-virtual": { "globals": { - "ResizeObserver": true, "document": true, "scrollY": true }, @@ -2698,7 +2697,6 @@ }, "@tanstack/react-virtual>@tanstack/virtual-core": { "globals": { - "ResizeObserver": true, "console.info": true, "console.warn": true, "requestAnimationFrame": true @@ -6017,4 +6015,4 @@ } } } -} \ No newline at end of file +} From f7e0fc8f4100e9f0a2ee07398d79d38497093c5b Mon Sep 17 00:00:00 2001 From: Francis Nepomuceno Date: Thu, 6 Nov 2025 23:23:23 -0500 Subject: [PATCH 17/21] lavamoat 13 --- lavamoat/webpack/policy.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lavamoat/webpack/policy.json b/lavamoat/webpack/policy.json index e1081512344b..c535327c6697 100644 --- a/lavamoat/webpack/policy.json +++ b/lavamoat/webpack/policy.json @@ -6015,4 +6015,4 @@ } } } -} +} \ No newline at end of file From c994326867da6fc1fd0bf1b8bea561e0ed91ed2a Mon Sep 17 00:00:00 2001 From: Francis Nepomuceno Date: Thu, 6 Nov 2025 23:44:15 -0500 Subject: [PATCH 18/21] test --- .../defi-details-page.test.tsx.snap | 23 ++++--------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/ui/pages/defi/components/__snapshots__/defi-details-page.test.tsx.snap b/ui/pages/defi/components/__snapshots__/defi-details-page.test.tsx.snap index e73e4de78911..0961a2b0cec5 100644 --- a/ui/pages/defi/components/__snapshots__/defi-details-page.test.tsx.snap +++ b/ui/pages/defi/components/__snapshots__/defi-details-page.test.tsx.snap @@ -134,25 +134,12 @@ exports[`DeFiDetailsPage renders defi asset page 1`] = `
-
-
- - Liquid staked Ether 2.0 - -
-
+ Liquid staked Ether 2.0 +

Date: Fri, 7 Nov 2025 08:43:35 -0500 Subject: [PATCH 19/21] update selector --- test/e2e/page-objects/pages/home/asset-list.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/page-objects/pages/home/asset-list.ts b/test/e2e/page-objects/pages/home/asset-list.ts index 86f4e8c42b61..dcece404b661 100644 --- a/test/e2e/page-objects/pages/home/asset-list.ts +++ b/test/e2e/page-objects/pages/home/asset-list.ts @@ -514,7 +514,7 @@ class AssetListPage { `Check that token amount ${tokenAmount} is displayed in token details modal for token ${tokenName}`, ); await this.driver.clickElement({ - tag: 'span', + testId: 'multichain-token-list-item-token-name', text: tokenName, }); await this.driver.waitForSelector({ From c9dfa113d8e3f6123b907c56a0d82394c6012b52 Mon Sep 17 00:00:00 2001 From: Francis Nepomuceno Date: Fri, 7 Nov 2025 08:44:48 -0500 Subject: [PATCH 20/21] lavamoat 14 --- development/webpack/utils/plugins/LavamoatPlugin/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/development/webpack/utils/plugins/LavamoatPlugin/index.ts b/development/webpack/utils/plugins/LavamoatPlugin/index.ts index 0b2bf7373e20..02d49e9e67e6 100644 --- a/development/webpack/utils/plugins/LavamoatPlugin/index.ts +++ b/development/webpack/utils/plugins/LavamoatPlugin/index.ts @@ -115,6 +115,7 @@ export const lavamoatPlugin = (args: Args) => 'Date', 'setTimeout', 'clearTimeout', + 'ResizeObserver', // globals sentry needs to function '__SENTRY__', 'appState', From c6411c370d79053ed15d04f9485e0c2920eb8328 Mon Sep 17 00:00:00 2001 From: Francis Nepomuceno Date: Fri, 7 Nov 2025 10:06:03 -0500 Subject: [PATCH 21/21] lavamoat 15 --- lavamoat/browserify/beta/policy.json | 2 -- lavamoat/browserify/experimental/policy.json | 2 -- lavamoat/browserify/flask/policy.json | 2 -- lavamoat/browserify/main/policy.json | 2 -- lavamoat/browserify/policy-override.json | 10 ---------- 5 files changed, 18 deletions(-) diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 0d290260001a..d3ee442f0404 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -2600,7 +2600,6 @@ }, "@tanstack/react-virtual": { "globals": { - "ResizeObserver": true, "document": true, "scrollY": true }, @@ -2612,7 +2611,6 @@ }, "@tanstack/react-virtual>@tanstack/virtual-core": { "globals": { - "ResizeObserver": true, "console.info": true, "console.warn": true, "requestAnimationFrame": true diff --git a/lavamoat/browserify/experimental/policy.json b/lavamoat/browserify/experimental/policy.json index 0d290260001a..d3ee442f0404 100644 --- a/lavamoat/browserify/experimental/policy.json +++ b/lavamoat/browserify/experimental/policy.json @@ -2600,7 +2600,6 @@ }, "@tanstack/react-virtual": { "globals": { - "ResizeObserver": true, "document": true, "scrollY": true }, @@ -2612,7 +2611,6 @@ }, "@tanstack/react-virtual>@tanstack/virtual-core": { "globals": { - "ResizeObserver": true, "console.info": true, "console.warn": true, "requestAnimationFrame": true diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 0d290260001a..d3ee442f0404 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -2600,7 +2600,6 @@ }, "@tanstack/react-virtual": { "globals": { - "ResizeObserver": true, "document": true, "scrollY": true }, @@ -2612,7 +2611,6 @@ }, "@tanstack/react-virtual>@tanstack/virtual-core": { "globals": { - "ResizeObserver": true, "console.info": true, "console.warn": true, "requestAnimationFrame": true diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index 0d290260001a..d3ee442f0404 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -2600,7 +2600,6 @@ }, "@tanstack/react-virtual": { "globals": { - "ResizeObserver": true, "document": true, "scrollY": true }, @@ -2612,7 +2611,6 @@ }, "@tanstack/react-virtual>@tanstack/virtual-core": { "globals": { - "ResizeObserver": true, "console.info": true, "console.warn": true, "requestAnimationFrame": true diff --git a/lavamoat/browserify/policy-override.json b/lavamoat/browserify/policy-override.json index cb2ff693e0fd..60065c8ad1a8 100644 --- a/lavamoat/browserify/policy-override.json +++ b/lavamoat/browserify/policy-override.json @@ -103,16 +103,6 @@ "innerWidth": false, "matchMedia": false } - }, - "@tanstack/react-virtual": { - "globals": { - "ResizeObserver": true - } - }, - "@tanstack/react-virtual>@tanstack/virtual-core": { - "globals": { - "ResizeObserver": true - } } } }