MOBILE-TOUCH (#29): reliable tap-to-open + 44px hit areas#130
Merged
Conversation
On a phone the graph defaults to LOCKED (touch pans the canvas), and a single tap on a node previously relied on the flaky synthetic mouse-click — so opening a node on touch was unreliable. The header icon buttons also draw at 16-24px, well under the 44px touch-target minimum. - New pure lib/touchInteraction.ts (11 unit tests): isTap / isLongPress (duration + movement thresholds), touchHitSize (>= 44px on touch), distance, isCoarsePointer. - TAP-TO-OPEN: the node touchend now classifies a quick, still touch as a tap and calls handleNodeClick directly + preventDefault (suppresses the synthetic click so it can't double-fire open-then-shut). Long-press (context menu) and drag/pan are excluded by isTap. Works even while the graph is locked. This also makes the touch grow flow's target-tap (complete-connection) fire deterministically. - 44px HIT AREAS: on a coarse pointer, each node header icon group (edit / relationship / expand / descend) gets a transparent 44px hit-rect — bigger tap target, identical look, tracks the counter-zoom. Verified: touchInteraction 11/11; new tests/e2e/mobile/touch-graph.spec.ts (@mobile @touch, real hasTouch context) — single tap opens the inspector while locked; web typecheck clean; THE GATE 5/5 (no desktop regression). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🧪 Comprehensive Test Suite
Full-stack smoke gate runs in the CI workflow. |
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.
Mobile touch overhaul. New pure
lib/touchInteraction.ts(11 tests) drives: tap-to-open (node touchend classifies a quick still touch as a tap → handleNodeClick + preventDefault, works even while locked; also makes the touch grow flow's target-tap deterministic) and 44px hit-rects on the header icon buttons (coarse-pointer only). Verified: unit 11/11, new @mobile @touch e2e (real hasTouch) taps a node → inspector opens while locked, typecheck clean, THE GATE 5/5.🤖 Generated with Claude Code