Discussing - Notes on Tiddlers stored in a Data Tiddler

This is one of many patterns illustrated in my post. Finding ways to make data tiddlers more accessible, eg keys by tiddler title and my get.note function.

Response to comments in General.

Now I have managed to read the whole thread, I see that the solution within the Topic has inspired some ideas, which is one of my desired outcomes. But this experience also reminds me of that apparently a lot of people don’t carry their imagination with them all the time. For me when I see the smallest tip or an exemplar, of something I have not seen before, my imagination runs off to the possibilities. Or if you tell me something cant be done, I try to find a way it can be done.

  • I do share this with a number of community members, see Emily @etardiff above and look at tiddlytools of @EricShulman
    • By the way Eric favours single tiddler solutions and has published many exemplars.
  • One of the things it was said was impossible was creating a Table of contents on large compound tiddlers without hard coding even with the assistance of a macro and unique ID values. I have solved this and plan to publish on it, when I have time. All the result of extrapolation from another problem How to toggle/add/remove select box attribute(s) existance with checkbox - #11 by TW_Tones

Please consider:

it has being noted how a renamed tiddler will orphan a note, unlikely to be an issue against a core or plugin tiddler, but we need a solution for this to make it a somewhat complete pattern.

I think capturing and accounting for renaming events is certainly going to be your biggest challenge — and even Relink doesn’t catch all of them. For instance, try the following code in a new tiddler on the Relink demo site to see one instance in which Relink fails to update title references:

<$button>Rename...
<$list filter="[tag[Relink]]">
<br><$link/>
<$action-setfield $field="title" $value=`XX $(currentTiddler)$` />
<$action-deletetiddler $tiddler={{!!title}} />
<!-- when $action-setfield is used to "change" the value of a tiddler's title, it actually makes a copy of that tiddler under the new title. thus, we need to add $action-deletetiddler to remove the original. -->
</$list>
</$button>

And to be clear, I don’t think it’s fair to call this a failing of Relink; it’s not obvious to me how you would catch renaming events like this.

But let’s assume your average TW user isn’t as fond of action widgets as I am :wink: and they’re just renaming tiddlers in standard edit mode, with or without help from Relink. I think this is your lowest-hanging fruit, and it may still require some $:/core modifications. Here’s how I might approach it:

  • Assign all your data tiddlers a specific tag on creation for later ease of filtering.
  • Clone the save tiddler button (and remove the $:/tags/EditToolbar tag from the existing save button — this is, IMO, the unavoidable core overwrite. Currently, <<save-tiddler-actions>> is hardcoded into $:/core/ui/Buttons/save and defined — again, hardcoded — in $:/core/ui/EditTemplate, so I don’t see any room to redefine it via an external procedure.)
  • To the newly cloned button, add a procedure that…
    • lists all tiddlers that match [tag[YourDataTag]has:index{!!draft.of}]
    • For each result, clone the index {{!!draft.of}} to a new index {{!!draft.title}}, then delete the original {{!!draft.of}} index.

Then, stretching a little further, I’d probably want to provide similar support for popular 3rd-party renaming tools like Commander. Again, you’d want to overwrite any buttons used to rename tiddlers with your own updated versions (and probably package the new tiddlers as part of a hypothetical “notes” plugin, along with the core changes and your original procedures/templates).

1 Like

Belatedly, it occurs to me that if you weren’t determined to have index-updating happen invisibly, you could add a warning to the EditTemplate (as a new tiddler with the $:/tags/EditTemplate tag), akin to the one you already get about backlinks when renaming…

image

And you could then include your “update index names” button there, rather than trying to incorporate it into the core save button.

The downside, of course, is that you’d have to remember to click the “update” button manually before saving your draft… and if you clicked it and then canceled your draft edits, the index would again be divorced from its parent tiddler. So it’s not an ideal solution, and it wouldn’t be my preference… but it might be a stop-gap “solution” if you were determined not to modify any core tiddlers.

Thanks for the ideas, great minds think alike, or is it fools never differ?

I have raised this over here with @Flibbles and @pmario

Doing my own research it is a little more complex than you would expect initially. Rename can occur a number of ways, and all need to be handled, so it is actually part of the navigator widget and $:/core/ui/EditTemplate/title and the action messages

Yes, I was considering this.

If we think of the data tiddler as a repository and place a viewer on that tiddler, it may be enough to just indicate the missing tiddlers (now they are renamed) in fact it has a behaviour we may want, we can maintain notes on its previous name or even for deleted tiddlers.

All - I think I will move the discussions so far to a separate discussion thread to keep the Wiki post less intimidating.