First, just to be upfront: I know about the plugin that lets you “trash” deleted tiddlers, and the plugin that saves tiddler revisions. I’m not interested in either of these. I simply want to ALWAYS CONFIRM a tiddler deletion, every time, no matter what.
In view mode (only), if your tiddler has an empty text field, it does not ask for confirmation before deleting the tiddler.
This is by design, so that you can quickly delete empty tiddlers you didn’t mean to create.
But if you’re using fields to store your data + a viewtemplate to show a unified display for that data, and you don’t currently have anything in the text field, then it is FAR too easy to accidentally delete a tiddler full of complicated fields with a single misclick, with no chance to cancel. And if you haven’t saved the wiki since creating that new tiddler, then you have to start all over from scratch.
- Searching around, this was brought up 4 years ago in the GG, and there’s an open issue from 2016 about this as well. Unfortunately, neither provides solutions/workarounds, other than a suggestion implying a custom button.
I can make my own custom delete button for view mode, but I’d prefer to look first for a better solution that doesn’t duplicate existing functionality. Plus, the code’s constantly evolving, so there may be a solution that wasn’t available earlier.
I believe the code for deletion is part of $:/core/modules/widgets/navigator.js
(search for “seek confirmation” to see its section), but I don’t know Javascript, and even if I did I wouldn’t feel safe making changes to that tiddler, because it does…well, everything!
So: other than making a custom delete button, is there a way to override the core’s empty-text-field check so that it ALWAYS pops up the delete confirmation prompt instead?