-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable dragging tabs between windows (#14901)
_Behold, the penultimate chapter in the saga of tear-out! This significant update bestows upon the user the power to transport tabs betwixt Terminal windows. Alas, the drag and drop capabilities of TabView are not yet refined, so this PR primarily concerns itself with the intricacies of plumbing. When a tab is extracted and deposited elsewhere, it is necessary to have the recipient make an inquiry to the Monarch, who in turn will beseech the sender to transmit the tab content, akin to the act of moving a tab. Curious it may seem, but the method has proven effective._ The penultimate tear-out PR. This PR enables the user to move tabs from one Terminal window to another. The TabView drag/drop APIs have some rough edges, so this PR is mostly plumbing. When a tab is drag/dropped, we need to get the recipient to ask the Monarch to ask the sender to send the tab content, like a MoveTab action. Wacky, but it works. There's a LONG tail of UX gaps. Those I'm going to track in #14900. It is more valuable for us to merge this now than to figure out workarounds immediately. The next PR will be the last main PR in this saga - in which we enable dragging a tab out of the window and dropping to create a new window. * Closes #1256 * Related to #5000 * Follow-ups get to go in #14900 ## Detailed description As I mentioned, it's mostly plumbing. The order that we get tab drag events is... unfortunate... for our use case. So we do a lot of sending `RequestReceiveContentArgs` up and down between windows, just to communicate who the tab was dropped on to whomever the tab was dragged from. There's a diagram for this that I originally put in #5000 (comment): ```mermaid sequenceDiagram participant Source participant Target participant Monarch Note Left of Source: _onTabDragStarting Source --> Source: stash dragged content Source --> Source: pack window ID into DataPackage Source ->> Target: Drag tab Note right of Target: _onTabStripDragOver Target ->> Target: AcceptedOperation(DataPackageOperation::Move) Source --> Target: Release mouse (to drop) Note right of Target: _onTabStripDrop Target --> Target: get WindowID from DataPackage Target -) Monarch: Request that WindowID sends content to us<br>RequestRecieveContent Monarch -) Source: Tell to send content to Target.Id<br>RequestSendContent, SendContent Source --> Source: detach our content Source -) Monarch: RequestMoveContent(stashed, target.id) Monarch -) Target: AttachContent(stashed) # Target -->> Source: # Note Left of Source: TabViewTabDragStartingEventArgs<br>.OperationCompleted # Note Left of Source: _onTabDroppedCompleted ``` Really really though, let's try to avoid nits about the UX at this time. This PR works with what we've got. Mail threads are percolating. I've got 19 chapters worth of Hobbit branch names to use for those follow ups.
- Loading branch information
1 parent
17a5b77
commit 9514c11
Showing
21 changed files
with
364 additions
and
14 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.