From 48647088f9bf86d2f3e56aa60e720db515d8c2e2 Mon Sep 17 00:00:00 2001 From: mAi Date: Sat, 16 May 2026 13:25:04 +0200 Subject: [PATCH] feat(ui): double-click a port to start a cable draw Saves the cable-tool arming step. Double-click sets state.cableDrawFromPortID + clears selection, then the existing cable-draw-in-progress branch in onPortPointerDown commits the cable on the next port click. Esc / plain click still cancels. Single-click behaviour (select + open port inspector) unchanged. --- web/static/main.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/web/static/main.js b/web/static/main.js index 1116ce7..18e2c9f 100644 --- a/web/static/main.js +++ b/web/static/main.js @@ -471,6 +471,17 @@ function renderCanvas() { }); // Port-click drives both cable-draw (slice 7) and port-select (this fix). c.addEventListener("pointerdown", (e) => onPortPointerDown(e, prt)); + // Double-click a port → enter cable-draw mode from that port, + // bypassing the cable-tool arming step. The next port-click + // commits the cable (existing cable-draw-in-progress branch in + // onPortPointerDown). + c.addEventListener("dblclick", (e) => { + e.stopPropagation(); + e.preventDefault(); + state.cableDrawFromPortID = prt.id; + state.selection = null; + render(); + }); g.append(c); }