Conversation
This branch has not been 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.
Summary
Cancel abandoned in-app drag sessions when the window loses focus, the initiating handle loses pointer capture, or a subsequent pointer move reports the primary button already released. Restore cursor/selection state, remove listeners, release guards, and clear drag/drop stores without committing a drop or swallowing the next independent click.
The shared primitive covers pane tabs (including Sessions), pane handles, and sidebar session drags. Normal taps, committed drops, and Escape cancellation keep their existing semantics. Pointer events are scoped to the initiating pointer and teardown is idempotent because releasing capture may itself trigger capture-loss notification.
RED proof
Command, from
apps/desktop:Before the production fix, all three interruption cases failed:
After the fix:
The normal tap/drop control passed before and after. Tests execute
startDragSessionand dispatch events; they do not assert source spelling. The existing session-drop fixture now supplies the pointer identity and button state of an actual held-pointer gesture.Code path trace
startDragSession; movement past the threshold captures the pointer, disables selection, installs a guest-pointer guard and publishes drag state.pointerup,pointercancel, or Escape ended the session. Focus/capture loss was ignored, and a subsequent move withbuttons=0continued an abandoned drag.Widening audit
Verification
From
apps/desktop:npx vitest run src/components/pane-shell/tree src/app/chat/session-drag.test.ts: 32 files, 168 tests passed.npx tsc -p tsconfig.json --noEmit: passed.git diff --check: passed.Scope and native QA limitation
Investigation began with a macOS report of an unresponsive sidebar after interacting with a narrow Sessions titlebar tab. This PR proves and fixes the interrupted-drag lifecycle defect; it does not claim to have reproduced the original macOS compositor/window-move sequence. Validation above is Linux/jsdom, not a native macOS end-to-end test. No changes to Electron drag-region geometry are included.
Native follow-up: start dragging a Sessions tab, switch focus or release outside the renderer, return, and verify the next sidebar click works without Escape. Also verify ordinary tab reorder/docking and window dragging remain functional. If the original simple-click symptom persists, inspect native hit-testing separately rather than treating these unit tests as proof of that symptom's resolution.