fix(strip): a pill no longer sticks to the cursor after a missed release - #586
Merged
Merged
Conversation
On Linux/Wayland a mouse press on a pill (or a row in the All Sessions menu) takes no pointer capture, so the browser can start its own drag. A release anywhere else never reached handlePointerUp: the press stayed armed, and the next time the cursor crossed the strip the pill was picked up and followed the mouse. Two guards: a window-level pointerup while a press is armed ends it, and a pointer move with no button held abandons a stale press outright. SessionStrip.tsx line budget 2784 -> 2820: the two guards and their WHY comments; nothing in the file is a natural split point for them. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Destin: "sessions in the switcher sometimes seem to get stuck to my mouse and slide around even when i've clicked away from the switcher or didn't intend to drag."
Cause: on Linux/Wayland (
html-dragmodel) a mouse press takes no pointer capture, so a release that landed off the strip never reachedhandlePointerUp. The press stayed armed, and the next time the cursor crossed the strip the pill was picked up and followed it.Fix:
pointerup(plus touchpointercancel) is registered only while a press is armed; it abandons a press whose release the strip missed.pointermovewith no primary button held abandons a stale press. The synthetic dragover feed passes nobuttonsand is exempt.Verification:
SessionStrip.test.tsx. Both were red before the fix, and each goes red again when its half of the fix is removed.verify.sh: all checks pass.drag-fuzz(3 seeds × mouse/touch, 40 drags each): contact, reversal, others and blink all 0. Continuity 23.3 is identical on the unfixed baseline, so it predates this change.SessionStrip.tsxline budget 2784 → 2820 for the two guards.🤖 Generated with Claude Code