In-Wiki Incremental Revisions -- Now Even Better!

@Yaisog
In JD’s revisions plug in, the revisions are shown in the tiddlerinfo tabs.
Is it possible for your implementation also?

Hi @arunnbabu81, I’ll have a look, but cannot promise anything regarding timeframe or even implementation.

There is no urgency from my side. Take it as just a suggestion.

Can you add also a whitelist of tiddlers to keep patches for (and not to keep for others)? This would be great for me as I’m a bit hesitant to keep patches for every change I make but there are some tiddlers where this is important for me (and having to keep deleting patches for all others is a burden)

@arunnbabu81 @Ittayd
I just uploaded an update that should include both of your suggestions.
The revisions are now shown in a tab of the info area. This can be toggled via the ControlPanel settings page.
The settings page now also contains a whitelist editor. The whitelist, just as the blacklist, works as a filter, i.e. to only back up tiddlers in the $:/plugins/yaisog namespace, you would replace the universal default [is[tiddler]] with [prefix[$:/plugins/yaisog]]. The blacklist is applied after the whitelist, if you wanted to fine-tune the selection.

Have a nice day
Yaisog

PS: Please note that I also updated the wiki to v5.3.5, so that the custom $:/core/modules/filters/format/timestamp.js override is no longer needed, and I replaced the $:/plugins/yaisog/macros/friendly-date-subfilter with a JavaScript version $:/plugins/yaisog/modules/filters/userfriendlydate.js that implements the same functionality in a custom filter operator.

5 Likes

Thank you @Yaisog for your work…will definitely try it out today

I just noticed starting at the bottom of the revisions list, you can also move up and forward in time to see the tiddler content evolve.

https://yaisog-patches.tiddlyhost.com/

@Yaisog

Couple issues I found…

  1. Click the edit button then…

  1. Click on the Revisions button, then the More options button…

Thanks for the heads-up.
No. 1 was a result of a messed up offline upgrade to 5.3.5. After a full re-upload everything should be OK now.
No. 2 was a side effect of sticky titles and lazy code re-use. Now fixed.

Have a nice day
Yaisog

3 Likes

I was wondering if it would be possible to see a rendered view of each version rather than the code and differences?

  • I understand you came at it from an author’s perspective but thinking of it from a readers perspective.

It may also be interesting to display who the modifier was for each change/version as well as a more readable modified time and date.

1 Like

@TW_Tones This would probably not be incredibly hard to do. For the date format, you’d probably only needed to change the toc-body macro in $:/plugins/yaisog/patches/Viewer, and to render the tiddler you’d put a $wikify instead of the $diff-text in $:/plugins/yaisog/patches/Viewer/ItemTemplate. The modifier should already show up in the fields if it changed between revisions.

However, since this is just a proof-of-concept and not a real plugin, I don’t plan to add a lot of customizations. I actually like the date format that I used, and in my single-user wikis I have no need for displaying the modifier (always me). I might add a switch to show the rendered output or something like the editor preview panel at some point in the future, though. The drawback would be that it’s difficult to identify the changes, especially in larger tiddlers.

Have a nice day
Yaisog

Thanks for the tips.

I think we need a range of supports for multiuser tiddlywikis, however it may even be possible to import updated tiddlers with the user being the indicator of the source.

I suppose “I am thinking out loud”

Thank you. I see this is not a plugin. Why do you need to use a custom page template in order to catch tm-save-tiddler and can’t use the th-saving-tiddler hook? Otherwise, wouldn’t it be cleaner to replace NavigatorWidget.prototype.handleSaveTiddlerEvent (to save the revision then call the original) instead of overriding all the page templates?

This is a pure WikiText solution and always was intended to be (well, except for the userfriendlydate filter operator, which is a comfort feature I used from a personal wiki project).
There are no shadow tiddlers being overwritten, so we do not have to worry about keeping up with future updates to the NavigatorWidget. Any existing PageTemplate can easily be modified to make of use of Revisions by adding the $genesis widget as demonstrated in the demo.

I always want to make a git diff viewer and change reverter. Can I use your UI in my future git revision plugin?

I’m using nodejs wiki (TidGi app) with git, so revision comes without cost, and is optimized by git binary. But till now, I still have to manage revert using Github Desktop or SourceTree app, without in-wiki support, it is a pity.

Sure, go ahead.

Yaisog

1 Like

Hi @Yaisog ,

Thanks for making this plugin! I’m trying to implement this in my Tiddlywiki. I’ve tried to install your revisions plugin on a blank tiddlywiki 5.3.6 and 5.3.5 by dragging the tag pill from your demo https://yaisog-patches.tiddlyhost.com

However, when I use the Patches viewer, I cannot see the prior revisions beyond the latest or restore older ones. I’ve attached a picture of the viewer tiddler

Not sure what I’m doing wrong?

Hi @bobburgers7, probably what’s going on is that the column with the previous versions is not shown because your viewport is very narrow.
The TiddlyHost site currently runs on 5.3.5 and works without problems. On my screen it looks like this:


Only a part of the revision list (the narrow vertical grey bar) seems to be visible in your screenshot…

Yaisog

Hi @Yaisog, thank you very much for developing this add-on.

I am very interested in using it as a way of keeping track of the revision history of my tiddlers, e.g. to restore something I deleted accidentally, to undo unwanted changes, or to revert to to a previous version.

Is that its intended use?

Out of curiosity, would it be possible to “feed” the revision history of one or more tiddlers to a tool like WinMerge?

@bobburgers7, thanks for sharing your screenshot. I’m having the same problem in TiddlyWiki 5.3.6, both in my wiki installed on Node.js on Windows 11, and in a single-file wiki.

Here’s a screenshot from the single-file wiki. I collapsed the sidebar, and even with a very wide viewport I’m still having the problem.

That is exactly what I wrote it for.
Actually, to make it more useful in that regard, I am in the process of extending it so that any revision of a tiddler can be compared to any other revision of that tiddler. Comparisons will also be able to be turned off, e.g. to copy content from an earlier revision without the differences markup.

I also found the problem with the viewer that you and @bobburgers7 described. A required tiddler was not tagged correctly and was thus not imported when dragging the tag pill into another wiki. That should be fixed now. You will have to save and reload your wiki after importing, because that tiddler userfriendlydate.js is a JavaScript tiddler for the eponymous filter operator which is used in the viewer.

Regarding WinMerge, I don’t know. The content in the $:/patches/ tiddlers might be very similar to WinMerge patch files if WinMerge uses the same diff-patch-match library. I haven’t tried. But that doesn’t mean that you can’t.

Yaisog

3 Likes