LearnNewsExamplesConnect
Frontmatter
assigneesTanNghiB2303833
createdAtNov 11, 2026, 11:56 AM
updatedAtNov 13, 2026, 2:55 PM
githubUrlhttps://github.com/neomjs/neo/issues/20772
authorneo-fable-clio
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined1
signals[]
blockedBy[]
blocking[]
closedAtNov 13, 2026, 2:55 PM

GraphScene orbits on a drag that began outside its canvas

Closed v14.0.0/archive-v14-0-0-chunk-1 bughelp wantedgood first issueai
neo-fable-clio
neo-fable-clio commented on Nov 11, 2026, 11:56 AM

Context

Design authority: two summaries in the engine. Neo.canvas.GraphScene says "a primary-button drag orbits" (src/canvas/GraphScene.mjs:83), and Neo.canvas.Base#onMouseDown says "a button went down on the canvas … so a drag gesture starts here" (src/canvas/Base.mjs:187). Both describe a gesture that starts with a press on the canvas.

Observed on 2026-11-11 in the design read of neomjs/neo-agent-institution#911. The Institution's visual arm the side panel is as wide as the operator drags it widens the Observatory's side panel with a real mouse drag on a splitter that sits beside the canvas. Its re-captured golden showed the graph rotated and one well name gone.

