Skip to content

fix(omo-graph): block text selection and native drag on the canvas - #11

Merged
eliottness merged 2 commits into
mainfrom
fix/omo-graph-card-drag
Oct 15, 2026
Merged

eliottness merged 2 commits into
mainfrom
fix/omo-graph-card-drag

Conversation

@eliottness

Copy link
Copy Markdown
Owner

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 dragstart then pointercancel, and no pointerup ever reaches the panel.

Probe trace before the fix (drag starting on selected label text):

pointerdown b=1 -> pointermove b=1 -> dragstart -> pointercancel   (pan stops after ~6px)

Fix

  • #viewport gets user-select: none (plus -webkit-user-select for WebKit hosts), so panning and double-clicking no longer select graph text.
  • dragstart inside the viewport is prevented, so no native drag can hijack the pointer.
  • The inspector, header and settings stay selectable.

Verification

  • Visual check in headless Chromium: a fake OpenChamber host page iframes the built panel with 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.
    • Before: a pan selects OrchestratorWave 1 · …, and a drag from the selection gives dragstart then pointercancel and stops.
    • After: no selectstart, and a double-click selects nothing. A drag from the label pans the whole way (translate(108,198) to (-12,348)) and ends on pointerup. Moves after the release do not pan. A card click still posts open-session, and a pan that starts on a card does not.
  • npm run typecheck, lint, format:check, npm test (654 pass) and npm run build all green.

@eliottness
eliottness merged commit fac34d7 into main Oct 15, 2026
4 checks passed
@eliottness
eliottness deleted the fix/omo-graph-card-drag branch October 15, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant