[eric] canvas: two same-instant app creations can never fully cover each other; the clash pushes down the column (ENG-346)

This commit is contained in:
ciregenz
2026-08-18 19:43:08 -07:00
parent b9e357c082
commit 2a9f1a7024
@@ -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,