What is the best way to approach tweaking shadow tiddlers?

317 views
Skip to first unread message

si

unread,
Feb 22, 2021, 11:16:31 AM2/22/21
to TiddlyWiki

AFAIK if you edit a shadow tiddler this is the equivalent of just creating a new tiddler with the same name, which overrides the original shadow tiddler.

I remember someone mentioning that tweaking core tiddlers is a bad idea in general because it means that that tiddler won't get updated when you import a new version of the plugin/core. Is this correct? If so what is the best way to approach tweaking shadow tiddlers?

(An example of a tweak that I have made is adding a dynannotate widget to $:/core/ui/ViewTemplate/body, which allows me to add annotations to all of my tiddlers. I have also made a few tweaks to plugins like Streams.)

Mat

unread,
Feb 22, 2021, 12:23:21 PM2/22/21
to TiddlyWiki
si wrote:
I remember someone mentioning that tweaking core tiddlers is a bad idea in general because it means that that tiddler won't get updated when you import a new version of the plugin/core. Is this correct? If so what is the best way to approach tweaking shadow tiddlers?

Yeah, right. The new shadow is imported but it becomes passive because your overwrite still "covers" it. There is no good way around this but maybe some kind of pragmatic way to deal with it could be formulated, like "go through your overwrites when importing and compare them to the new shadows". Could potentially be difficult.

If you think your overwrite may be of more general use I'd suggest bringing it up in the github discussion or post an issue requesting a "hook" (I understand this to be a kind of UI so you can manipulate something specific in some code spot).

BTW, I just realized it would be desirable if updates would detect changes between the old and the new shadows. There are often no changes in specific shadow tids except perhaps their dates. That would be useful to know and would indicate if your overwrite should still work.

Sorry for not giving the desired anwer.

<:-) 

PMario

unread,
Feb 22, 2021, 8:44:56 PM2/22/21
to TiddlyWiki
Hi,
I think in the early days of TW5 it was a bigger problem, if someone did modify shadow tiddlers. Especially since everyone did it and there haven't been enough possibilities to find out what has been changed. IMO that's not the case anymore!

It does cause some problems, if you are not aware of it. So if you create changes for your users and if you don't tell them.

On the other hand it is extremely easy to see, which shadows have been modified. Go to: $:/ControlPanel - Info - Basics tab : No of overwritten shadow tiddlers. This parameter is the last one in the table. If you click the "search" icon, you can see them in advanced search.

So the only thing you really have to do, is: Have a look!

-----------

There are many possibilities to add elements to the different templates. .. So if you can specify, what you want to achieve, we can probably tell you if there is an easy way.

just my 2 cents
mario

TiddlyTweeter

unread,
Feb 23, 2021, 3:18:00 AM2/23/21
to TiddlyWiki
si wrote:
I remember someone mentioning that tweaking core tiddlers is a bad idea in general because it means that that tiddler won't get updated when you import a new version of the plugin/core. Is this correct? If so what is the best way to approach tweaking shadow tiddlers?

Mat replied: Yeah, right. The new shadow is imported but it becomes passive because your overwrite still "covers" it. There is no good way around this but maybe some kind of pragmatic way to deal with it could be formulated, like "go through your overwrites when importing and compare them to the new shadows". Could potentially be difficult.

I disagree. The point is you simply DELETE the Tiddler to revert to the "shadow" (a.k.a. "the kosher version")  ... IF, and only if, that is your need. What we have is already a good system for handling change, I think. I think the issue is simply COMPREHENSION of behaviors in TW,

Best wishes
TT

Mat

unread,
Feb 23, 2021, 4:44:39 AM2/23/21
to TiddlyWiki
TiddlyTweeter wrote:
I disagree. The point is you simply DELETE the Tiddler to revert to the "shadow" (a.k.a. "the kosher version")  ... IF, and only if, that is your need. 
 
But the OP asks, or at least implies, about keeping ones overwrites in spite of updating. The problem has several aspects:
  • How do you know if the upgrade has changed the shadow; often individual shadow tiddlers in an updated plugin remain unchanged.
  • ...so if the upgrade didn't change the shadow then you just want to keep your overwrite. (Maybe you don't even need to be informed about it.)
  • ...but if the upgrade did change the shadow, then you know you need to be alerted so you can investigate what to do with your overwrite.

<:-)


TiddlyTweeter

unread,
Feb 23, 2021, 4:54:58 AM2/23/21
to TiddlyWiki
Ciao Mat. I appreciate your experience!

