rnote
rnote copied to clipboard
Persist unsaved/scratch documents
Documents currently have to be manually saved to disk at least once to be persisted. Making opened but unsaved documents persist across application closing/opening reduces the friction of closing the app when organization or long-term persistence isn't necessary. Sublime text is an example of an application that implements persistent scratch documents, and is very useful in keeping short-term unorganized text of any kind.
Is your feature request related to a problem? Please describe.
I don't see any related issues or bugs.
Describe the solution you'd like
PR #651 already implements saving and reopening documents on crash and open, and could be extended to save on normal closes as well, and automatically reopen files when the last exit was clean.
Additional context
Overall, 2 parts are needed: persisting unsaved documents in some sort of common cache or data folder, and then automatically reopening these on the next application startup. The second part could be a setting applied to saved documents as well, to reduce friction in between app sessions.
Today I learned that this wonderful key feature is still cooking in the oven... by forgetting to save a document :)
I like this feature. I also like the idea of widening the issue so that all tabs -regardless of whether they've been saved- will be restored on startup. However I don't like the idea of this always being enabled, as is the case with crash recovery. I think its to be expected that -by default- unsaved documents actually won't be saved. I also think its to be expected that -by default- the program will start up without any opened tabs. If the user actively chooses to not save documents and close the program then nothing (meaning both unsaved documents and open tabs) should be saved and later restored. The only two reasons for recovery I see are
- anything but the user causing a loss of data (e.g. a crash). In this case the user didnt consent to that loss.
- an opt-in.
I think recovery should overall be handled similar to session restores in e.g. firefox (https://support.mozilla.org/en-US/kb/restore-previous-session), basically always trying to restore in irregular circumstances (crash e.g.) but requiring an opt-in for anything else.
First of, sorry for the delay on document recovery, I got my first full time job last summer and was busy with other projects for the past months.
I have thought about this as well since someone suggested that on the matrix channel and realized when my PR is finished this feature should be pretty easy to implement since the recovery already does the caching part, and we just need to not clean up when close and maybe open the document automatically. (Fun fact: During development of recovery I basically had this feature for a short time until I did the cleaning up function on closing)