From 51a7654a393c840ba7905aa185a1dff9ce321739 Mon Sep 17 00:00:00 2001 From: Alexander Brown Date: Thu, 8 Jan 2026 19:05:55 -0800 Subject: [PATCH] perf(AssetBrowserModal): virtualize asset grid to reduce network requests (#7919) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Problem The `AssetBrowserModal` triggers hundreds of network requests when opened because `AssetGrid.vue` renders all asset cards immediately using a simple `v-for` loop. Each `AssetCard` loads its thumbnail image, causing a flood of simultaneous requests. ## Solution Replace the simple `v-for` with the existing `VirtualGrid` component (already used in `AssetsSidebarTab.vue` and `ManagerDialogContent.vue`) to only render visible items plus a small buffer. ## Changes - **`AssetGrid.vue`**: Use `VirtualGrid` with computed `assetsWithKey` that adds the required `key` property from `asset.id` - **`BaseModalLayout.vue`**: Add `flex-1` to content container for proper height calculation (required for `VirtualGrid` to work) ## Testing - All 130 asset-related tests pass - TypeScript and lint checks pass ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7919-perf-AssetBrowserModal-virtualize-asset-grid-to-reduce-network-requests-2e36d73d365081a1be18d0eb33b7ef8a) by [Unito](https://www.unito.io) Co-authored-by: Amp --- .../widget/layout/BaseModalLayout.vue | 2 +- src/platform/assets/components/AssetGrid.vue | 55 ++++++++++++------- 2 files changed, 35 insertions(+), 22 deletions(-) diff --git a/src/components/widget/layout/BaseModalLayout.vue b/src/components/widget/layout/BaseModalLayout.vue index 5af214e0ef..325ca0ac63 100644 --- a/src/components/widget/layout/BaseModalLayout.vue +++ b/src/components/widget/layout/BaseModalLayout.vue @@ -82,7 +82,7 @@ {{ contentTitle }}
diff --git a/src/platform/assets/components/AssetGrid.vue b/src/platform/assets/components/AssetGrid.vue index 47fcc1fcdc..1380033935 100644 --- a/src/platform/assets/components/AssetGrid.vue +++ b/src/platform/assets/components/AssetGrid.vue @@ -1,28 +1,21 @@