Could RevealWidget have built in garbage collection?

The RevealWidget typically creates state tiddlers that persist. These tiddlers are sneaky because as system tiddlers they hide, probably with a somewhat cryptic title, and you rarely have a reason to search for them at all, so they just stack up, slowly littering your wiki. It is like cadmium slowly accumulating in your body from when you painted your room with industrial paint. Yes, it is exactly like that, no difference.

It is of course possible to, inside the RevealWidget, explicitly ad an $action-deletetiddler but it seems like a very common use case so deleting the state tiddler should be controlled from the widget itself.

Opinions?

Use a $:/temp tiddler instead of $:/state if you do not want it to be saved with your wiki.

1 Like

Ah, but of course! Thanks.

:grinning_face_with_smiling_eyes:

Often, some $button is used to set the state tiddler to some value that $reveal then matches. You could program that button to delete the state tiddler instead of setting it to the “no” equivalent. For a missing state tiddler the $reveal will not match and the content remains hidden. You can also control the $reveal behavior for missing state tiddlers via the default parameter, if you need something fancy.

This is only better than Saq’s solution if you never reload your wiki. Otherwise the $:/temp location makes more sense.

Have a nice day
Yaisog

1 Like

I did create a little Remove States — list and remove state tiddlers plugin, that gives you an overview about all state tiddlers and it also contains a “bulk-delete” button.

BACKUP FIRST – BACKUP FIRST –

The same thing can be achieved with the ControlPanel → Filters tab and a filter like “[prefix[$:/state/]]” where IMO the last / is important. … Then click the Delete tiddlers button.

2 Likes