Is there a basic save revert mechanism in single file TiddlyWiki?

I got dizzy from too much repetitive tiddler management and I made a mistake. Somehow my attention got distracted for a moment and instead of cloning a tiddler, making changes and saving the clone under another name as new tiddler, I edited an existing tiddler and saved it under new name. The original tiddler is effectively gone.

To fix it, I had to:

  1. Get a backup
  2. Decrypt the backup
  3. Find the single TiddlyWiki file
  4. Open it
  5. Find the original tiddler
  6. Export it
  7. Import it into the current working wiki

I did not think much about optimization, yet I’m asking here just in case, if there’s an easier, less time consuming way (reverting the change from the backup + writing this post took almost a whole pomodoro). Obviously, as the title states, using TiddlyWiki NodeJS is not an option, albeit having a file per each tiddler makes at least version control a tad simpler, especially if tiddler encryption is not involved.

Ideally, TiddlyWiki could have something like a Trash bin to keep a few of the most recent copies of tiddlers that were modified and saved, or deleted. Then user could just grab the previous version or restore the accidentally deleted tiddler straight from there. With TiddlyWiki clients configured for automatic save, I believe a save happens every time a tiddler in edit mode is saved or when a tiddler is deleted, so there’s just those two places to hook into for saving the copy that gets overwritten or deleted?

I’d really like to have this feature in vanilla wiki (unless it’s already there and I did not find it yet), to avoid adding yet another plugin or rely on additional third party wikitext code snippet to be able to do this.

1 Like

http://j.d.revisions.tiddlyspot.com/ may be interesting. But be aware, that it will keep copies of the whole tiddler content in the file. So file size may be significantly increased, depending on your settings.

I personally do not use the plugin, so I do not know if there are any issues.

1 Like

I am aware of this plugin, I have it bookmarked since my first pass through the ecosystem. As I said above, I will consider to use something like this as last resort. So far it looks like a tradeoff - the workflow I described above, which happens very rarely, and involves a single wiki vs having to add the plugin to each single file wiki just in case if I ever need it, plus increasing each file size as you warn about, plus this getting even worse for big wikis that are also encrypted, all of this when I only need a short save log containing just one version of last few saved tiddlers. And they can even be saved in those $:/temp or something tiddlers that never hit the file on disk.

1 Like

This may not be exactly what you want, but it’s probably something that I’ll start using.

TW-Trashbin

2 Likes

I had a quick look, it seems it can be helpful to restore explicitly deleted tiddlers, but so far I don’t see how could it restore a renamed and saved tiddler. I’ll ask about it in the Kookma Plugin Library thread :+1:

as long as you have not reloaded the wiki, you can extract the version that was first loaded via this function pasted into the javascript console

function getoldtid(title) {

    const scriptTag = document.querySelector("script.tiddlywiki-tiddler-store");

        const data = JSON.parse(scriptTag.textContent);
        const entry = data.find(item => item.title === title);
        return entry ? entry.text : "-- not found ${title} --";

}

then type getoldtid("lostitdname")

2 Likes

Web browsers and TiddlyDesktop have the JavaScript console, what about Tiddloid app for Android?

that I don’t know… never used tiddloid