From 2a9f1a7024df3fe1f9785e2b6af60a0306fe66c1 Mon Sep 17 00:00:00 2001 From: ciregenz Date: Tue, 18 Aug 2026 19:43:08 -0700 Subject: [PATCH] [eric] canvas: two same-instant app creations can never fully cover each other; the clash pushes down the column (ENG-346) --- frontend/src/shared/state/dashboardLayoutSlice.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/src/shared/state/dashboardLayoutSlice.ts b/frontend/src/shared/state/dashboardLayoutSlice.ts index 95f50ab8..bbc41acf 100644 --- a/frontend/src/shared/state/dashboardLayoutSlice.ts +++ b/frontend/src/shared/state/dashboardLayoutSlice.ts @@ -1000,6 +1000,12 @@ const dashboardLayoutSlice = createSlice({ posY = pos.y; } } + // Two same-instant creations can compute the same spot (the docked sibling is invisible to occupancy); a card must never fully cover another, so push below the column instead. + for (;;) { + const clash = Object.values(state.viewCards).find((c) => Math.abs(c.x - posX) < 40 && Math.abs(c.y - posY) < 40); + if (!clash) break; + posY = clash.y + clash.height + GRID_GAP; + } const cardKey = viewCardKey(outputId, instance); state.viewCards[cardKey] = { output_id: outputId,