Skip to content

fix(strip): a pill no longer sticks to the cursor after a missed release - #586

Merged
itsdestin merged 1 commit into
masterfrom
session/switcher-drag-stuck
Sep 28, 2026
Merged

itsdestin merged 1 commit into
masterfrom
session/switcher-drag-stuck

Conversation

@itsdestin

Copy link
Copy Markdown
Owner

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-drag model) a mouse press takes no pointer capture, so a release that landed off the strip never reached handlePointerUp. The press stayed armed, and the next time the cursor crossed the strip the pill was picked up and followed it.

Fix:

  • A window-level pointerup (plus touch pointercancel) is registered only while a press is armed; it abandons a press whose release the strip missed.
  • A pointermove with no primary button held abandons a stale press. The synthetic dragover feed passes no buttons and is exempt.

Verification:

  • Two new tests in 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.tsx line budget 2784 → 2820 for the two guards.

🤖 Generated with Claude Code

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>
@itsdestin
itsdestin merged commit 4859a26 into master Sep 28, 2026
4 checks passed
@itsdestin
itsdestin deleted the session/switcher-drag-stuck branch September 28, 2026 23:37
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