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

fix: file-saving dialog with dirty editors #12864

Merged
merged 4 commits into from
Oct 26, 2023

Conversation

vladarama
Copy link
Contributor

What it does

Fixes: #12859

This PR fixes a bug where cancelling the file-saving dialog when closing a dirty editor would actually close the editor.
With the new changes, cancelling the dialog will leave the dirty editor opened, which is the intended behavior.

How to test

  1. Open Theia application.
  2. Create a new untitled text file (File -> New Text File or Alt+N).
  3. Try to close the editor by pressing the X or Alt+W.
  4. The file saving dialog should appear -> Press Cancel.
  5. The editor should stay opened.

Review checklist

Reminder for reviewers

This commit fixes the issue where cancelling the file-saving dialog
incorrectly closes the editor.

Signed-off-by: Vlad Arama <vlad.arama@ericsson.com>
Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interestingly enough, I now have the exact opposite issue: When closing an untitled file and saving it to a new location, the editor isn't closed. Instead the model now points to the newly created file. VSCode correctly closes the editor after saving the untitled file.

Copy link
Contributor Author

@vladarama vladarama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@msujew
Yeah this is a different issue that I also noticed on master (#12860). This PR only fixes #12859 but they are quite related so I will try to fix the other issue as well.

@msujew msujew added the file dialog issues related to the file dialog label Sep 28, 2023
@JonasHelming
Copy link
Contributor

@vladarama Are you planning to make this other fix part of this PR?

@vladarama
Copy link
Contributor Author

@JonasHelming
I still haven't had the chance to work on the other fix, but I will make a different PR for it when its ready.
As for the current PR, it should be ready for review.

@vladarama vladarama requested a review from msujew October 11, 2023 12:44
Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, sure. If you want to address the other issue separately, then I'm fine with merging this PR. LGTM 👍

This commit fixes the issue where cancelling the file-saving dialog
incorrectly closes the editor.

Signed-off-by: Vlad Arama <vlad.arama@ericsson.com>
@JonasHelming
Copy link
Contributor

@vince-fugnitto Do you want to merge this?

Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dismissing my approval, the change leads to failing browser tests.

@vladarama vladarama requested a review from msujew October 25, 2023 14:29
Copy link
Contributor Author

@vladarama vladarama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @msujew ,
When we cancel the file-saving dialog, the dirty editor should not be disposed. I updated the browser tests to reflect this behavior. It should be good to go now.

Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, looks good to me 👍

@JonasHelming
Copy link
Contributor

@vince-fugnitto Do you want to merge this now?

@vince-fugnitto
Copy link
Member

@vince-fugnitto Do you want to merge this now?

@JonasHelming sure, we can merge for the release :)

@msujew msujew merged commit d2a2bb6 into eclipse-theia:master Oct 26, 2023
12 of 13 checks passed
@vladarama vladarama deleted the editor-closing branch October 26, 2023 18:08
@vince-fugnitto vince-fugnitto added this to the 1.43.0 milestone Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
file dialog issues related to the file dialog
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

bug: cancelling file-saving dialog incorrectly closes dirty editor
4 participants