Repository navigation
Studio: hold the sidebar drag escape click guard until the button comes up - #11568
Merged
Merged
Conversation
Escape cancels while the button is still down, and the release comes later. The guard was armed at the keypress and torn down on the next tick, so releasing over the source row opened the chat the drag had just been cancelled out of. The gesture keeps its listeners through escape now. The release is what detaches, swallows the click and, being escaped, drops nothing.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
shaojun
pushed a commit
to shaojun/unsloth
that referenced
this pull request
Sep 29, 2026
Escape cancels while the button is still down, and the release comes later. The guard was armed at the keypress and torn down on the next tick, so releasing over the source row opened the chat the drag had just been cancelled out of. The gesture keeps its listeners through escape now. The release is what detaches, swallows the click and, being escaped, drops nothing. Co-authored-by: Unsloth <[email protected]>
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.
Follow-up to #11373 and #11561, which is already merged. Codex found this on #11561 after it landed, so it comes as its own PR.
The bug
Escape cancels a drag, but the button is usually still down when it is pressed.
swallowClickarmed a capture-phase click listener and removed it on a zero-delay timer, so by the time the user actually let go, the guard was long gone. Releasing over the row the drag started on opened that chat, or toggled that folder, straight after cancelling out of the drag.The same guard is correct on the drop path, where the release is what calls it and the click follows immediately.
The fix
Escape no longer ends the gesture. It marks it escaped, clears the drag, and leaves the pointer listeners in place, so the release, whenever it comes, is still ours: that is what detaches, swallows the click, and returns without a drop. A move after escape is ignored, so a cancelled drag cannot come back to life under a pointer that keeps travelling.
Escape before the threshold is unchanged and still abandons the press outright. Nothing was lifted, so a click after it belongs to the row.
Tests
npm run testpasses 8469.sidebar-row-drag.test.tscovers the release owning the swallow, escape not detaching while the button is down, and a move after escape staying inert.