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

Undo text not working when focus is in file explorer #111630

Closed
aeschli opened this issue Dec 1, 2020 · 7 comments
Closed

Undo text not working when focus is in file explorer #111630

aeschli opened this issue Dec 1, 2020 · 7 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug file-explorer Explorer widget issues insiders-released Patch has been released in VS Code Insiders under-discussion Issue is under discussion for relevance, priority, approach undo-redo Issues around undo/redo verified Verification succeeded
Milestone

Comments

@aeschli
Copy link
Contributor

aeschli commented Dec 1, 2020

Testing #111015

  • In the VSCode repo, open src/vs/nls.build.js
  • add some content on the first line, save
  • in the file explorer rename the file to nls.build.js1
  • from the window menu, run Edit > Undo. File is renamed back ✔️
  • from the window menu, run Edit > Undo. Nothing happens, content change is not undone
  • but the focus in the editor, then undo works
@aeschli aeschli changed the title Undo text after undo file name not wodking Undo text after undo file name not working Dec 1, 2020
@isidorn isidorn self-assigned this Dec 1, 2020
@isidorn
Copy link
Contributor

isidorn commented Dec 1, 2020

We have decide to behave like this -> if focus is in explorer we do not undo the changes done in the editor.
We can easily change this, though I would like to gather more feedback before chaning anything here. Thus assigning to December and debt week.

@isidorn isidorn added file-explorer Explorer widget issues under-discussion Issue is under discussion for relevance, priority, approach undo-redo Issues around undo/redo labels Dec 1, 2020
@isidorn isidorn added this to the December/January 2021 milestone Dec 1, 2020
@alexdima alexdima changed the title Undo text after undo file name not working Undo text not working when focus is in file explorer Dec 2, 2020
@alexdima
Copy link
Member

alexdima commented Dec 2, 2020

I've changed the title to reflect easier repro steps:

  • type in editor
  • click in explorer
  • try to undo

@isidorn
Copy link
Contributor

isidorn commented Jan 15, 2021

The only negative feedback regarding undo is this issue #112706

Making the undo stack "shared" between the explorer and editor does not make a lot of sense to me since it is not really complementery with the current approach of each editor having it's own undo stack.

The only thing I would consider changing is: if the Explorer has no undo stack, then pressing undo when focus is in the Explorer would undo in the editor. @alexdima what do you think?

@alexdima
Copy link
Member

The only negative feedback regarding undo is this issue #112706

@isidorn I agree that we should prompt for destructive undos. Is that something I need to help you with or can you do it outside the undo redo service?

if the Explorer has no undo stack, then pressing undo when focus is in the Explorer would undo in the editor

I like this idea. I think you can do it on your side by doing something like this e.g.

image

@isidorn
Copy link
Contributor

isidorn commented Jan 18, 2021

@alexdima thanks. I just tried that and works as expected. Thus I pushed and closing this one since I would do no other changes here.

As for the prompt for desctructive undo, I think I can handle it from the DeleteOperation that is an undo.
I will create a PR to tackle that and we can continue the discussion #112706

@isidorn isidorn added the bug Issue identified by VS Code Team member as probable bug label Jan 18, 2021
@isidorn
Copy link
Contributor

isidorn commented Jan 18, 2021

Adding bug label so we get this verified, steps:

  • Reload vscode
  • Do some edits in the editor
  • Focus the explorer, press cmd + Z, the editor should undo

@isidorn
Copy link
Contributor

isidorn commented Jan 18, 2021

@alexdima on second thought I just remembered that the UndoRedoService already has a check here

So if I implement this in the DeleteOperation I might be duplicating code.
However I see that the UndoRedoService is unaware of what kind of an operation it is.

To sum it up I suggest:

  • Let's remove the check from the UndoRedoService
  • And have only a check in the DeleteOperation. That should catch both the new case, and the original case for which you introduced the check in the UndoRedoService

Let me know what you think

fyi @jrieken we are discussing to introduce a prompt before destructive undo operation. I am not sure if it would be a problem to prompt before all undo DeleteOperations. I would have a "Do not show again" checkbox.

@rzhao271 rzhao271 added the verified Verification succeeded label Jan 26, 2021
sbatten added a commit that referenced this issue Feb 6, 2021
* draft trusted workspace service / model

* renaming

* add request model and action

* err fix

* add request handlers with mock actions

* some quick fixes

* adding badge icon to activity bar gear

* Add Statusbar item to indicate trust

