diff --git a/src/ui.tsx b/src/ui.tsx index e48d3de..f04b582 100644 --- a/src/ui.tsx +++ b/src/ui.tsx @@ -276,32 +276,33 @@ function Plugin () { } const [isMaxToggled, setIsMaxToggled] = useState(false) + // Resize-handle visibility is state-driven (not CSS :hover/:has) for Figma webview + // reliability: show all handles when the window or any handle is hovered; hoveredHandle + // tracks the one under the cursor, rendered brighter. + const [rootHover, setRootHover] = useState(false) + const [hoveredHandle, setHoveredHandle] = useState(null) + const handleVisible = rootHover || hoveredHandle !== null + function hitboxStyle (dir: string, pos: { [k: string]: number | string }) { + const active = hoveredHandle === dir + return { + ...pos, + position: 'fixed', + zIndex: 3, + opacity: handleVisible ? 1 : 0, + background: active ? 'rgba(255,255,255,0.95)' : 'rgba(255,255,255,0.5)', + border: '1.5px solid ' + (active ? 'rgba(80,80,80,1)' : 'rgba(110,110,110,0.9)'), + borderRadius: 4, + transition: 'opacity 120ms ease, background 120ms ease, border-color 120ms ease' + } as any + } // "Maximized" flag drives the icon (expand/collapse). Real size after maximize is // clamped by Figma, so we track it explicitly rather than comparing sizes. const isMaximized = isMaxToggled return ( -
- +
@@ -349,18 +350,16 @@ function Plugin () {
- {/* Perimeter hitboxes (4 edges + 4 corners). Visible for debugging. - Corners = violet. Edges colored per side: top=red, bottom=green, left=blue, right=orange. - Edge handles span the FULL side length (left:0;right:0 / top:0;bottom:0). - Center is button-only (not in perimeter). */} -