Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MEGATHREAD] Tab drag/drop/tear-out gaps #14900

Open
19 tasks
zadjii-msft opened this issue Feb 23, 2023 · 4 comments
Open
19 tasks

[MEGATHREAD] Tab drag/drop/tear-out gaps #14900

zadjii-msft opened this issue Feb 23, 2023 · 4 comments
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal External-Blocked-WinUI3 We can't progress until WinUI3 exists. Issue-Scenario Product-Terminal The new Windows Terminal.
Milestone

Comments

@zadjii-msft
Copy link
Member

zadjii-msft commented Feb 23, 2023

A follow-up to #1256 and #5000. Now that those are in the final stages, it has become more obvious where the papercuts lie.

We CANNOT fix it

"Tear out v1" gaps

Things that are obvious gaps in the initial version of drag/drop. Firefox-like (hopefully).

  • Tabs have no preview of what's being dragged
  • Tabs can only be dropped on the TabView, but not the whole titlebar
  • The tab item corners are rounded on top, and flat on the bottom
  • Dragging a tab off in space shows the red circle (not allowed) icon #15438
    • The tab view item shows a 🚫 when dragging over not the Terminal, even though you totally can just drop there to make a new window
    • There is a way in the Sept'23 OS release to suppress the drag icon, however, this ENTIRELY suppresses the drag icon. That means there's no Move ↗ for successful ones, either. So that's ridiculous.
  • VsCode shows that it can accept a "Move" of a Terminal tab, even though that's obviously insane
  • The tab view of the target doesn't expand to make room for the new tab. It makes a gap, but it doesn't increase its width, so the existing tabs are clipped on the right
  • The target doesn't show a preview of the dragged tab's content "in place" when hovering over the tab view
  • We shouldn't "animate in" tab items when dropping. They should just appear
    • It wasn't trivial to just AllowDependentAnimations(false) then re-enable. Presumably they're independent animations
  • pressing escape should stop the drag and put the window back where it started
  • while tab dragging, if you drag over another window (and switch to 'move' in the image being dragged), the window you've dragged over should be raised in zorder. this could expose places to drop the tab.
  • if window is snapped and you drag a tab out, you're using the snap rect (so, left snap and drag out would be as tall as the monitor). You should use the normal position, GetWindowPlacement
  • Dragging a Tab across a DPI doesn't re-scale the tab item during the drag microsoft-ui-xaml#8442

The fullness of time gaps

Given infinite engineering resources, what would we like the experience to be? Basically, Chromium-like or better.

Note that this experience is currently blocked entirely for Terminal. We'll need to be able to switch to WinUI 3 (WASDK 1.6) before we can use the new tab APIs they provided

  • [megathread] Chromium parity for tab drag/drop #16129
    • Including, but not limited to:
    • Tabs should make a new window as soon as their torn out
    • Torn-out tabs need to be able to snap to snap positions (maximized, snap layouts) without dropping first
    • Multiple tabs can't be dragged/dropped all at once
    • Dragging a tab in a window with a single tab should just drag the window

Resources

Notes to myself on internal threads to investigate

  • MSFT:42334223: TabView Crash when moving tab in dozens of tabs
  • os.2020!8180615: Suppressing drag feedback icon while dragging a tab
@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Feb 23, 2023
@zadjii-msft zadjii-msft changed the title <Reserved> [MEGATHREAD] Tab drag/drop/tear-out gaps Feb 23, 2023
@zadjii-msft zadjii-msft added Area-User Interface Issues pertaining to the user interface of the Console or Terminal Product-Terminal The new Windows Terminal. Issue-Scenario labels Feb 23, 2023
@zadjii-msft zadjii-msft added this to the Megathreads milestone Feb 23, 2023
@zadjii-msft zadjii-msft removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Feb 23, 2023
@DHowett

This comment was marked as off-topic.

@zadjii-msft

This comment was marked as off-topic.

zadjii-msft added a commit that referenced this issue Mar 30, 2023
_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.
@zadjii-msft zadjii-msft added the External-Blocked-WinUI3 We can't progress until WinUI3 exists. label May 8, 2024
@zadjii-msft
Copy link
Member Author

Pretty sure just about everything in this thread would get solved by the WinUI 3 tab tear-out implementation if we could move to it

@jamesdeluk
Copy link

jamesdeluk commented Sep 19, 2024

There's not a "merge all windows/tabs into single window" option yet, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal External-Blocked-WinUI3 We can't progress until WinUI3 exists. Issue-Scenario Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

3 participants