perf(AssetBrowserModal): virtualize asset grid to reduce network requests#7919
perf(AssetBrowserModal): virtualize asset grid to reduce network requests#7919
Conversation
📝 WalkthroughWalkthroughBaseModalLayout.vue: content container gains Changes
Possibly related PRs
📜 Recent review detailsConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (9)src/**/*.vue📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
src/**/*.{vue,ts}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
src/**/*.{ts,tsx,vue}📄 CodeRabbit inference engine (src/CLAUDE.md)
Files:
src/**/{composables,components}/**/*.{ts,tsx,vue}📄 CodeRabbit inference engine (src/CLAUDE.md)
Files:
src/**/*.{vue,ts,tsx}📄 CodeRabbit inference engine (src/CLAUDE.md)
Files:
src/**/{components,composables}/**/*.{ts,tsx,vue}📄 CodeRabbit inference engine (src/CLAUDE.md)
Files:
src/components/**/*.vue📄 CodeRabbit inference engine (src/components/CLAUDE.md)
Files:
src/components/**/*.{vue,css}📄 CodeRabbit inference engine (src/components/CLAUDE.md)
Files:
src/components/**/*.{vue,ts,js}📄 CodeRabbit inference engine (src/components/CLAUDE.md)
Files:
🧠 Learnings (12)📓 Common learnings📚 Learning: 2025-12-09T03:49:52.828ZApplied to files:
📚 Learning: 2025-12-09T21:40:12.361ZApplied to files:
📚 Learning: 2025-12-16T22:26:49.463ZApplied to files:
📚 Learning: 2025-12-22T21:36:08.369ZApplied to files:
📚 Learning: 2026-01-08T02:26:18.357ZApplied to files:
📚 Learning: 2025-12-11T12:25:15.470ZApplied to files:
📚 Learning: 2025-12-18T02:07:38.870ZApplied to files:
📚 Learning: 2025-12-18T21:15:46.862ZApplied to files:
📚 Learning: 2025-12-21T01:06:02.786ZApplied to files:
📚 Learning: 2025-12-18T16:03:02.066ZApplied to files:
📚 Learning: 2026-01-09T00:50:57.103ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
🔇 Additional comments (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 01/09/2026, 03:05:32 AM UTC 🔗 Links🎉 Your Storybook is ready for review! |
🎭 Playwright Test Results⏰ Completed at: 01/09/2026, 03:10:56 AM UTC 📈 Summary
📊 Test Reports by Browser
🎉 Click on the links above to view detailed test results for each browser configuration. |
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 3.23 MB (baseline 3.23 MB) • 🔴 +22 BMain entry bundles and manifests
Status: 3 added / 3 removed Graph Workspace — 1.05 MB (baseline 1.05 MB) • 🔴 +357 BGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed Views & Navigation — 6.63 kB (baseline 6.63 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 1 added / 1 removed Panels & Settings — 300 kB (baseline 300 kB) • 🔴 +2 BConfiguration panels, inspectors, and settings screens
Status: 6 added / 6 removed UI Components — 198 kB (baseline 198 kB) • ⚪ 0 BReusable component library chunks
Status: 9 added / 9 removed Data & Services — 12.5 kB (baseline 12.5 kB) • ⚪ 0 BStores, services, APIs, and repositories
Status: 3 added / 3 removed Utilities & Hooks — 1.41 kB (baseline 1.41 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 1 added / 1 removed Vendor & Third-Party — 9.19 MB (baseline 9.19 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Status: 6 added / 6 removed Other — 3.6 MB (baseline 3.6 MB) • ⚪ 0 BBundles that do not match a named category
Status: 21 added / 21 removed |
…ests Amp-Thread-ID: https://ampcode.com/threads/T-019ba08a-f14c-70fa-9ed2-4c27a70c2cea Co-authored-by: Amp <amp@ampcode.com>
50a5d25 to
5d87e0e
Compare
…ests (#7919) ## 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 <amp@ampcode.com>
…to reduce network requests (#7922) Backport of #7919 to `cloud/1.36` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7922-backport-cloud-1-36-perf-AssetBrowserModal-virtualize-asset-grid-to-reduce-network-re-2e36d73d3650812ca602d496f4decec4) by [Unito](https://www.unito.io) Co-authored-by: Alexander Brown <drjkl@comfy.org> Co-authored-by: Amp <amp@ampcode.com>
Problem
The
AssetBrowserModaltriggers hundreds of network requests when opened becauseAssetGrid.vuerenders all asset cards immediately using a simplev-forloop. EachAssetCardloads its thumbnail image, causing a flood of simultaneous requests.Solution
Replace the simple
v-forwith the existingVirtualGridcomponent (already used inAssetsSidebarTab.vueandManagerDialogContent.vue) to only render visible items plus a small buffer.Changes
AssetGrid.vue: UseVirtualGridwith computedassetsWithKeythat adds the requiredkeyproperty fromasset.idBaseModalLayout.vue: Addflex-1to content container for proper height calculation (required forVirtualGridto work)Testing
┆Issue is synchronized with this Notion page by Unito