Seating: a cancelled drag no longer strands a half-drawn zone or calibration line - #92
Merged
Merged
Conversation
… 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
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
startZoneDrawandstartCalibrateinRoomCanvas.tsxlistened forpointermoveandpointeruponly. The new test reproduced both halves of the problem onmain:pointercancelthe.draftZoneelement was still rendered;window, so the next release anywhere committed a zone nobody drew. That leak even made the third test count two zones onmain.Fix
A shared
stop()removes all three listeners and clears the draft.pointerupcommits and then stops, as before.pointercancelonly 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
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 onmainand pass now.🤖 Generated with Claude Code
https://claude.ai/code/session_01VhFp1PtVBwgmxST9ZrRTEs
Generated by Claude Code