Skip to content

fix(tab-strip): settle a tab drag the app reads after its release - #4403

Open
datlechin wants to merge 3 commits into
mainfrom
fix/editor-tab-drag-after-release
Open

datlechin wants to merge 3 commits into
mainfrom
fix/editor-tab-drag-after-release

Conversation

@datlechin

@datlechin datlechin commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Fixes the flaky EditorTabDetachUITests.testDraggingATabOutOfTheStripOpensItInItsOwnWindow at its cause, in the app.
  • Cause: with the main thread busy, the tab reads the press, the drag and the release from the queue after the button is already up. mouseDragged then started an NSDraggingSession, which never sees the release.
  • EditorTabItemView starts a session only while the primary button is down. Otherwise the queued mouseUp settles the drop at the release point: a strip under it reorders or receives the tab, anywhere else follows the session's tear-off rule.
  • performDragOperation and the late drop share the reorder and receive commits.
  • EditorTabStripView.isPrimaryButtonDown is injectable for tests; dragDidEnd reads it too.
  • A deferred drag watches for Escape like a session does, so an Escape read before the queued release cancels it.

Test plan

  • New EditorTabLateDragTests: a late drag out of the strip starts no session and tears off at the release point; a tab the policy refuses opens nothing; Escape before the queued release cancels it, and the next late drag is not cancelled; a late drop reorders in its own strip, is received by another strip of the connection, is refused by another connection's; the release point resolves to the strip under it.
  • UI plan on CI, EditorTabDetachUITests unchanged: both cases passed on the first attempt in run 44895942030.

@datlechin datlechin added the backport release/0.88 Merged into main; pick onto release/0.88 label Nov 21, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport release/0.88 Merged into main; pick onto release/0.88

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant