Skip to content

fix(utils): clean up interrupted mouse gestures - #285

Open
yinx65588-boop wants to merge 4 commits into
apple:mainfrom
yinx65588-boop:fix/interaction-gesture-cleanup
Open

yinx65588-boop wants to merge 4 commits into
apple:mainfrom
yinx65588-boop:fix/interaction-gesture-cleanup

Conversation

@yinx65588-boop

@yinx65588-boop yinx65588-boop commented Oct 18, 2026 •

Copy link
Copy Markdown

Destroying an interactionHandler action between mousedown and mouseup leaves its window listeners installed. Moving or releasing the mouse can then start a drag, update a removed component, or invoke its click/up callbacks. An active drag also never receives cancel, even though the rectangle and dashboard placement handlers already implement it to release interaction state.

Keep a cleanup function for the current gesture, remove window listeners on destruction or replacement, and cancel an interrupted drag once. Normal mouseup clears the active handler before calling up, so an up callback that destroys the action does not cancel a completed drag.

The root type-check script also named a nonexistent @embedding-atlas/embedding-atlas workspace. npm pkg get name --workspace=@embedding-atlas/embedding-atlas reproduces No workspaces found on the baseline; the package manifest names it embedding-atlas. Correct that one reference so the required checks can actually run.

Validation on Windows / Node 24:

  • Eleven regressions using native EventTarget: the original three failures were reproduced on upstream ef64656, and a further cancellation/destruction regression failed on the first revision before being fixed. Coverage includes destruction before/after the drag threshold, replacement, normal release/clicks, repeated destruction, and destruction from up, cancel, drag initialization or blur. Reentrant callbacks that start a replacement gesture are also covered.
  • npm run build -w @embedding-atlas/utils passes.
  • npm test -w @embedding-atlas/utils: 134 tests pass.
  • npm test -w @embedding-atlas/viewer: 144 tests pass.
  • Playwright with real Chromium mouse input reproduces callbacks after removal on the original code; patched pending and active gestures stop callbacks, with active cancellation occurring once. A real second-button mousedown also verifies destruction from the previous drag's cancel callback against the first and latest revisions.
  • Prettier on both changed files, git diff --check, and utils packaging/publint pass. Independent Codex source review reports no actionable P0–P2 findings on the latest commit.

Linux CI validation passes all five jobs on a proof branch whose only difference from PR head 09581170c09f72ea7830cb5b8f05d6fc778c1ab1 is the workflow file. Application/WASM builds and type checks pass, along with 332 JS tests, 234 Python tests (21 skipped), 100 Rust tests, formatting and Clippy. Python wheel install/import/CLI smoke tests also pass on 3.11, 3.12, 3.13 and 3.14. It omits documentation site generation and the expensive cold-cache inference used to generate demo datasets; the earlier unmodified CI run was cancelled during that unrelated step. Publishing jobs are omitted.

Upstream pull-request CI is waiting for maintainer approval to run; fork validation does not satisfy its required check.

AI assistance was used for the change and validation.

This branch has not been deployed

No deployments
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