-
Notifications
You must be signed in to change notification settings - Fork 29.5k
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
Redo created file fails #111640
Comments
@aeschli I tried reproducing this and it requires some effort
Step 3. is expected as we discussed #111659 |
The editor never forwards the redo nor undo to the explorer. The editor takes the current focused file, reads the URL from that and finds an undo/redo element with that URL in the undo/redo stack. So if you create a file called A.txt and open it and focus it in the editor. If you run undo, the undo/redo elements for file A.txt are searched and executed. So an undo results in the deletion of the file, so the file is gone. After this, if the focus is moved to a file B.txt that you had opened (in a background tab or something), the focus is in the file B.txt. So running redo will run redo any elements related to file B.txt. I am not sure what to do here, this works exactly as implemented. @isidorn Please let me know what you would like to be done differently by the undo/redo service. So IMHO step 4 is 100% as designed. If at step 4 the focus goes to B.txt, the redo will redo in B.txt, not in A.txt. By the way, I agree this is bad, but at this point I suggest we don't offer an undo of file creation. cc @jrieken for opinions. |
Well, maybe that's what it should do? Like, when a |
@alexdima thanks for clarifying. I see how the undo can only be done from the explorer which does not have focus in this case. After we get more user feedback we might change if the explorer undo requires focus in the explorer... |
Yes, but the issue will remain and this might have unexpected consequences e.g. undoing in not visible files. e.g.
I think it is dangerous to undo undo-redo elements not associated with the current focused editor because edits occur which are invisible to the user. I also agree that it is surprising that you create a file, type in it, hold cmd+z and the file disappears. I would expect that cmd+z stops when the file is empty. It feels to me that perhaps operations originating from the explorer should not be undoable from the editor... But that would ruin the java rename refactoring case, which would became undoable only when moving focus to the explorer. Thoughts? |
@alexdima I see the issue. I was pondering about this a bit more and my feeling is:
As I mentioned in other issues, I would probably not change anything here for Endgame, and in Debt week we can decide on a stragety. My other concern is even if we change the third bullet point I think users will still be confused by undo not working in Explorer since the Explorer passes focus into the editor in some cases automatically. |
I agree with you @isidorn . My concern is that we might have to do a recovery build if many people are confused and we might have to live with this until end of January. We could do the following: undoing from the editor will undo operations inserted by the explorer, but if it hits an undo-redo element inserted by the explorer, it could first prompt to confirm. |
That sounds like a good approach to me. |
Looks good! I can also fine tune the label from the Explorer. |
👍 I like |
I like the flow, played around it a bit more... Fyi testers for potential feedback @aeschli @meganrogge @rebornix Gist of the above discussion: when there is an "aggresive" undo from the editor we now prompt. |
Maybe deleting a file (undoing a create, copy, move) should always prompt, regardless if invoked from the editor and explorer. |
@aeschli makes sense, however you can always redo to bring it back. So for now I would not prompt, but I am open to changing this. |
I beleive we are good here, since we now also introduced a prompt for destructive operations. I am currently not prompting for undoing a move or copy - since you do not get data loss then. Though I am open to changing that. Thus closing this |
Testing #111015
Edit > Undo
. File is gone ✔️Edit > Redo
. Nothing happensThe text was updated successfully, but these errors were encountered: