Remove Tags From Tiddlers, if Tag-tiddler is Deleted?

When a tiddler is deleted, should other tiddlers with that tiddler’s name as a tag have the tag removed? The same question applies to the list field.

I feel we might need a feature like this, perhaps provided by the core or by the Relink plugin. When we delete a tiddler, any tiddler that has its name as a tag should have that tag removed. The same goes for the list field; the value should be removed directly from the list.

Of course, I think this should be a user-enabled option, not a default one. I’m suggesting this idea because I’ve seen tiddlers like $:/tags/ViewToolbar where the list field contains too many non-existent tiddlers. The list is also very long, and I’d like to shorten it as much as possible, even if it’s not very meaningful.

1 Like

I think that’s not the best idea. Let’s say you delete a tiddler: “done” → All your ToDo’s that have been marked “done” are now “pending” again.

Interesting. I have implemented, for my use case, a configurable cascade delete based on title and list fields that reference a tiddler being deleted; but not based on a tag.

I implemented three configurable options, but I can think of more.

  1. Upon delete do not perform any actions/ cascade deletions.

  2. Upon delete remove references to the deleted tiddler; ie remove that tag

  3. Upon delete perform a cascade delete of all referenced tiddlers.

Another option would be prompt user of the action to be performed, showing the user the effected tiddlers.

When I implemented cascade deletion I used the relink configuration to determine the fields.

I’ve not had a need for this for tagged references, but I can see why it could be useful.

Craig

Yeah, making it easy to mass delete data, in many cases unintentionally, is never a good thing. That type of data blasting is best left to personalized buttons. You can create your own delete button for tiddlers that match a certain criteria, and have that button delete the tiddler and then remove its tag from all tiddlers, but definitely not a good idea for that to be a default or in the core.

Well, it seems to depend on how we use TiddlyWiki. Because I only leave a tag for to-do tasks, either ‘to-do’ or ‘completed.’

This is indeed a rather troublesome problem, because batch deletion or batch modification is likely to cause irreparable consequences, but I am still willing to give it a try. I’ll make a small tool to achieve this myself.

My immediate answer is no, in part because we have relied on the current behavior for a long time, and if you learn how to leverage the idea of tags with or without tag tiddlers there is a lot of opportunity there for further features and automation.

  • What is important to note here you are asking to loose information that can remain.
  • Most experienced tiddlywiki users may cause havoc if this is on a wiki, because this is not the default behavior.

However;
I can see how what you ask for may be valid in particular design scenarios so I would suggest if you were to introduce such a feature it should not be global, perhaps include a warning message and scoped to specific tag names or places where it is true.

As in my own “reimagin tags” solution it is easy to add functionality to the tag pill drop down. Perhaps you could add such functionality there? See the tags pills here https://bookmarklets.tiddlyhost.com/

  • See how the tag pill offers to “remove tag from here”, you could create another to remove tag from all tiddlers.
  • and/but - you could construct a button on all tiddlers, who are also tags, that allows you to delete the tag tiddler and remove it from all tiddlers it tags.
    • I would separate the button from the actions that do this, so they can be used on any button as desired. This would allow you to add such actions to the delete tiddler button if you wanted.
    • Consider making such a function reversable by storing the list of tiddlers you remove that tag from.

When we already have GitHub - kookma/TW-Commander: A tiddler toolkit for Tiddlywiki 5. Batch operations on bulk of tiddlers. Create, delete, add fields, tags, search and replace and inspect tiddlers. ?

Interesting question!

Many tags are useful despite never existing as tiddlers. If they were useful before existing as tiddlers, they might be useful after existing as tiddlers, too…

I might add content to the tiddler called $:/tags/ViewTemplate … and then later delete it, so that I can clear its list order, and have nothing other than the default view (in the story river) of that named “node” (now a “missing” tiddler which I always customize with a helpful tag overview). It would be alarming if the tag were too easily removed from all those tiddlers!

I do imagine that it might be ideal to have an optional dialogue — "Remove this tag from [8] tiddlers tagged $:/tags/ViewTemplate? — and even an option to "Delete [8] tiddlers tagged $:/tags/ViewTemplate (with yet more confirmation / warning steps).

Right now, I do often clear out everything with a certain semester-tag, or a tag like “experimental”. I do this through the advanced search Filter tab. It’s not too difficult, and the trash icon does offer a nice warning. If I want to remove a tag from a set of tiddlers (based on Search), the Commander plugin by @Mohammad is very useful for this purpose. I imagine it’s a pretty small set of users who would routinely like tag-children to be modified or erased simply by deleting their parent tiddler.

2 Likes

As I suggested, I could add this as an option to the tag pill dropdown in my reimagin tags package, which I should perhaps turn into a plugin because it has proven to me its long term value. We could also place a flag on “tag tiddlers” for which this may be permissable. One would have to action this before deleting the tag tiddler.

Here is a new package for my reimagin tags, not yet made into a plugin. reimagin-tags-2.json (24.9 KB) which now includes an item on the tag pill dropdown “Remove this tag from all below”.

  • It does not also delete the tag tiddler if it exists.
  • It includes a virtual tag pill on tiddlers used as a tag, in the subtitle called “tagging” from which you can also “Remove this tag from all below”
  • if you review $:/PSaT/reimagine-tags/remove-tags you can see the action/s used to remove the tags (inside a list widget).
1 Like

Simple answer…

Depends on the Use Case.

As a Default: No.

In your case?
Is the tag destruction required?

TW won’t destruct FORMER DEPENDENT tags 'less you instruct her so.
But could IF told to.

QED, TT

p.s. A simple utility to Remove a tag from All and Destroy it’s Tag-tiddler could be useful.
Maybe exists already??

it does in my above.

try it, import the json and click on any tag pill.

although it currently leave the former tag tiddler in place, you could add another action.