Repository navigation
fix(omo-graph): block text selection and native drag on the canvas - #11
Merged
Merged
Conversation
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.
Problem
Panning the OmO Graph when pressing near the graph (on or between the wave labels, cards, edges) stops after a few pixels. Before #5/#9 the same gesture left the graph following the mouse with the button released.
Root cause (reproduced in headless Chromium)
The canvas text was selectable. Panning across it selects the wave labels, because the pan does not prevent the default text selection. The next press on that selection starts a native text drag-and-drop: Chromium fires
dragstartthenpointercancel, and nopointerupever reaches the panel.pointercancel, so the pan ends after a few pixels. That is the "can only drag for half a second" report.pointercanceland nopointeruparrived, so the pan stayed armed and followed the mouse. That was the original stuck-pan report.Probe trace before the fix (drag starting on selected label text):
Fix
#viewportgetsuser-select: none(plus-webkit-user-selectfor WebKit hosts), so panning and double-clicking no longer select graph text.dragstartinside the viewport is prevented, so no native drag can hijack the pointer.Verification
sandbox="allow-scripts"and answers the SDK protocol with a 7-node graph, and a harness-only probe logs pointer events and the world transform.OrchestratorWave 1 · …, and a drag from the selection givesdragstartthenpointercanceland stops.selectstart, and a double-click selects nothing. A drag from the label pans the whole way (translate(108,198)to(-12,348)) and ends onpointerup. Moves after the release do not pan. A card click still postsopen-session, and a pan that starts on a card does not.npm run typecheck,lint,format:check,npm test(654 pass) andnpm run buildall green.