I can find many posts about this subject, here and on github, and I'm truly wondering why is so complex. I didn't check the code, and all the posts, so bear with me...
Rather than create a "delete function", we want a moving option. With Thunderbird, the email client, in the account / server settings, there is an option for:
When I delete a message:
a. move it to this folder: "folders selection widget"
b. mark it as deleted
c. delete it immediately
So like Laurent says: "My current plan is to have a regular folder called “trash” where notes are moved when deleted. There will be nothing special about this folder so there won’t be a need for special support for it."
This is it, but you let the user decide which notebook to choose, and you don't have to think about all the what if...
So, maybe joplin could keep the default option as to "delete immediately", as it is now, and in the options menu, we could have an option to select a notebook as a target for deleted objects.
Next, we have to popup an error message when the user delete something, and the selected notebook doesn't exist anymore. (at this point nothing happen, nothing deleted)
And finally(?) how to "permanently delete" the content of the selected notebook?
Maybe from the option menu, not too far from the "notebook selection widget"
- a button "delete content" of this notebook now? and/or
- an option to delete content of this notebook after x days? and/or
- an option to delete content of this notebook on exit?
- ?
at first it's look weird to have the "permanently delete" action in the options, but that will probably help to keep the main GUI as it is now. (no new delete / purge / empty / ... action in the main menu, and no new entry to add to the faq to explain the difference between a delete and ...)
at this point, we could probably add some options, for the "selected notebook", to display (or not) search results from this notebook.
food for thought