Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prompt before destructive Explorer undo #112706

Closed
chindathorn opened this issue Dec 17, 2020 · 4 comments
Closed

Prompt before destructive Explorer undo #112706

chindathorn opened this issue Dec 17, 2020 · 4 comments
Assignees
Labels
feature-request Request for new features or functionality file-explorer Explorer widget issues insiders-released Patch has been released in VS Code Insiders undo-redo Issues around undo/redo verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@chindathorn
Copy link

Issue Type: Feature Request

Please remove "Undo feature" (Ctrl+z) in file explorer side. I have created lots of files and when I tab from text editor to the file explorer tab side, by accidentally press Ctrl+z it undoes all my created files. so I lost a lot of codes. Sad with Ctrl+z feature in file explorer VSCode.

VS Code version: Code 1.52.1 (ea3859d, 2020-12-16T16:34:46.910Z)
OS version: Windows_NT x64 10.0.18363

@isidorn isidorn added feature-request Request for new features or functionality file-explorer Explorer widget issues and removed new release labels Dec 17, 2020
@isidorn isidorn added this to the Backlog milestone Dec 17, 2020
@microsoft microsoft deleted a comment from vscodebot bot Dec 17, 2020
@isidorn
Copy link
Contributor

isidorn commented Dec 17, 2020

Thanks for feedback. We will not remove it, but we might introduce a prompt.
Let's leave this open for now so other users can also chime in with their opinion.

@isidorn isidorn changed the title Undo mistake Prompt before destructive Explorer undo Dec 17, 2020
@johnchurchill
Copy link

johnchurchill commented Dec 26, 2020

This (combined with #111640) is the most dangerous behavior of VS Code that I have encountered (actually, of any IDE, ever). I lost hours of uncommitted work by pressing Cmd-Z just 4 times when I thought the editor had context. It's baffling that the explorer pane has its own memento stack so it will delete files created days earlier after numerous changes in the editor pane. Worse, I can't even reproduce it with a fresh run, which tells me that VS code is getting its undo stack confused after hundreds of edits.

My suggestion is that the explorer pane not have any undo functionality (or at least make it an opt-in setting). It doesn't make sense to even try when the majority of files appear and disappear though external means (e.g. ng generate or git branch operations).

@isidorn
Copy link
Contributor

isidorn commented Jan 18, 2021

Thanks to work with @alexdima we have now changed that we prompt when undoing a creation operation
We can change this to prompt in more cases if needed.
Try it out and let us know how it goes. We can also add an option "Do not show again", but let's not do this yet (since we can only nicely reset this if we introduce a setting).

fyi @jrieken in case you are interested in changes d427dea
I think it was pretty straight forward.

@isidorn isidorn added the verification-needed Verification of issue is requested label Jan 18, 2021
@isidorn
Copy link
Contributor

isidorn commented Jan 18, 2021

To verify:

  1. Creat a file or folder in Explorer
  2. Make sure focus is in Explorer
  3. Undo. Make sure you are Prompted
  4. Do a bit more of undo, and make sure you are always prompted exactly once when doing a destructive undo

@lramos15 lramos15 added the verified Verification succeeded label Jan 26, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Mar 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality file-explorer Explorer widget issues insiders-released Patch has been released in VS Code Insiders undo-redo Issues around undo/redo verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants
@isidorn @johnchurchill @lramos15 @chindathorn and others