Skip to content

Allow simple file dialog to create nested folders - #321355

Merged
Alex Ross (alexr00) merged 5 commits into
microsoft:mainfrom
pony-maggie:fix-simple-dialog-nested-folder-create
Jul 15, 2026
Merged

Alex Ross (alexr00) merged 5 commits into
microsoft:mainfrom
pony-maggie:fix-simple-dialog-nested-folder-create

Conversation

@pony-maggie

Copy link
Copy Markdown
Contributor

Fixes #320447

This updates the simple file dialog folder-only open flow to allow creating a nested missing folder path when the nearest existing ancestor is a writable directory. The actual creation still uses fileService.createFolder, which already performs recursive mkdir.

Validation now walks up the missing path, checking each missing basename before prompting to create the requested folder.

Verification:

  • PATH="/opt/homebrew/opt/node@24/bin:$PATH" npm run compile-client
  • red/green regression: the new browser test failed before the fix with false === true, then passed after the fix
  • PATH="/opt/homebrew/opt/node@24/bin:$PATH" npm run test-browser-no-install -- --run src/vs/workbench/services/dialogs/test/browser/simpleFileDialog.test.ts --browser chromium-chrome
  • git diff --check HEAD~1..HEAD
Copilot AI review requested due to automatic review settings June 15, 2026 02:12
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Alex Ross (@alexr00)

Matched files:

  • src/vs/workbench/services/dialogs/browser/simpleFileDialog.ts
  • src/vs/workbench/services/dialogs/test/browser/simpleFileDialog.test.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR improves SimpleFileDialog open-validation by allowing folder creation prompts when the selected folder doesn’t exist but a writable ancestor does, and adds a browser test to validate nested folder creation behavior.

Changes:

  • Update open-dialog validation to allow creating missing nested folders when an ancestor directory is writable.
  • Add canCreateFolder() helper to determine whether folder creation is possible by walking up the URI.
  • Add a new browser test covering nested folder creation from a folder-only open dialog.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
src/vs/workbench/services/dialogs/test/browser/simpleFileDialog.test.ts Adds coverage for creating nested missing folders via the open dialog validation path.
src/vs/workbench/services/dialogs/browser/simpleFileDialog.ts Introduces ancestor-writability check (canCreateFolder) and uses it to decide whether to prompt for folder creation.
@pony-maggie

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

@alexr00 Alex Ross (alexr00) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR!

@alexr00
Alex Ross (alexr00) enabled auto-merge (squash) July 15, 2026 10:03
@alexr00
Alex Ross (alexr00) merged commit cc33502 into microsoft:main Jul 15, 2026
29 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.130.0 milestone Jul 15, 2026
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Oct 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

5 participants