Repository navigation
fix(canvas): improve Lasso start surfaces and sampling fidelity - #304
Conversation
Allow Lasso starts on non-interactive node surfaces, preserve coalesced and densely sampled pointer paths, and guard retained Ink moves against trailing clicks. Update interaction docs and cover routing, sampling, and retained movement with regression tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The new target policy incorrectly lets Lasso capture the Audio node’s seek slider, preventing seeking while Lasso is active.
1 open finding
What changed in this PR
Expands Canvas Lasso initiation across non-interactive node surfaces while improving pointer-sample fidelity and retained-selection movement handling.
Changes:
- Enables Lasso on node surfaces while reserving editors and controls.
- Preserves coalesced pointer samples and adds click suppression for moved Ink.
- Adds architecture documentation and regression coverage.
| File | Description |
|---|---|
docs/architecture/sketch-node.md |
Documents Lasso behavior for Sketch nodes. |
docs/architecture/canvas-input-interactions.md |
Updates the Canvas gesture contract. |
apps/web/src/index.css |
Shows the Lasso cursor over nodes. |
apps/web/src/hooks/useSketchStrokeMove.ts |
Guards compatibility clicks after retained movement. |
apps/web/src/hooks/useSketchStrokeMove.test.tsx |
Tests retained-movement click suppression. |
apps/web/src/hooks/useCanvasLasso.ts |
Captures node-originated and coalesced pointer samples. |
apps/web/src/hooks/useCanvasLasso.gesture.test.tsx |
Tests node starts and sampling fidelity. |
apps/web/src/components/Panels/Canvas/canvasInputPolicy.ts |
Broadens eligible Lasso start targets. |
apps/web/src/components/Panels/Canvas/canvasInputPolicy.test.ts |
Tests allowed surfaces and excluded controls. |
apps/web/src/components/Panels/Canvas/Canvas.tsx |
Connects native routed events and click guarding. |
apps/web/e2e/canvas-mouse.spec.ts |
Adds Note and Sketch Lasso scenarios. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| return ( | ||
| !isPanelTarget(target) && | ||
| !isNodeControlTarget(target) && | ||
| !isKeyboardInteractiveTarget(target) && |
There was a problem hiding this comment.
Fixed in 1540905. The shared interactive-target predicate now recognizes role="slider" and its descendants. New Lasso drawing and retained-region movement share the same control exclusions, so an existing retained region cannot capture the Audio seek bar either.
Added policy regressions (confirmed failing before the fix) and a real WAV-backed Playwright test that clicks a waveform child, checks audio.currentTime and focus, then verifies ArrowRight/ArrowLeft seeking both with and without a retained region. Validation: 172 targeted unit tests, 4 browser tests, repository typecheck/format, and changed-file lint passed. The existing local-only tmp/dev-ipad.mjs lint issue is unchanged.
Recognize ARIA sliders in the shared interactive-target predicate and apply the same control exclusions to new and retained Lasso gestures. Add control-policy regression tests and a real WAV-backed browser test for pointer seeking, focus, and arrow-key seeking with and without a retained region. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Summary
Validation
pnpm typecheckandpnpm formatpassed.git diff --checkpassed.pnpm lint:fix: its 5 errors are confined to the local-only, Git-ignoredtmp/dev-ipad.mjsscript (undefined console/setTimeout). Repository ESLint passes with that single local file excluded; existing warnings remain.Scope
Only the 11 Lasso-related source, test, and documentation files are included. Existing local desktop-startup changes are excluded.