Repository navigation
Description
- VS Code Version: 1.136.2 (88e44fa, arm64)
- OS Version: macOS 27.0 (arm64)
Summary
With a folder open, the Explorer's Folders view (workbench.explorer.fileView) can be dragged into any other view container — e.g. into a Panel container shared with Terminal, Source Control and Search — and it stays there.
With no folder open, that is impossible. The Explorer container can be moved to the Panel as a whole, but it can only ever exist as a standalone container: its single view, No Folder Opened (workbench.explorer.emptyView), cannot be dragged at all, so it cannot be merged next to other views. Every other view in my layout can be.
The net effect is that a layout built with a folder open cannot be reproduced in an empty window, and the Explorer visually "jumps" out of the Panel back into its own container whenever the last folder is closed or a new empty window is opened.
Steps to Reproduce
- Open a folder.
- Drag Explorer → Folders onto the Panel, into the same container as Terminal / Source Control / Search. They sit side by side. ✔
- Close the folder (or open a new empty window, Cmd+Shift+N).
- The Explorer is now a standalone container again. Try to drag No Folder Opened into the container holding Terminal / Source Control / Search.
Expected: the view can be dropped there, like every other movable view.
Actual: the view is not draggable and no drop target is offered; the Explorer stays standalone.
Root cause
createEmptyViewDescriptor() omits canMoveView, while its counterpart createExplorerViewDescriptor() sets canMoveView: true:
vscode/src/vs/workbench/contrib/files/browser/explorerViewlet.ts
Lines 125 to 152 in 0af2bfd
| private createEmptyViewDescriptor(): IViewDescriptor { | |
| return { | |
| id: EmptyView.ID, | |
| name: EmptyView.NAME, | |
| containerIcon: explorerViewIcon, | |
| ctorDescriptor: new SyncDescriptor(EmptyView), | |
| order: 1, | |
| canToggleVisibility: true, | |
| focusCommand: { | |
| id: 'workbench.explorer.fileView.focus' | |
| } | |
| }; | |
| } | |
| private createExplorerViewDescriptor(): IViewDescriptor { | |
| return { | |
| id: VIEW_ID, | |
| name: localize2('folders', "Folders"), | |
| containerIcon: explorerViewIcon, | |
| ctorDescriptor: new SyncDescriptor(ExplorerView), | |
| order: 1, | |
| canMoveView: true, | |
| canToggleVisibility: false, | |
| focusCommand: { | |
| id: 'workbench.explorer.fileView.focus' | |
| } | |
| }; | |
| } |
canMoveView is optional and undefined is falsy, so both the drag source and the drop target reject the view in viewPaneContainer.ts (if (viewDescriptor?.canMoveView) at L1319, and !viewDescriptor.canMoveView in the drop handlers at L439 / L908).
The two descriptors are already inconsistent in the other direction (canToggleVisibility is true for the empty view and false for the folders view), which suggests the missing flag is an oversight rather than a deliberate restriction. Adding canMoveView: true to createEmptyViewDescriptor() looks like it would be enough.
Activity
niccolomineo commentedon Sep 9, 2026
For whoever picks this up: the fix looks like a one-liner.
createEmptyViewDescriptor()just needs the samecanMoveView: trueits counterpartcreateExplorerViewDescriptor()already has, inexplorerViewlet.ts:private createEmptyViewDescriptor(): IViewDescriptor { return { id: EmptyView.ID, name: EmptyView.NAME, containerIcon: explorerViewIcon, ctorDescriptor: new SyncDescriptor(EmptyView), order: 1, + canMoveView: true, canToggleVisibility: true,I'm not planning to open a PR myself, so this is up for grabs — flagging it in case it's useful for triage.
Make the empty Explorer view movable
Make the empty Explorer view movable (#335999)