Skip to content

Dragging Folders from File System into VS Code PWA #141935

@Offroaders123

Description

@Offroaders123

With the standard Electron version of VS Code, the user is able to drag folders into the workspace from the File System, and it will open that folder in the current window.

I tried using this feature while editing my projects with the PWA version of VS Code at https://vscode.dev, however the folder did not open in the Workspace, as it does with the Electron version. I was using the VS Code PWA on Chrome OS with Chrome 97 installed.

In browsers that support the File System Access API, element drop events have the ability to return FileSystemDirectoryHandle objects after using the getAsFileSystemHandle() method on any DataTransferItem entries present on the event, if the user is dragging a folder. This would allow the user to drop a folder into the Workspace, and using the DataTransferItem entry to open
that folder with the Workspace.

This would be a very helpful feature to also have with the PWA version, it provides another way that the user can open folders from the file system, alongside the currently available "Open Folder" button in the Explorer menu.

Great work on the progress of the PWA by the way, it is working awesome so far!

Here's a reference to the information I found about the DataTransferItem.getAsFileSystemHandle() feature I mentioned above:
https://web.dev/file-system-access/#drag-and-drop-integration

Metadata

Metadata

Labels

feature-requestRequest for new features or functionalityon-release-notesIssue/pull request mentioned in release noteson-testplanvscode.devIssues related to vscode.devwebIssues related to running VSCode in the webworkbench-dndDrag-and-drop issues

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions