From e57bc06c9f2d95a12f95526c1282585625183841 Mon Sep 17 00:00:00 2001 From: ciregenz Date: Fri, 26 Jun 2026 05:01:44 -0700 Subject: [PATCH] [eric] browser: tag agent-spawned + pasted browser cards with their home dashboard (were untagged, bled onto all dashboards) --- backend/apps/agents/browser/browser_agent.py | 1 + frontend/src/shared/state/dashboardLayoutSlice.ts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/backend/apps/agents/browser/browser_agent.py b/backend/apps/agents/browser/browser_agent.py index e49a7258..756f9c2b 100644 --- a/backend/apps/agents/browser/browser_agent.py +++ b/backend/apps/agents/browser/browser_agent.py @@ -2008,6 +2008,7 @@ async def p_create_browser_card(dashboard_id: str, url: str, parent_session_id: width=1280, height=800, spawned_by=parent_session_id, + dashboard_id=dashboard_id, ) dashboard.layout.browser_cards[browser_id] = card dashboard.updated_at = datetime.now() diff --git a/frontend/src/shared/state/dashboardLayoutSlice.ts b/frontend/src/shared/state/dashboardLayoutSlice.ts index 7c9afecf..f56d8dfb 100644 --- a/frontend/src/shared/state/dashboardLayoutSlice.ts +++ b/frontend/src/shared/state/dashboardLayoutSlice.ts @@ -734,6 +734,8 @@ const dashboardLayoutSlice = createSlice({ width: w, height: h, zOrder: card.zOrder || state.nextZOrder++, + // An agent-spawned card must carry its home dashboard or it renders on EVERY dashboard; trust the backend's tag, fall back to the current dashboard so an old/untagged payload can't bleed. + dashboard_id: card.dashboard_id ?? getLastDashboardId() ?? undefined, }; }, @@ -1027,6 +1029,8 @@ const dashboardLayoutSlice = createSlice({ width: width || DEFAULT_BROWSER_CARD_W, height: height || DEFAULT_BROWSER_CARD_H, zOrder: state.nextZOrder++, + // Pasted onto the dashboard the user is looking at, else it bleeds onto every dashboard. + dashboard_id: getLastDashboardId() ?? undefined, }; },