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

bug: Cmd+Z / Ctrl+Z on workspace entry overrides files #1786

Open
KyleleeSea opened this issue Jun 10, 2024 · 1 comment
Open

bug: Cmd+Z / Ctrl+Z on workspace entry overrides files #1786

KyleleeSea opened this issue Jun 10, 2024 · 1 comment

Comments

@KyleleeSea
Copy link
Contributor

Describe the bug
If a user navigates from workspace A to workspace B and makes no edits on a file to workspace B then clicks Cmd+Z / Ctrl+Z, the content in that file is completely overridden by the content from the corresponding file in workspace A.

More generally, if a user navigates from workspace A to workspace B, makes x edits in workspace B then clicks Cmd+Z / Ctrl+Z x+1 times, the content in that file is also completely overridden by the content from the corresponding file in workspace A.

I believe this to be because what's happening underneath the hood is the currentWorkspace state is being swapped when a user navigates to a different workspace, so the "previous" state that Cmd+Z tries to go back to is what was in that previous workspace.

Screen.Recording.2024-06-10.at.10.16.22.AM.mov
Screen.Recording.2024-06-10.at.10.19.28.AM.mov

(the only keys clicked in these examples are Cmd+Z, no copy paste)

To Reproduce
Have at least two workspaces in your saved tab
Click on workspace A
Click on workspace B
Click Cmd+Z / Ctrl+Z (windows) on workspace B

Or
Have at least two workspaces in your saved tab
Click on workspace A
Click on workspace B
Make x edits on workspace B
Click Cmd+Z / Ctrl+Z (windows) x+1 times on workspace B

@wodeni
Copy link
Member

wodeni commented Jun 10, 2024

We only change the value of MonacoEditor whenever we switch workspaces, and this probably made monaco treat the previous workspace as a re-playable state. In principle, we'd want to dispose the instance and mount again or do something special to flush the undo queue.

Since #1737 is ongoing, this issue might be out of date soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants