Repository navigation
Make the empty Explorer view movable - #335999
Merged
Dmitriy Vasyura (dmitrivMS) merged 1 commit intoSep 22, 2026
Merged
Dmitriy Vasyura (dmitrivMS) merged 1 commit into
Dmitriy Vasyura (dmitrivMS) merged 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused change aligns the empty view with existing Explorer descriptors and movement infrastructure.
Pull request overview
Enables the empty Explorer view to participate in standard view movement behavior.
Changes:
- Marks “No Folder Opened” as movable.
- Enables consistent view/container dragging in empty windows.
File summaries
| File | Description |
|---|---|
src/vs/workbench/contrib/files/browser/explorerViewlet.ts |
Enables movement for the empty Explorer view descriptor. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Balanced (auto)
Note
Copilot is running an experiment and ran this review at Balanced.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
`createEmptyViewDescriptor()` was missing `canMoveView: true`, which its siblings (Folders, Open Editors) both set. As a result the "No Folder Opened" view could not be dragged into another view container, so a layout built with a folder open could not be reproduced in an empty window. Fixes microsoft#335217
Megafia
force-pushed
the
fix/empty-explorer-view-can-move
branch
from
September 13, 2026 01:14
2f48146 to
cda2b40
Compare
Logan Ramos (lramos15)
approved these changes
Sep 22, 2026
Anthony Kim (anthonykim1)
approved these changes
Sep 22, 2026
Dmitriy Vasyura (dmitrivMS)
approved these changes
Sep 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #335217
The problem
With a folder open, the Explorer's Folders view can be dragged into any other view container — for example into a Panel container shared with Terminal, Source Control and Search.
With no folder open, that is not possible. The Explorer shows No Folder Opened (
workbench.explorer.emptyView) instead, and that view cannot be dragged at all. A layout built with a folder open therefore cannot be reproduced in an empty window, and the Explorer jumps back out into its own container whenever the last folder is closed or a new empty window is opened.The cause
createEmptyViewDescriptor()does not setcanMoveView. Its two siblings in the same file do:canMoveViewcreateOpenEditorsViewDescriptor()truecreateExplorerViewDescriptor()(Folders)truecreateEmptyViewDescriptor()(No Folder Opened)canMoveViewis optional andundefinedis falsy, so both the drag source and the drop targets inviewPaneContainer.tsreject the view.This looks like an oversight rather than a deliberate restriction: 6ee9724 ("Explore making the explorer a moveable view") added the flag to the Folders descriptor and did not touch the empty view, even though the two views are swapped in and out by the same code path in
ExplorerViewletViewsContribution.registerViews().The change
Add
canMoveView: truetocreateEmptyViewDescriptor().The empty view is registered and deregistered as the workbench state changes, but that is already handled:
regroupViews()inviewDescriptorService.tsconsults each view's persisted custom location on both register and deregister, so a moved empty view is removed from — and later restored to — wherever the user put it. The Folders view already relies on this same machinery. View welcome content is registered againstEmptyView.ID, so it travels with the view.Note for reviewers
This also makes the Explorer container draggable in an empty window. Container-level drag is gated on every view in the container being movable (
viewPaneContainer.ts), which the empty view's missing flag currently blocks. After this change an empty window behaves like a window with a folder open, where Folders and Open Editors are both movable. That seems desirable and consistent, but it is a second behavioural effect and is not mentioned in the issue.Verification
vs/workbench/services/views/test/**— 37 passingvs/workbench/contrib/files/test/**— 125 passingvs/workbench/**— 15207 passing(
ModernUIContribution > pane composite actions fill regular and Agents headersfails in the full workbench run, but it fails identically on an unmodifiedmainand is unrelated to this change.)