As I wrote: it is about UNDERSTANDING the behaviors. That is NOT going to change the behaviors. 
Merely adjust to them. 

The CENTRAL issue would only arise IF the behaviors were INconsistent.

TT

 Mat wrote:

si

unread,
Feb 23, 2021, 10:15:42 AM2/23/21
to TiddlyWiki
>>> There are many possibilities to add elements to the different templates. .. So if you can specify, what you want to achieve, we can probably tell you if there is an easy way.

@Mario  - Thanks. There are no doubt specific tweaks that I have made that could have been done without actually overriding any shadow tiddlers, but I'm mostly interested in how to handle this problem more generally in the cases where it is necessary to override shadow tiddlers.

>>> Yeah, right. The new shadow is imported but it becomes passive because your overwrite still "covers" it.

@Mat - OK that's good to know - at least the new shadow tiddler still updates in the background.

>>> But the OP asks, or at least implies, about keeping ones overwrites in spite of updating. The problem has several aspects:
  • How do you know if the upgrade has changed the shadow; often individual shadow tiddlers in an updated plugin remain unchanged.
  • ...so if the upgrade didn't change the shadow then you just want to keep your overwrite. (Maybe you don't even need to be informed about it.)
  • ...but if the upgrade did change the shadow, then you know you need to be alerted so you can investigate what to do with your overwrite.
Yep that is what I was asking.

What is needed is a filter that returns all overridden shadow tiddlers where the last modified date of the shadow tiddler is more recent than the last modified date of the overriding tiddler. Immediately I can see two problems with this:

1. Not every shadow tiddler even has a modified field. Just looking at a few random ones on tiddlywiki.com it seems that some do and some don't.
2. Since both the original shadow tiddler and the overriding tiddler have the same name, I can't think of how a filter could return the modified field for both of them. Presumably it will always return the field from the overriding tiddler.

Anyone have any solutions, or is this a lost cause?

David Gifford

unread,
Feb 23, 2021, 10:38:27 AM2/23/21
to TiddlyWiki
Best way: Clone the shadow tiddler and use the clone. Untag the original shadow tiddler if it has a tag.

PMario

unread,
Feb 23, 2021, 10:45:44 AM2/23/21
to TiddlyWiki
On Tuesday, February 23, 2021 at 4:15:42 PM UTC+1 si wrote:
>>> There are many possibilities to add elements to the different templates. .. So if you can specify, what you want to achieve, we can probably tell you if there is an easy way.

@Mario  - Thanks. There are no doubt specific tweaks that I have made that could have been done without actually overriding any shadow tiddlers, but I'm mostly interested in how to handle this problem more generally in the cases where it is necessary to override shadow tiddlers.

Shadow tiddlers have been designed that way, that you can overwrite them. ... BUT ... You'll have to remember it. ... Most of the time that's the problem. We change something and then forget about it.

Mat is right, that there could be some improvements in the TW import / upgrade mechanism.

-mario

Jeremy Ruston

unread,
Feb 23, 2021, 12:26:11 PM2/23/21
to TiddlyWiki Group
Just to point that there is already a fairly simple mechanism to determine how an overridden shadow tiddler differs from the original shadow: edit the tiddler, open the preview pane and select “differences from shadow (if any)”, and you’ll see the changes marked up as in the illustration below. Perhaps it would make sense to make it accessible from the tiddler info panel so that one doesn’t need to edit the tiddler.

Best wishes

Jeremy






--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/c5c9444a-ffd8-4f76-a534-074a6913959fn%40googlegroups.com.

strikke...@gmail.com

unread,
Feb 23, 2021, 2:29:31 PM2/23/21
to TiddlyWiki
Thank you Jeremy!
That is kind of funny. We are editing tiddlers day in and day out, and well I never saw that one.

Birthe

Mat

unread,
Feb 23, 2021, 2:34:44 PM2/23/21
to TiddlyWiki
Jeremy Ruston wrote:
[...] 
Perhaps it would make sense to make it accessible from the tiddler info panel so that one doesn’t need to edit the tiddler.
 
Because overwrites are typically not public, and they are created with the sole purpose of overwriting the default, I think it even makes sense with a very prominent button directly in the tiddler toolbar. It alerts that it is an overwrite and clicking it opens the diff comparison.

<:-)

PMario

unread,
Feb 23, 2021, 3:39:31 PM2/23/21
to TiddlyWiki
On Tuesday, February 23, 2021 at 8:34:44 PM UTC+1 Mat wrote:

