From 9f5ff8eb42d20b996d432d8d9334301a038de85d Mon Sep 17 00:00:00 2001 From: Rbanh Date: Fri, 20 Feb 2026 03:34:26 -0500 Subject: [PATCH] Fix drag UX: single-select on click and auto-unlock locked component on manual move --- frontend/app.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/frontend/app.js b/frontend/app.js index 1a6c923..15beafe 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -1761,9 +1761,7 @@ function bindSvgInteractions() { return; } - if (!state.selectedRefs.includes(ref)) { - selectSingleRef(ref); - } + selectSingleRef(ref); state.selectedNet = null; state.selectedPin = null; state.isolateNet = false; @@ -1778,6 +1776,14 @@ function bindSvgInteractions() { } const pt = canvasToSvgPoint(evt.clientX, evt.clientY); + const clickedInst = instanceByRef(ref); + if (clickedInst?.placement?.locked) { + pushHistory("auto-unlock-drag"); + clickedInst.placement.locked = false; + el.jsonFeedback.textContent = `${ref} was locked and has been auto-unlocked for manual move.`; + renderSelected(); + } + const dragRefsRaw = state.selectedRefs.length ? [...state.selectedRefs] : [ref]; const dragRefs = dragRefsRaw.filter((r) => !instanceByRef(r)?.placement?.locked); if (!dragRefs.length) {