From 8300712a21d15172841bcccbb955a68b684b566b Mon Sep 17 00:00:00 2001 From: "Fabian @ Blax Software" Date: Fri, 23 Oct 2026 12:43:08 +0200 Subject: [PATCH] R bottom bar as wide as the top bar; Logic shows every gate; Space opens a search for parts and actions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The parts bar sits under the top bar at the same width, pinned parts on the left (the wheel scrolls them when they do not fit), search on the right. Logic lists NAND and every component drawn as a gate, pinned or not. A tap on Space opens the search box at the mouse with the recent parts and common actions (new component, find, truth table, fit, print, …); Space held while dragging still moves the view. Co-Authored-By: Claude Opus 5.5 (1M context) --- app/assets/css/main.css | 64 +++++++++++-- app/components/editor/App.vue | 2 +- app/components/editor/BottomBar.vue | 53 ++++++++--- app/components/editor/Canvas.vue | 13 ++- app/components/editor/Help.vue | 4 +- app/components/editor/QuickAdd.vue | 133 +++++++++++++++++++++++----- 6 files changed, 223 insertions(+), 46 deletions(-) diff --git a/app/assets/css/main.css b/app/assets/css/main.css index 8b7506f..6d42455 100644 --- a/app/assets/css/main.css +++ b/app/assets/css/main.css @@ -3372,7 +3372,7 @@ kbd { .quick-add { position: fixed; z-index: 60; - width: 300px; + width: 340px; padding-bottom: 6px; border: 1px solid #2d3745; border-radius: 10px; @@ -3385,6 +3385,25 @@ kbd { cursor: pointer; } +.quick-list { + max-height: min(420px, 60vh); + overflow-y: auto; + scrollbar-width: thin; +} + +.quick-head { + padding: 8px 12px 2px; + font-size: 10px; + font-weight: 700; + letter-spacing: 0.07em; + text-transform: uppercase; + color: var(--muted); +} + +.quick-add kbd { + flex-shrink: 0; +} + /* ── Title screen ───────────────────────────────────────────────── */ .brand { padding: 4px 8px 4px 4px; @@ -4228,14 +4247,14 @@ table.board { } /* ── Bottom bar: parts by kind, like Figma's toolbar ────────────── */ +/* Same width and place as the top bar, whatever panels are open. */ .bottom-dock { position: absolute; - left: 12px; - right: 12px; + left: var(--bar-inset); + right: var(--bar-inset); bottom: 14px; z-index: 20; - display: flex; - justify-content: center; + container-type: inline-size; pointer-events: none; } @@ -4245,11 +4264,10 @@ table.board { .bottom-bar { display: flex; + justify-content: space-between; align-items: center; - gap: 2px; - max-width: 100%; - overflow-x: auto; - scrollbar-width: none; + gap: 6px; + width: 100%; padding: 5px; background: rgb(26 33 43 / 0.96); border: 1px solid var(--border); @@ -5123,3 +5141,31 @@ button.tile:hover { transition: none; } } + +/* Pinned parts on the left, kinds of parts in the middle, search on the right. */ +.bb-group { + display: flex; + align-items: center; + gap: 2px; + min-width: 0; +} + +.bb-group.pinned { + flex: 0 1 auto; + overflow-x: auto; + scrollbar-width: none; +} + +.bb-group:not(.pinned) { + flex-shrink: 0; +} + +.bb-group.end { + justify-content: flex-end; +} + +@media (max-width: 820px) { + .bottom-dock { + bottom: calc(40% + 14px); + } +} diff --git a/app/components/editor/App.vue b/app/components/editor/App.vue index 1975610..7e349d8 100644 --- a/app/components/editor/App.vue +++ b/app/components/editor/App.vue @@ -42,10 +42,10 @@ watch(
-
+ diff --git a/app/components/editor/BottomBar.vue b/app/components/editor/BottomBar.vue index e5ee790..1289889 100644 --- a/app/components/editor/BottomBar.vue +++ b/app/components/editor/BottomBar.vue @@ -60,6 +60,13 @@ function onWheel(e: WheelEvent) { e.preventDefault() el.scrollLeft += e.deltaY } +/** Pinned parts that do not fit: the wheel scrolls them sideways too. */ +function sideways(e: WheelEvent) { + const el = e.currentTarget as HTMLElement + if (el.scrollWidth <= el.clientWidth || Math.abs(e.deltaX) > Math.abs(e.deltaY)) return + e.preventDefault() + el.scrollLeft += e.deltaY +} function page(dir: number) { strip.value?.scrollBy({ left: dir * strip.value.clientWidth * 0.8, behavior: 'smooth' }) } @@ -117,7 +124,6 @@ function endDrag() { open.value = null } -watch([open, compTab, () => compGroup.value?.defs.length], () => nextTick(measure)) /** Which button the part being placed belongs to, to show it as active. */ const activeCat = computed(() => { @@ -129,6 +135,11 @@ const activeCat = computed(() => { }) const group = computed(() => BASIC_GROUPS.find(g => g.name === open.value)) +/** Components that belong with a kind of part: gates (drawn as one, or in the Gates group) under Logic. */ +const groupComps = computed(() => + open.value === 'Logic' ? ed.project.value.components.filter(d => d.group?.trim() === 'Gates' || (d.symbol && d.symbol !== 'box')) : [], +) +watch([open, compTab, () => compGroup.value?.defs.length, () => groupComps.value.length], () => nextTick(measure)) const connectors = computed(() => ed.project.value.connectors ?? []) const portsOk = computed(() => ed.canPlaceKind('portin')) // Pinned parts sit on the bar; a pinned component this project lacks is left out. @@ -174,6 +185,25 @@ onBeforeUnmount(() => window.removeEventListener('keydown', onKey, true)) +
+ + +
@@ -261,7 +291,7 @@ onBeforeUnmount(() => window.removeEventListener('keydown', onKey, true))
diff --git a/app/components/editor/Canvas.vue b/app/components/editor/Canvas.vue index d3314d8..797f282 100644 --- a/app/components/editor/Canvas.vue +++ b/app/components/editor/Canvas.vue @@ -423,6 +423,8 @@ type Drag = const drag = ref(null) const spaceDown = ref(false) +/** Space pressed and let go quickly, without moving the view: opens the search box at the mouse. */ +let spaceTap: { at: number } | null = null let lastClick = { id: '', t: 0 } function isDoubleClick(id: string) { @@ -446,6 +448,7 @@ function onPointerDown(e: PointerEvent) { const w = toWorld(e) const v = view.value if (e.button === 1 || e.button === 2 || (e.button === 0 && spaceDown.value)) { + spaceTap = null menu.value = null drag.value = { kind: 'pan', sx: e.clientX, sy: e.clientY, vx: v.x, vy: v.y, menu: e.button === 2 ? { target: e.target as Element, at: w } : undefined } root.value!.setPointerCapture(e.pointerId) @@ -1023,6 +1026,7 @@ function onKey(e: KeyboardEvent) { nudge(dx * step, dy * step) } else if (e.key === ' ') { e.preventDefault() + if (!e.repeat) spaceTap = { at: performance.now() } spaceDown.value = true } else if (e.key === 'Enter' && ed.selection.value.length === 1) { const n = nodeMap.value.get(ed.selection.value[0]!) @@ -1035,7 +1039,12 @@ function onKey(e: KeyboardEvent) { } function onKeyUp(e: KeyboardEvent) { - if (e.key === ' ') spaceDown.value = false + if (e.key === ' ') { + spaceDown.value = false + // A tap, not a hold for moving the view: the search box with recent parts and actions. + if (spaceTap && performance.now() - spaceTap.at < 350 && !quick.value) openQuickAdd() + spaceTap = null + } const key = e.key.toLowerCase() for (const n of def.value.nodes) if (n.kind === 'button' && n.key === key) ed.press(n, false) for (const [n, r] of boundRows(key)) if (r.type === 'button') ed.pressRow(n, r, false) @@ -1581,7 +1590,7 @@ defineExpose({ fit, zoomAt }) - +
diff --git a/app/components/editor/Help.vue b/app/components/editor/Help.vue index f4e9560..a0a14d4 100644 --- a/app/components/editor/Help.vue +++ b/app/components/editor/Help.vue @@ -37,8 +37,8 @@ const SHORTCUTS: [string, string][] = [ ['Alt + click an input pin', 'Inverts it (a bubble); counted honestly as one NAND'], ['Send signal / Use signal', 'Name a signal (CLK, RESET) once and use it anywhere in the circuit without a wire'], ['Ctrl+F', 'Find a part, signal or component in every circuit, and where a component is used'], - ['Shift+A or Ctrl+K', 'Add a part at the mouse: type a few letters, arrows to choose, Enter to place'], - ['/', 'The same: find a part by name and place it'], + ['Space (tap)', 'Search at the mouse: recent parts and actions like a new component; type a few letters, arrows to choose, Enter to take it'], + ['/, Shift+A or Ctrl+K', 'The same search box'], ['Ctrl+P', 'Print the circuit as a sheet with a title block, or save it as PDF'], ['Select switches or buttons, Combine', 'One input panel (all rows can become buttons); lamps or output pins combine into an output panel'], ['Select panels, Merge', 'One panel with all their rows; inside a component input panel rows are inputs, output panel rows outputs'], diff --git a/app/components/editor/QuickAdd.vue b/app/components/editor/QuickAdd.vue index 835996c..3290674 100644 --- a/app/components/editor/QuickAdd.vue +++ b/app/components/editor/QuickAdd.vue @@ -1,24 +1,107 @@