Because overwrites are typically not public, and they are created with the sole purpose of overwriting the default, I think it even makes sense with a very prominent button directly in the tiddler toolbar. It alerts that it is an overwrite and clicking it opens the diff comparison.

May be we can add a new tab in the tiddler (i)nfo area. So if the tiddler has a "shadow" it could show the diffs there.

-m

Mat

unread,
Feb 23, 2021, 3:59:40 PM2/23/21
to TiddlyWiki
PMario wrote:
May be we can add a new tab in the tiddler (i)nfo area. So if the tiddler has a "shadow" it could show the diffs there.

I agree that would be better than currently but, still, why do we typically open an overwrite? Usually (not always, but usually) it is opened to do some overwrite tweaking or check up on something. So going to "more > info > shadowtab" is still pretty hidden and "buried down" IMO. 

How about this idea: If we enter edit mode in an overwrite we get the blue rectangle with "This is a modified shadow tiddler [etc]". That is a decent position for a button that directly sets the editor into splitscreen with diff comparison. From view mode this means you click "edit > [diffview]" i.e two steps, and the editor makes it accessible to modify things right away. The only difficult thing is to make a that blue rectangle look good with a button in it :-)

<:-)

Sven Drion

unread,
Feb 24, 2021, 11:46:07 PM2/24/21
to TiddlyWiki
How about (automatically) tagging changed tiddlers in the editor?? [[is[shadow]] contains all the automatic tiddlers, $:/config/AutoSave etc. $/tags/ModifiedShadow from the editor would not. 
Or include a comparison in the plugin display. Just happened to tinker, might look something like this https://test-plugins.tiddlyhost.com/#%24%3A%2Fplugins%2Fsvendrion%2Flittle_tools%2FChangedShadows:%24%3A%2Fplugins%2Fsvendrion%2Flittle_tools%2FChangedShadows

/de Wie währe es, im editor geänderte tiddler (automatisch)zu taggen? [is[shadow]] enthält die ganzen automatischen tiddler,  $:/config/AutoSave usw.  $/tags/ModifiedShadow vom editor würde das nicht. 
Oder in die Pluginanzeige einen Vergleich einbauen. Hab zufällig gerade gebastelt, könnte so ähnlich aussehen wie https://test-plugins.tiddlyhost.com/#%24%3A%2Fplugins%2Fsvendrion%2Flittle_tools%2FChangedShadows:%24%3A%2Fplugins%2Fsvendrion%2Flittle_tools%2FChangedShadows


Mat

unread,
Feb 25, 2021, 12:35:09 PM2/25/21
to TiddlyWiki
OK so here's a small thing for overwritten shadow tiddlers. For (only) these tiddlers you get a little button in the toolbar which, when clicked, opens the tiddler in edit mode with the split screen and "diff comparison to shadow" activated. 

This does not solve the question "Does my overwrite need attention because of the update?" but it is at least some small thing to support overwrite handling. 

<:-)
diffcompare.zip

TW Tones

unread,
Mar 2, 2021, 3:34:57 PM3/2/21
to TiddlyWiki
All,

I think we are missing something here, with the new layout switch cloning the required tiddlers for  new layout, and modifying the equivalent to $:/core/ui/ViewTemplate/body to do the desired behavior. The underlying tiddlers will update in the core, and returning to the default layout will allow the user to see the updates. The fact is your "extra layout" may break if something changes in the core but you have copies of the older version in your layout definition, and you can just switch layouts.

Remember when cloning a set of tiddlers for a new layout, rather than clone you can transclude a core tiddler. Add to that the ability to review the differences would make this easy.

A tool to clone a tiddler by replacing the text field with a transclusion of the original OR the content (if you wish to edit the copy) would simplify this.

What I am suggesting is to clone tiddlers and use a provided hackable feature such as the Layout switch, you will then have both your modified tiddlers and the core tiddlers can remain shadows only and thus receive updates.

Regards
Tones

Mat

unread,
Mar 2, 2021, 3:57:22 PM3/2/21
to TiddlyWiki
I posted  Indicate overwrites that need attention from updates #5518 a few days ago. It outlines an approach that would simplify handling of overwrites. Give it a thumbs up if you agree with it.

<:-)

si

unread,
Mar 2, 2021, 6:54:04 PM3/2/21
to TiddlyWiki
@Mat That looks like a great idea, I gave it a thumbs up.
Reply all
Reply to author
Forward
0 new messages