Explorer must stay standalone when no folder is opened: "No Folder Opened" view is missing `canMoveView`
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
- VS Code Version: 1.136.2 (88e44fa0e00b08f7758b4f6d05632e4fd5e4df6f, 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
1. Open a folder.
2. Drag **Explorer → Folders** onto the Panel, into the same container as Terminal / Source Control / Search. They sit side by side. ✔
3. Close the folder (or open a new empty window, Cmd+Shift+N).
4. 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`:
https://github.com/microsoft/vscode/blob/0af2bfdddee61954b27fdb831f7a8b20a139126b/src/vs/workbench/contrib/files/browser/explorerViewlet.ts#L125-L152
`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.
Contributor guide
Assessment
This issue has not been assessed yet.