by kazinator · 4y ago · 0 comments
I suspect that a simple UI modification which could reduce occurrences of the situation, without being too obtrustive would be to make it a checkbox:
[ ] I agree with unsaved data being discarded [ OK ]
The OK button is ignored unless the box is checked. This is exactly like a Terms-of-Service agreement workflow.Another idea would be to make the UI sensitive to the amount of unsaved content. The software should have an idea of whether the unsaved content represents 57 edit operations, or just two. Or maybe in terms of number of objects or bytes involved or some other specific measure.
If the amount of unsaved material seems significant, then have the checkbox workflow. Otherwise just the [OK] without the checkbox.
This problem was solved in MacOS X Lion 11 years ago. The solution is to get rid of this dialog entirely and to simply auto-save documents by default when quitting and to re-open all documents when the application is started again (persistent state). This feature applies even to new documents which have never been explicitly saved by the user nor even given a name. Only when you attempt to close (or explicitly save) an unnamed document does it ask you to choose a name or delete the document (with an explicit delete button marked in red text).
This also has the added benefit that when you use the save command (command-s) you're actually saving a snapshot of your document which you can recover later with a time-machine like history viewer interface. Otherwise, all other changes to your document since the last snapshot are auto-saved.
Keep the “do you want to save first?” prompts for when closing the file.
Of course for some file types this could use a lot of storage, so it won't be as applicable everywhere.
This won't harm unsuspecting users if you need to explicitly request privacy, by for instance opening an incognito window, if you request privacy it is valid to assume you know the potential consequences.
----
[1] Though you shouldn't rely on it not being, never assume there are no idiots around not thinking straight when implementing private functions and things that might interact with them! Trust but verify. Or just verify.
I presume the default action stashes the data somewhere, in which case it's basically the trash bin pattern or tempfile pattern (stored durably, not /tmp), and we can safely go back to a plain dialog like:
You have unsaved changes.
Do you wish to save as a new file,
or discard?
(Unsaved changes can be recovered
for 1 month before permanent deletion)