From f9a9657b5e25e77233582f58e83ffcb91c5fb6d4 Mon Sep 17 00:00:00 2001 From: David Montero Crespo Date: Fri, 7 Aug 2026 23:53:48 +0200 Subject: [PATCH] ux(canvas): zoom controls float on the canvas' bottom-right corner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The canvas header runs out of room when the AI chat panel docks on the right — the board selector clipped and the zoom cluster was squeezed out entirely. The −/%/+ cluster now floats on the circuit canvas' bottom-right corner (always free), with stopPropagation so a click never starts a pan. --- .../components/simulator/SimulatorCanvas.css | 12 ++ .../components/simulator/SimulatorCanvas.tsx | 129 ++++++++++-------- 2 files changed, 82 insertions(+), 59 deletions(-) diff --git a/frontend/src/components/simulator/SimulatorCanvas.css b/frontend/src/components/simulator/SimulatorCanvas.css index ae3ca489..c7a7a3a8 100644 --- a/frontend/src/components/simulator/SimulatorCanvas.css +++ b/frontend/src/components/simulator/SimulatorCanvas.css @@ -264,6 +264,18 @@ height: 28px; } +/* Floating variant: pinned to the canvas' bottom-right corner (the header + got too tight once the AI chat panel docks on the right). Sits above the + canvas layers; dialogs/modals portal to so they stay on top. */ +.zoom-controls--floating { + position: absolute; + right: 14px; + bottom: 14px; + z-index: 60; + height: 32px; + box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45); +} + .zoom-btn { display: flex; align-items: center; diff --git a/frontend/src/components/simulator/SimulatorCanvas.tsx b/frontend/src/components/simulator/SimulatorCanvas.tsx index 60f0ab0b..378b6ef5 100644 --- a/frontend/src/components/simulator/SimulatorCanvas.tsx +++ b/frontend/src/components/simulator/SimulatorCanvas.tsx @@ -2860,65 +2860,9 @@ export const SimulatorCanvas = ({ headerSlot }: SimulatorCanvasProps = {}) => {
- {/* Zoom controls */} -
- - - -
+ {/* Zoom moved to a floating cluster on the canvas' + bottom-right corner — the header gets too tight when the + AI chat panel is docked. */} {/* Component count */} { } return null; })()} + + {/* Floating zoom controls — pinned to the canvas' bottom-right + corner (they lived in the canvas header, which gets too tight + when the AI chat panel is docked; the corner is always free). + stopPropagation so a click never starts a canvas pan/selection. */} +
e.stopPropagation()} + onClick={(e) => e.stopPropagation()} + > + + + +