From 86f92164b6edf8478a3aa6d12ec7955a1439b115 Mon Sep 17 00:00:00 2001 From: ciregenz Date: Fri, 7 Aug 2026 13:50:16 -0700 Subject: [PATCH] [eric] canvas: a card finishes its own attach work before the next webview starts --- frontend/src/app/pages/Dashboard/cards/BrowserCard.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/pages/Dashboard/cards/BrowserCard.tsx b/frontend/src/app/pages/Dashboard/cards/BrowserCard.tsx index 7f811a21..fb63a3a5 100644 --- a/frontend/src/app/pages/Dashboard/cards/BrowserCard.tsx +++ b/frontend/src/app/pages/Dashboard/cards/BrowserCard.tsx @@ -519,11 +519,12 @@ const BrowserCard: React.FC = ({ // about:blank (deferred) so a many-tab card doesn't load every page at once; it's woken // the instant it becomes active OR an agent command resolves it (browserRegistry wake). const onReady = () => { - // The guest is attached; let the next card in the queue take its turn. An attach costs - // 60-140ms, longer than a frame, so releasing on a timer would let them overlap again. - releaseWebviewAttachSlot(); if (tabId === activeTabIdRef.current) doLoad(); else registerPendingLoad(wv, targetUrl, doLoad); + // Release AFTER this card's own post-attach work (loadURL, capsule, zoom limits), not + // before: releasing first let that work run against the next card's attach and put six + // long tasks in one open where an isolated attach produces two. + releaseWebviewAttachSlot(); }; wv.addEventListener('dom-ready', onReady, { once: true }); cleanups.push(() => wv.removeEventListener('dom-ready', onReady));