microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.94k stars 29.18k forks source link

Views drag and drop: allow to drop into the entire bar instead of splitting #232232

Open isidorn opened 1 week ago

isidorn commented 1 week ago

Right now for me to drag and drop a view in the secondary sidebar I have to drop it in the small title area of the secondary sidebar. If I drop it in the large view area, it basically splits the view container.

I know this logically makes sense, but makes the whole DnD experience unusable.

Could DnD see if I am dragging the only view in the container, and if yes always drop it as a separate container? I am constantly being bitten by this (even with previous DnD scenarios).

bpasero commented 6 days ago

@isidorn but that is not specific to the secondary sidebar, no? that is true for primary and panel as well. Are you suggesting to change this only for secondary sidebar?

isidorn commented 6 days ago

I would change it for the primary sidebar as well. Start of insiders, and we see if we get complaints.

I understand that I would be breaking one flow. But could we do something similar to editor groups? If I drop over the editor group it is a brand new editor, if I drop in the bottom/top 10% I get the split

bpasero commented 6 days ago

Aligning with how it works with editors could work, even though its overall a smaller hit area.

//cc @sandy081 @sbatten for thoughts

benibenj commented 6 days ago

Worth exploring. I do see there being a couple of weird scenarios. Also, I don't think it will fell as natural/intuative as for the editor grid due to the smaller hit area, but it might still work.

bpasero commented 6 days ago

The reason I like this idea is that I wonder if the 80% case is to move a view into the bar instead of splitting. Also for the editor, the hit zone to move is much larger than splitting. I would think for views its even more a case of moving vs. splitting.

isidorn commented 6 days ago

Keep in mind that the vertical hit zone in sidebar is same length as in editor area. So imho it might work.

if the 80% case is to move a view into the bar instead of splitting

This is the key point here 💯

sandy081 commented 6 days ago

I think it makes sense. I think it is more intuitive that moving a view container from one location to another should just change its location instead of merging it into another view container. This should be true for all locations (Primary Sidebar, Secondary Sidebar, Panel). If user moves the view container on top of the another view in the same location, then it should move all views.

sbatten commented 6 days ago

Can we borrow the drag and drop behavior from editor where you can hold shift to drop into the editor instead of splitting the editors. Cases would be:

Weird case: dragging a view container from the same panel/composite into another view container. Following the rules above, the default action would be a no-op as you would just move the view container in the composite bar. There shouldn't be ambiguity here though, we should just split.