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

Enable Drag and Drop for views #90917

Merged
merged 3 commits into from
Feb 20, 2020
Merged

Enable Drag and Drop for views #90917

merged 3 commits into from
Feb 20, 2020

Conversation

sbatten
Copy link
Member

@sbatten sbatten commented Feb 18, 2020

#89729

Allows dragging views between containers (both existing and panel area).

Insights from testing:

  • We should probably allow dropping into the sidebar, not just the activity bar as this was my natural instinct.
  • We need to disable dropping in some containers (extensions viewlet)
  • We should have better dragging animations to make it easier to assess what's going on. e.g. a plus icon in the composite area if a new composite is generated.

@sbatten sbatten self-assigned this Feb 18, 2020
@sbatten sbatten added the workbench-views Workbench view issues label Feb 18, 2020
@sbatten sbatten added this to the February 2020 milestone Feb 18, 2020
src/vs/workbench/browser/parts/views/viewPaneContainer.ts Outdated Show resolved Hide resolved
src/vs/workbench/browser/parts/compositeBar.ts Outdated Show resolved Hide resolved
@@ -134,6 +142,18 @@ export class CompositeBar extends Widget implements ICompositeBar {
}
}
}

if (this.compositeTransfer.hasData(DraggedViewIdentifier.prototype)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels like we are duplicating this code in the compositeBar and compositeBarActions. Is it possible to have this code unified in one location?

@@ -128,6 +128,53 @@ export class ActivitybarPart extends Part implements IActivityBarService {
getContextMenuActionsForComposite: () => [],
getDefaultCompositeId: () => this.viewletService.getDefaultViewletId(),
hidePart: () => this.layoutService.setSideBarHidden(true),
dndHandler: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like we are duplicating this code in the activityBar and the panelPart.
Could we use some shared CompositeDragAndDrop to be shared between this two parts?

@sbatten sbatten merged commit ca05440 into microsoft:master Feb 20, 2020
@sbatten sbatten deleted the dndviews branch February 20, 2020 15:26
@github-actions github-actions bot locked and limited conversation to collaborators Apr 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
workbench-views Workbench view issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants