feat: side dock leaves 80px bottom inset so Figma panel stays visible

This commit is contained in:
Hermes Agent committed 2026-09-10 18:00:00 +02:00
1 parent 05bbcdb474
commit ef89c8abfc
1 file changed
+5 -1
+5 -1
View File
@@ -31,6 +31,9 @@ export default function () {
// - Центр: размер = 50% viewport (по ширине и высоте), центрируется (one-shot, не удерживает)
// Возвращает размер (экранные px) и позицию (canvas-space, прижатую к нужному краю).
const DEFAULT_DOCK_EDGE = 320
// Bottom inset (screen px) kept free when side-docked (left/right), so the Figma
// bottom panel/toolbar stays visible instead of being covered by the plugin window.
const DOCK_SIDE_BOTTOM_INSET = 80
let dockEdgeSize = DEFAULT_DOCK_EDGE // редактируемая фикс-сторона для edge-позиций (320 по умолч.)
// computeDock считает целевой размер+позицию для док-позиции.
// canonical=true — НАЖАТИЕ кнопки дока: задаём канонический размер
@@ -51,7 +54,8 @@ export default function () {
let targetH = currentHeight
if (isLeftRight) {
targetW = dockEdgeSize
targetH = canonical ? maxH : Math.min(currentHeight, maxH)
// Leave room at the bottom for the Figma panel/toolbar.
targetH = canonical ? Math.max(200, maxH - DOCK_SIDE_BOTTOM_INSET) : Math.min(currentHeight, maxH - DOCK_SIDE_BOTTOM_INSET)
} else if (isTopBottom) {
targetW = canonical ? maxW : Math.min(currentWidth, maxW)
targetH = dockEdgeSize