Witness (Institution dev 6f00d3d, engine 0baab546, Chromium, the arm's own gesture: press on the splitter, 200 px left in 8 steps, release):

  • 6 of the 8 button-held mousemove events target the canvas, with a movementX sum of −150 px. The panel resizes one round trip after the pointer moves, so the pointer runs ahead of the splitter onto the canvas. At orbitSpeed 0.006 that is 0.9 rad of yaw.

  • The pane before the drag and the pane after dragging 200 px left and 200 px back, at the same size again, differ in 21,469 pixels, and the well name "REM digests the backlog before the next cut" is gone. The camera kept the rotation.

  • Live latest-open + closed sweep: checked latest 20 open (34 open, orange band; #20770..#20694) + closed search (GraphScene orbit drag pointer, Out of Scope read on #19305 and #19261) at 2026-11-11T10:55Z; no equivalent. #19305 leaves the orbit rule out of its own scope and rules nothing about it. No open ticket or epic owns src/canvas (open search GraphScene: only #20695, an examples overview).

  • A2A in-flight claim sweep: the newest messages across all read states from 10:01Z to 10:47Z on 2026-11-11; no overlapping [lane-claim] or [lane-intent].

  • MC sweep: not run from this seat. A Fable seat reads no memory rows until the plane carries the fix of neomjs/neo-agent-brain#1580. A Knowledge Base ticket query on the symptom returned no GraphScene ticket.

  • Own-assignment sweep: 3 open in this repository (#20726, #20682, #20498), none on this surface.

The Problem

GraphScene#updateMouseState orbits on every pointer report that carries the primary button and a movement. It never asks whether the press happened on its own canvas. A press on a neighbouring control that is then dragged across the canvas turns the scene: a splitter, a drag-and-drop item, a text selection that runs over the canvas.

The same report sets camera.touched and clears flightPlan. After such a drag the camera no longer re-fits to a new scene or a resized surface, and a running flight ends.

For the person in front of it: widening a panel beside a graph rotates the graph.

The Architectural Reality

  • Neo.app.SharedCanvas forwards down, up, moves and leave to renderer.updateMouseState, each with the event's buttons (src/app/SharedCanvas.mjs:372-438).
  • Neo.canvas.Base#updateMouseState copies buttons from every report into mouse and calls onMouseDown / onMouseUp for down / up (src/canvas/Base.mjs:266-300). mouse.buttons is the state of the device, not of this canvas.
  • Neo.canvas.GraphScene#updateMouseState (src/canvas/GraphScene.mjs:1371-1383): (mouse.buttons & 1) && (mouse.dx || mouse.dy) adds to camera.yaw and camera.pitch, sets camera.touched and clears flightPlan.
  • A leave resets mouse to idle. The first report after it moves by nothing, and the next one orbits again while a button is held.
  • Spec surface: test/playwright/unit/canvas/PointerInput.spec.mjs (the base's pointer contract) and test/playwright/unit/canvas/GraphScene.spec.mjs (the camera).

The Fix

The orbit belongs to a press the canvas received. Neo.canvas.Base is where "a drag gesture starts here" is written, so the base holds that fact: the buttons whose press reached this canvas and has not ended. It is set in updateMouseState before onMouseDown runs. It ends on up, on leave, and on a report whose buttons no longer carry the button. GraphScene orbits on that state instead of on mouse.buttons.

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
Neo.canvas.Base#mouse (one new key: the buttons pressed on this canvas) The summary of Base#onMouseDown Holds a button from its down report until up, leave, or a report without it None The member's JSDoc, and the summaries of onMouseDown and onMouseUp PointerInput.spec.mjs
Neo.canvas.GraphScene#updateMouseState The class summary: "a primary-button drag orbits" Orbits only for a primary press this canvas received. A held move without one changes neither the camera nor camera.touched nor flightPlan None The method summary GraphScene.spec.mjs

Decision Record impact

none

Acceptance Criteria

  • A unit arm feeds move reports with buttons: 1 and no down: camera.yaw, camera.pitch, camera.touched and flightPlan stay as they were. The arm is red on dev before the change.
  • A press on the canvas followed by moves orbits as today, and the existing orbit arms pass.
  • After up, after leave, and after a report with buttons: 0, a later held move without a new press does not orbit.
  • PointerInput.spec.mjs witnesses the base's new key through the same transitions.
  • Post-merge: on an engine revision that carries the fix, the Institution's widened-pane arm asserts that a splitter drag leaves the scene as it was, and its two goldens are re-captured. Owner: the steward of neomjs/neo-agent-institution#505.

Out of Scope

  • Pointer capture, so that an orbit continues while the pointer is outside the canvas.
  • Touch gestures.
  • The Institution's splitter. It resizes correctly; a pointer that runs ahead of a splitter is how splitters behave.

Avoided Traps

  • Fixing it in the app, by having the canvas host drop buttons unless it saw the press: every GraphScene consumer has the same neighbours, and each app would write the base's contract again.
  • Slowing the test's drag until no move lands on the canvas: the arm turns green and hands still hit it.
  • What the rule also did: it carried an orbit back onto the canvas after the pointer had left with the button held. That stops, because the leave ends the press. Pointer capture is the way to keep such a drag, and it is out of scope here.

Related

  • Related: #19305, #19261, #20286, neomjs/neo-agent-institution#911, neomjs/neo-agent-institution#505

Ownership: unowned-rationale: Ready for a contributor; maintainers provide planning and review.

Origin Session ID: 51b4c06b-5ef9-47cf-91bb-c025cafbdbf0 Retrieval Hint: "GraphScene orbit primary button held move without press on canvas splitter drag camera.touched"

TanNghiB2303833
TanNghiB2303833 Nov 11, 2026, 3:38 PM

Hi, I would like to work on this issue. I have set up Neo locally. Please assign this to me!

@github-actions - 2026-11-11T14:38:20Z

Thanks for claiming this, @TanNghiB2303833, and welcome! Assigned to you — you can start now.

Your claim reserves this issue for 7 days (any comment here resets the clock; we still merge the first approve-worthy PR if another lands first or a claim goes quiet).

An automatic reply. How claims work [QUARANTINED_URL: github.com]

  • 2026-11-11T14:38:20Z @github-actions assigned to @TanNghiB2303833
  • 2026-11-11T15:51:00Z @neo-fable-mnemosyne cross-referenced by #20779
TanNghiB2303833 cross-referenced by PR #20786 on Nov 11, 2026, 6:09 PM
TanNghiB2303833 referenced in commit 3e81075 - "fix(canvas): require on-canvas press to orbit GraphScene (#20772)" on Nov 11, 2026, 6:14 PM
TanNghiB2303833 referenced in commit ed1fe21 - "fix(canvas): address PR review feedback on buttonBit, JSDoc, and spec structure (#20772)" on Nov 12, 2026, 3:32 PM
tobiu referenced in commit 2d557e4 - "fix(canvas): require on-canvas press to orbit GraphScene (#20772) (#20786) on Nov 13, 2026, 2:55 PM
tobiu closed this issue on Nov 13, 2026, 2:55 PM