Expand node magnet area to full interior; click selects, drag draws edge#12
Merged
Conversation
…aw edge, click to select - Add EH_DRAG_THRESHOLD module-level constant (4px) - Add isInNodeOrRing() helper that matches the full outer ellipse (ring + interior) - updatePointerEvents now enables pointer-events for the entire node area using isInNodeOrRing; crosshair cursor only in the ring band, default in interior - Rewrite _ehStartDrawing with drag-threshold detection: - mousedown: record start position, install temp mousemove/mouseup on window - drag (> 4px): call _eh.start() to begin edge drawing - click (no drag): select the node + removeHandle() so Cytoscape can move it - Add _ehPendingMousemove/_ehPendingMouseup instance fields; cleaned up in removeHandle(), _destroyEdgeHandle(), and at the top of _ehStartDrawing to guard against missed mouseup events Agent-Logs-Url: https://github.com/jpmccu/boxes/sessions/9dfbac6a-f8ad-4e4f-ba47-bd849f2c90a7 Co-authored-by: jpmccu <602385+jpmccu@users.noreply.github.com>
jpmccu
approved these changes
May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clicking anywhere in the node ring immediately started edge drawing, making it hard to select nodes without accidentally triggering the draw mode. The magnet area also didn't cover the node interior.
Changes
isInNodeOrRing— new helper that matches the full outer ellipse (ring + interior), vsisInRingwhich only matched the outer bandupdatePointerEvents— now enables pointer-events for the entire node area viaisInNodeOrRing; cursor stayscrosshairin the ring band and switches todefaultin the interior as a visual hint_ehStartDrawing— replaced immediate_eh.start()call with drag-threshold detection:mousedownrecords start position and installs temporarywindowlistenersEH_DRAG_THRESHOLD(4 px) → edge drawing startsmouseupwithout crossing the threshold → node is selected (Shift/Ctrl/Meta multi-select honoured); handle is removed so Cytoscape can handle a follow-up drag to reposition the nodeEH_DRAG_THRESHOLD = 4— extracted as a module-level constant_ehPendingMousemove/_ehPendingMouseup— track the in-flight temporary listeners; cleaned up inremoveHandle(),_destroyEdgeHandle(), and at the top of_ehStartDrawingto guard against missedmouseupevents