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 ──────────────────────────────── */ /* ── Drag & Drop ──────────────────────────────── */
const { const {
onClick,
onClickCapture, onClickCapture,
onPointerDown, onPointerDown,
onPointerMove, onPointerMove,
@@ -197,6 +198,7 @@ function handleReset() {
<div <div
ref="flowRef" ref="flowRef"
class="flow" class="flow"
@click="onClick"
@click.capture="onClickCapture" @click.capture="onClickCapture"
@pointerdown="onPointerDown" @pointerdown="onPointerDown"
@pointermove="onPointerMove" @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 const node = options.flowRef.value?.querySelector(`.node[data-id="${currentDrag.id}"]`) as HTMLElement | null
if (node) node.classList.remove('dragging') if (node) node.classList.remove('dragging')
if (!currentDrag.moved) { if (currentDrag.moved) {
options.selectAgent(currentDrag.id)
} else {
suppressClickUntil.value = performance.now() + CLICK_SUPPRESSION_MS suppressClickUntil.value = performance.now() + CLICK_SUPPRESSION_MS
} }
drag.value = null 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) { function onClickCapture(e: MouseEvent) {
if (performance.now() >= suppressClickUntil.value) return if (performance.now() >= suppressClickUntil.value) return
if (!findNode(e.target)) return if (!findNode(e.target)) return
@@ -117,6 +124,7 @@ export function useFlowCanvasInteractions(options: UseFlowCanvasInteractionsOpti
} }
return { return {
onClick,
onClickCapture, onClickCapture,
onPointerDown, onPointerDown,
onPointerMove, onPointerMove,