[eric] browser: tag agent-spawned + pasted browser cards with their home dashboard (were untagged, bled onto all dashboards)

This commit is contained in:
ciregenz
2026-06-26 05:01:44 -07:00
parent ce7b22a216
commit e57bc06c9f
2 changed files with 5 additions and 0 deletions
@@ -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()
@@ -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,
};
},