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

Alert before quit electron with unsaved changes #114

Merged
merged 2 commits into from
Apr 18, 2024

Conversation

murilopolese
Copy link
Contributor

  • Electron will not close it's window until the UI confirms it can be closed
  • The UI will look for open files with unsaved changes.
  • A new file will never be considered "changed", only files that have been saved will be counted as unsaved changes.

@ubidefeo
Copy link
Collaborator

A bit of an edge case, but maybe not that edge :)

When I launch the editor the "new file" is pre-filled and its tab's dirty indicator (*) is already present.
Of course the file has not been saved yet, but I am still able to add my own code, run and test things out.
If I close the editor or the tab in question I do not get prompted to save, and I see this as lacking in this feature

@murilopolese
Copy link
Contributor Author

@ubidefeo

This is a design decision.

  • I think if you haven't done anything on the app and click exit, you should exit without a warning that there are unsaved changes.
  • If you haven't saved the file, you shouldn't be prompted to save it before you exit. New files (that are not saved) work like temporary files. No save, no persistence.
  • Since we are not doing "content diff" if you press space and delete the space (on an existing file) the system will think there are unsaved changes on that file.

@murilopolese murilopolese changed the base branch from main to development April 17, 2024 12:42
@murilopolese murilopolese requested a review from ubidefeo April 17, 2024 12:42
Copy link
Collaborator

@ubidefeo ubidefeo left a comment

Choose a reason for hiding this comment

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

LGTM

@murilopolese murilopolese merged commit fc63ae5 into development Apr 18, 2024
1 check passed
@murilopolese murilopolese deleted the feature/before-quit-electron branch April 18, 2024 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants