From 42bdd3fcca89d8f06dd5547078a52c027fa9c54b Mon Sep 17 00:00:00 2001 From: Javier Sagredo Date: Thu, 7 May 2026 01:53:17 +0200 Subject: [PATCH] Disable cytoscape node grabbing so taps fire reliably MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit By default cytoscape lets the user drag nodes around. The drag detector kicks in if the pointer moves more than a few pixels between mousedown and mouseup, and when that happens cytoscape suppresses the corresponding 'tap' event — which is what our hand-rolled double-click handler listens to. So a slightly-jittery double-click on a class node looked like the node was being dragged without ever drilling into the instance view. Set autoungrabify: true at init. Dagre re-runs the layout every time loadGraph is invoked, so user repositioning of individual nodes was already throwaway — disabling grabbing is a clean improvement on both axes. Co-Authored-By: Claude Opus 4.7 (1M context) --- data/viewer.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/data/viewer.js b/data/viewer.js index e972479..4208694 100644 --- a/data/viewer.js +++ b/data/viewer.js @@ -73,6 +73,14 @@ container: document.getElementById('cy'), elements: [], style: cyStyles(), + // Disable per-node grabbing. Without this, cytoscape interprets a + // click that moves even a couple of pixels between mousedown and + // mouseup as a drag — and `tap` never fires, so our double-click + // detector misses it (the user sees the node "drift" instead of + // drilling in). dagre re-runs the layout after every loadGraph + // anyway, so dragging individual nodes only ever produced + // throwaway repositioning. + autoungrabify: true, }); // --------------------------------------------------------------------------- -- 2.54.0