Skip to content

Explorer must stay standalone when no folder is opened: "No Folder Opened" view is missing canMoveView #335217

Closed

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

  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:

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

  1. niccolomineo commented on Sep 9, 2026

    @niccolomineo
    Author

    For whoever picks this up: the fix looks like a one-liner. createEmptyViewDescriptor() just needs the same canMoveView: true its counterpart createExplorerViewDescriptor() already has, in explorerViewlet.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.

  2. added
    bug
    file-explorer
    and removed on Sep 11, 2026
  3. added a commit that references this issue on Sep 13, 2026
    cda2b40
  4. added a commit that references this issue on Sep 22, 2026
    620a1b4
  5. added
    unreleased
    on Sep 22, 2026
  6. added this to the 1.140.0 milestone on Sep 22, 2026
  7. added
    insiders-released
    and removed
    unreleased
    on Sep 23, 2026
  8. locked and limited conversation to collaborators on Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugfile-explorerinsiders-releasedverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions