Skip to content

Restore file list when canceling folder creation in simple file dialog#320388

Merged
alexr00 merged 3 commits into
mainfrom
copilot/fix-folder-creation-cancel
Jun 19, 2026
Merged

Restore file list when canceling folder creation in simple file dialog#320388
alexr00 merged 3 commits into
mainfrom
copilot/fix-folder-creation-cancel

Conversation

Copilot AI commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

When opening a non-existent folder via the simple file dialog, the user is asked "Would you like to create it?". Canceling that prompt returned the user to the path input but with an empty file/folder list.

Root cause

QuickPick shares a single underlying UI list across instances. Showing the yes/no prompt replaces the list contents, and QuickPick.update() only re-pushes items to the UI when itemsUpdated is set — a flag toggled only by the items setter. Re-showing the original file picker therefore leaves the shared list empty.

Changes

  • In SimpleFileDialog.yesNoPrompt's onDidHide handler, after re-showing filePickBox, reassign its items to itself to flip itemsUpdated and force the UI list to repopulate.

Copilot AI requested review from Copilot and removed request for Copilot June 8, 2026 10:37
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot June 8, 2026 10:50
Copilot AI changed the title [WIP] Fix file list restoration after canceling folder creation Restore file list when canceling folder creation in simple file dialog Jun 8, 2026
Copilot AI requested a review from alexr00 June 8, 2026 10:50
@alexr00 alexr00 marked this pull request as ready for review June 19, 2026 15:25
Copilot AI review requested due to automatic review settings June 19, 2026 15:25

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

This PR fixes a UI regression in the workbench’s SimpleFileDialog where canceling the “Would you like to create it?” prompt (shown for non-existent folders) returns to the path input with an empty file/folder list due to QuickPick list state being shared across quick pick instances.

Changes:

  • After re-showing the original file picker (filePickBox) from the yes/no prompt’s onDidHide, forces a re-render of the picker’s items by re-assigning filePickBox.items to itself.
Show a summary per file
File Description
src/vs/workbench/services/dialogs/browser/simpleFileDialog.ts Forces the file picker to repopulate its shared QuickPick list after returning from the create-folder confirmation prompt.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 1

Comment thread src/vs/workbench/services/dialogs/browser/simpleFileDialog.ts Outdated
@alexr00 alexr00 merged commit 01ffe49 into main Jun 19, 2026
25 checks passed
@alexr00 alexr00 deleted the copilot/fix-folder-creation-cancel branch June 19, 2026 17:04
@vs-code-engineering vs-code-engineering Bot added this to the 1.126.0 milestone Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Simple file dialog - cancel the folder creation does not restore the file list

4 participants