From 1d98cbf78137a5a8c7e83706a559d680a67d91d2 Mon Sep 17 00:00:00 2001 From: MelmacAlpha Date: Mon, 26 Oct 2026 03:15:25 +0100 Subject: [PATCH 1/3] feat: edit variables in a dockable floating window Keep the preview visible while changing variables, with a header toggle back to the canvas-filling editor. Preserve the editor and floating rectangle across dock changes and sidebar navigation so drafts, focus and scroll position survive. Share bounded geometry, pointer handling, iframe drag shielding and keyboard resize controls with the code editor. The reusable frame leaves the dock location to its caller so future floating sidebars can use it without coupling to variables. Include the shared UI sources in Studio and cover docking, nested popup dismissal, viewport bounds and pointer cleanup with regression tests. --- src/app/shell/AppPanes.tsx | 4 +- src/app/styles.css | 77 ++------- src/features/code/CodeWindow.tsx | 102 ++---------- src/features/variables/VariablesView.tsx | 127 ++++++++------- src/ui/DockableWindow.tsx | 74 +++++++++ src/ui/WindowResizeHandles.tsx | 47 ++++++ src/ui/dockableWindow.css | 47 ++++++ src/ui/useWindowRectangle.ts | 95 +++++++++++ src/ui/windowGeometry.ts | 88 ++++++++++ src/ui/windowResizeHandles.css | 67 ++++++++ studio/scripts/shared-source.json | 8 +- .../features/variables/VariablesWorkspace.tsx | 13 +- test/renderer/ui/dockableWindow.test.js | 150 ++++++++++++++++++ test/renderer/ui/windowGeometry.test.js | 56 +++++++ 14 files changed, 735 insertions(+), 220 deletions(-) create mode 100644 src/ui/DockableWindow.tsx create mode 100644 src/ui/WindowResizeHandles.tsx create mode 100644 src/ui/dockableWindow.css create mode 100644 src/ui/useWindowRectangle.ts create mode 100644 src/ui/windowGeometry.ts create mode 100644 src/ui/windowResizeHandles.css create mode 100644 test/renderer/ui/dockableWindow.test.js create mode 100644 test/renderer/ui/windowGeometry.test.js diff --git a/src/app/shell/AppPanes.tsx b/src/app/shell/AppPanes.tsx index fd1b2cd1..d603ed03 100644 --- a/src/app/shell/AppPanes.tsx +++ b/src/app/shell/AppPanes.tsx @@ -227,14 +227,16 @@ export function openCanvasPath(app: ShellView, path: string | undefined, occurre export function CanvasCovers({ app }: { readonly app: ShellView }) { return ( <> - {app.varsGroup && app.leftTab === 'variables' && ( + {app.varsGroup && (