From 24bc66f7989b76fab8f0bf117ac6e0c9fb82bfd9 Mon Sep 17 00:00:00 2001 From: "Fabian @ Blax Software" Date: Thu, 22 Oct 2026 22:47:38 +0200 Subject: [PATCH] R Packed panels, Tab adds rows, flyouts at the pointer, steady top bar Combining switches, buttons, lamps or outputs into a panel, and merging panels, puts the rows right under each other (space 0). Tab in the last row's name of a panel, or the last line of a connector type, adds the next one once it is filled in. The bottom bar's lists open centred above the pointer. The top bar keeps the width it has with both panels open, centred, so it no longer grows and shrinks with the panels. Co-Authored-By: Claude Opus 5.5 --- app/assets/css/main.css | 9 +++++++-- app/components/editor/App.vue | 2 +- app/components/editor/BottomBar.vue | 20 ++++++++++++------- app/components/editor/ConnectorDialog.vue | 11 ++++++++++- app/components/editor/NodeSettings.vue | 12 +++++++++++- app/lib/logic/panels.ts | 24 ++++++++--------------- tests/panels.test.ts | 8 ++++---- 7 files changed, 54 insertions(+), 32 deletions(-) diff --git a/app/assets/css/main.css b/app/assets/css/main.css index 396f30a..40d6dc8 100644 --- a/app/assets/css/main.css +++ b/app/assets/css/main.css @@ -64,6 +64,9 @@ kbd { .workspace { --left: 272px; --right: 280px; + /* The top bar keeps the width it has with both panels open, centred, whatever is open. */ + --bar-inset: calc(280px + 12px); + position: relative; display: grid; grid-template-columns: var(--left) 1fr; min-height: 0; @@ -112,6 +115,7 @@ kbd { @media (max-width: 820px) { .workspace, .workspace.has-selection { + --bar-inset: 12px; grid-template-columns: 1fr; grid-template-rows: 1fr 40%; } @@ -4489,9 +4493,10 @@ table.board { .top-dock { position: absolute; top: 10px; - left: 12px; - right: 12px; + left: var(--bar-inset); + right: var(--bar-inset); z-index: 30; + container-type: inline-size; pointer-events: none; } diff --git a/app/components/editor/App.vue b/app/components/editor/App.vue index 4ae84b6..1975610 100644 --- a/app/components/editor/App.vue +++ b/app/components/editor/App.vue @@ -41,11 +41,11 @@ watch(
-
+ diff --git a/app/components/editor/BottomBar.vue b/app/components/editor/BottomBar.vue index 1b90341..1dc7433 100644 --- a/app/components/editor/BottomBar.vue +++ b/app/components/editor/BottomBar.vue @@ -31,12 +31,19 @@ const open = ref(null) const anchor = ref(0) let timer: ReturnType | undefined -function show(id: string, e: Event) { +const dock = ref() +/** Where the list opens: centred above the pointer, kept inside the canvas. */ +function anchorAt(x: number) { + const r = dock.value!.getBoundingClientRect() + const half = 130 + anchor.value = Math.min(Math.max(x - r.left, half), Math.max(half, r.width - half)) +} + +function show(id: string, e: PointerEvent) { clearTimeout(timer) - const el = e.currentTarget as HTMLElement const go = () => { + if (open.value !== id) anchorAt(e.clientX) open.value = id - anchor.value = el.offsetLeft + el.offsetWidth / 2 } // Moving along the bar switches at once; the first one waits a moment. if (open.value) go() @@ -52,13 +59,12 @@ function stay() { clearTimeout(timer) } -function toggle(id: string, e: Event) { +function toggle(id: string, e: MouseEvent) { if (open.value === id) open.value = null else { clearTimeout(timer) - const el = e.currentTarget as HTMLElement + anchorAt(e.clientX) open.value = id - anchor.value = el.offsetLeft + el.offsetWidth / 2 } } @@ -95,7 +101,7 @@ onBeforeUnmount(() => window.removeEventListener('keydown', onKey, true))