fix: open agent cards only on click
CI - Build & Test / Backend (.NET) (push) Successful in 25s
CI - Build & Test / Frontend (Vue/TS) (push) Successful in 17s
CI - Build & Test / Security Check (push) Successful in 3s

This commit is contained in:
AzuTear
2026-06-14 15:23:05 +02:00
parent 6d4e8e7927
commit e034883abd
2 changed files with 13 additions and 3 deletions
@@ -174,6 +174,7 @@ watch(
/* ── Drag & Drop ──────────────────────────────── */
const {
onClick,
onClickCapture,
onPointerDown,
onPointerMove,
@@ -197,6 +198,7 @@ function handleReset() {
<div
ref="flowRef"
class="flow"
@click="onClick"
@click.capture="onClickCapture"
@pointerdown="onPointerDown"
@pointermove="onPointerMove"
@@ -100,15 +100,22 @@ export function useFlowCanvasInteractions(options: UseFlowCanvasInteractionsOpti
const node = options.flowRef.value?.querySelector(`.node[data-id="${currentDrag.id}"]`) as HTMLElement | null
if (node) node.classList.remove('dragging')
if (!currentDrag.moved) {
options.selectAgent(currentDrag.id)
} else {
if (currentDrag.moved) {
suppressClickUntil.value = performance.now() + CLICK_SUPPRESSION_MS
}
drag.value = null
}
function onClick(e: MouseEvent) {
const node = findNode(e.target)
if (!node) return
if (performance.now() < suppressClickUntil.value) return
const id = node.dataset.id
if (id) options.selectAgent(id)
}
function onClickCapture(e: MouseEvent) {
if (performance.now() >= suppressClickUntil.value) return
if (!findNode(e.target)) return
@@ -117,6 +124,7 @@ export function useFlowCanvasInteractions(options: UseFlowCanvasInteractionsOpti
}
return {
onClick,
onClickCapture,
onPointerDown,
onPointerMove,