* Cleanup code

* Add background color

* Use theme color for the status background color

* adding basic editing experience

* observe trust with startup tasks

* Extension enablement

* Add capability to provide a custom message

* Remove old actions

* explorer: if you can not undo, pass undo to editor

fixes #111630

* Remove plug icon from ports view
Part of microsoft/vscode-internalbacklog#1689

* Fixed compilation error

* Handle extension uninstall

* Handle extension install

* Ability to prompt when state is untrusted

* Do not change state is the modal dialog is dismissed or the Cancel button is pressed

* Refactored enablement code

* Prompt when installing from VSIX

* Prompt when installing from the Gallery

* Move file into the browser folder

* fixes and polish

* restructure workspace contributions

* restructure actions and use confirmations

* Initial draft of the proposed APIs

* Added stubs for the proposed api

* Trusted Workspace proposed API

* Fix a regression introduced by merge

* status bar indicator improvements

* remove helper command as we now have hooks

* verbose messaging for the immediate request

* add indication to global activity icon of pending request

* try personal title

* Add configuration setting

* Add additional extension actions

* Fix contributions

* Removed context key that is not needed

* Fixed issue with the dialog

* Reduce arbitrary event limiter from 16ms down to 4.16666 (support for monitors up-to 240hz) #107016

* Fixes #115221: update emoji tests

* Give a higher priority to language configuration set via API call (#114684)

* debug console menu action polish

* Avoid the CSS general sibling combinator ~ for perf reasons

* more notebook todos

* Use label as tooltip fallback properly
Part of #115337

* Fixes microsoft/monaco-editor#2329: Move `registerThemingParticipant` call to `/editor/`

* Fix port label not always getting set
Part of microsoft/vscode-remote-release#4364

* simplify map creation, fyi @bpasero

* Fix #114432: Multiple save dialogs appearing on Windows if Ctrl+S is pressed multiple times (#114450)

* fix multiple save dialogs appearing on Windows when spamming Ctrl+S

* remove old fix and instead keep track of windows with open dialogs in the dialogMainService

* keep initialisation of activeWindowDialogs in constructor

* remove unused variable

* some changes

* queue dialogs based on hash of options

* simplify structure, fix comment typo

* Apply suggestions from code review

Co-authored-by: Benjamin Pasero <benjamin.pasero@gmail.com>

* remove unnecessary async/await for aquireFileDialogLock method

* don't acquire file dialog lock for message boxes

* use MessageBoxReturnValue | SaveDialogReturnValue | OpenDialogReturnValue instead of any type for getWindowDialogQueue

* Apply suggestions from code review

Co-authored-by: Benjamin Pasero <benjamin.pasero@gmail.com>

Co-authored-by: Benjamin Pasero <benjpas@microsoft.com>
Co-authored-by: Benjamin Pasero <benjamin.pasero@gmail.com>

* 💄 dialog main service locks

* debt - adopt some ? operator

* Better hiding of custom hover in icon label

* Limit to 8ms (120fps)

* more API todos for notebooks

* 💄

* Update grammars

* chore - group notebook specific api proposals together

* added unreleased fixes to endgame notebook

* Add changes back to the modal dialog

* Add back the workspace trust proposed APIs

* Adjust dialog buttons

* Standardize on WorkspaceTrust name across interfaces, classes, variables

* Renamed some of the missing keys

* Add TestWorkspaceTrust stub and fix failing tests

* Add requiresWorkspaceTrust property to fix test failure

* remove notebook change

Co-authored-by: Ladislau Szomoru <lszomoru@microsoft.com>
Co-authored-by: isidor <inikolic@microsoft.com>
Co-authored-by: Alex Ross <alros@microsoft.com>
Co-authored-by: TacticalDan <gorksorf@gmail.com>
Co-authored-by: Alexandru Dima <alexdima@microsoft.com>
Co-authored-by: Johannes Rieken <johannes.rieken@gmail.com>
Co-authored-by: Cameron <cameron532@gmail.com>
Co-authored-by: Benjamin Pasero <benjpas@microsoft.com>
Co-authored-by: Benjamin Pasero <benjamin.pasero@gmail.com>
@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
bug Issue identified by VS Code Team member as probable bug file-explorer Explorer widget issues insiders-released Patch has been released in VS Code Insiders under-discussion Issue is under discussion for relevance, priority, approach undo-redo Issues around undo/redo verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants
@isidorn @alexdima @aeschli @rzhao271 and others