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

Fire "beforeunload" confirm box only if document has changes #205

Open
sdumetz opened this issue Apr 17, 2023 · 1 comment
Open

Fire "beforeunload" confirm box only if document has changes #205

sdumetz opened this issue Apr 17, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@sdumetz
Copy link
Contributor

sdumetz commented Apr 17, 2023

This box is annoying. The save process is complicated enough (save scene, capture pose, save article), if users can't rely on this to know if they forgot to save something they will just ignore the dialog because it's wrong most of the time anyway.

Serializing the CVDocument just after openDocument() and serializing again to compare the string value in CVStoryApplication.beforeunload() might do the trick but I'd like a solution that allows a better UI (eg: highlighting the save button as soon as the doc is changed). The tricky bit is that we have no representation of the document's data once it's been loaded into the graph, so a "changed" switch seems hard to implement.

I'd like to work on this issue, if anyone has an idea worth trying.

@gjcope
Copy link
Collaborator

gjcope commented Apr 20, 2023

I agree the box would be better served only when the data is dirty, but still better there than not. Several components already have literal or effective 'changed' output events, so a state manager could subscribe to those events to flip the global changed state and clear on save. The hard part would be adding the missing events and making sure coverage is 100%.

@gjcope gjcope added the enhancement New feature or request label Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants