Skip to content

Seating: a cancelled drag no longer strands a half-drawn zone or calibration line - #92

Merged
JFrusher merged 1 commit into
mainfrom
fix/seating-pointercancel
Oct 5, 2026
Merged

JFrusher merged 1 commit into
mainfrom
fix/seating-pointercancel

Conversation

@JFrusher

@JFrusher JFrusher commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Closes #55

What a user would notice

When a zone or calibration drag was interrupted (a system gesture, an interrupted touch, a release over browser UI), the dashed draft stayed on the canvas, still following the pointer. Now it disappears and nothing is added.

Cause, with evidence

startZoneDraw and startCalibrate in RoomCanvas.tsx listened for pointermove and pointerup only. The new test reproduced both halves of the problem on main:

  • after pointercancel the .draftZone element was still rendered;
  • the listeners stayed on window, so the next release anywhere committed a zone nobody drew. That leak even made the third test count two zones on main.

Fix

A shared stop() removes all three listeners and clears the draft. pointerup commits and then stops, as before. pointercancel only stops.

The other fixed handlers (TableHandles, TableNode, pan) treat cancel like release. That's right for them, because they apply changes live. Here a release commits (adds the zone, opens the calibrate dialog), so a cancel must not.

Also deletes the stale TODO in useCanvasPanZoom.ts, whose fix was already sitting beneath it.

Checks

  • New RoomCanvas.test.tsx: cancel drops the zone, cancel drops the line and opens no dialog, and an ordinary release still adds a zone. All 3 failed on main and pass now.
  • Seating unit tests, typecheck: green.
  • e2e (seating, guests, header, tour, persistence, axe on every page) on a build combining this batch: 61/61, including "a zone is drawn on the floor, then moved".

🤖 Generated with Claude Code

https://claude.ai/code/session_01VhFp1PtVBwgmxST9ZrRTEs


Generated by Claude Code

… calibration line

Zone drawing and room calibration listened for pointermove and pointerup
only. When the pointer was cancelled instead (a system gesture, an
interrupted touch), the draft stayed on the canvas and its listeners stayed
on window, so the next release anywhere committed a zone nobody drew.

A cancel now drops the draft and commits nothing; a release behaves as
before. Also deletes the pan/zoom TODO whose fix already sat beneath it.

Closes #55

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VhFp1PtVBwgmxST9ZrRTEs
@vercel

vercel Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
knotwork-suite Ready Ready Preview Oct 4, 2026 7:47pm UTC

@JFrusher
JFrusher merged commit 801338d into main Oct 5, 2026
10 checks passed
@JFrusher
JFrusher deleted the fix/seating-pointercancel branch October 5, 2026 06:40

This branch was successfully deployed

1 active deployment
Preview — 8dd8dd2e Deployed Oct 4, 2026 by vercel[bot]
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.

Zone drawing and room calibration get stuck if the pointer is cancelled mid-drag

2 participants