Custom Story template issues

TL;DR
What’s the easiest way to hook into the tiddler closing animation?


Trying to keep a long story short, I had cause to take a look at:

https://tiddlywiki.com/#How%20to%20create%20a%20custom%20story%20tiddler%20template

I followed the docs and created the configuration tiddler (with a filter) and the cascade template.

First issue, is this statement:

We also need to make sure that it is inserted at the correct point in the cascade:

  1. The new rule must be after the “draft” rule to ensure that draft tiddlers with the tag $:/tags/TiddlerList can be edited
  2. The new rule must be before the “default” rule otherwise it will never be executed

The control panel “Cascades” tab shows that this can be achieved by inserting the new step immediately before the default step using the list-before field.

[Have to say, this whole tiddler is littered with great examples of the curse of knowledge. Even for a seasoned campaigner like me, I found the ambiguous use of untethered “it” more than a little challenging. And what is “new step” and “default step” anyway?]

#2 yes, of course, but #1 – the demo completely ignores its own advice and doesn’t use it:

I figured that was a documentation mistake and added list-after. It made no difference.

Moving on, I hacked away at my copy of $:/_tw5.com/CustomStoryTiddlerTemplateDemo/Template getting it working pretty much how I’d planned. Then I noticed something…

When I closed a tiddler listed by the template, there was no animation (something we’ve come to expect in a TiddlyWiki). After much head-scratching and umpteen failures to make it work, I revisited the demo on tw .com – the close buttons don’t work at all in the demo (but hey, mine do!). The “More” dropdown works (as do its listItems) and the “Edit” button works, but not the close button.

I figure (but don’t know for sure) the Navigator widget (further up the tree) might handle animations. But since this code doesn’t involve that widget directly, I can’t prove that one way or the other.

So, the question up top remains, how to re-engage/restore the animations for (essentially) tm-close-tiddler actions ?

If you’re talking about this custom template tiddler — https://tiddlywiki.com/#Demo%20Tiddler%20List%20with%20Custom%20Story%20Tiddler%20Template — its closing animation seems to work fine for me. If there’s no closing animation showing for you, let’s follow up by troubleshooting what’s different in your case.

Yes, I am. Perhaps you’re not clicking the close buttons on the tiddlers in the demo. Those are the buttons being referred to, not the close button of the host tiddler (which is not contained in the custom story since it is the custom story).

Note how the “More” dropdown works just fine.

1 Like

Ah, I understand what you were looking for now…

In that particular custom story-view, both the edit and close button work, but only by targeting the tiddler in the story river. Of course, closing the tiddler within that particular fan-array custom view would require lots of decisions (how to reclaim the horizontal arc-space, whether to animate, etc.) But you’re developing a different custom view.

So, you want a way to specifically target the custom-view instance of the tiddler, rather than its inclusion in the standard story river… which is exactly what happens with the “more” drop-down (when you click its tiny version within the custom view). The fact that the “more” dropdown works in place suggests that there should be a way! Can you reverse-engineer how the “more” handling differs from the other two?

Admit it. You have a camera in my office. :laughing:

I don’t see any problem here. The list-before field puts the new cascade rule just before the tiddler named as the field value. So that suffices to position this rule, within the cascade, after the draft rule and before the default.

Good catch. But even so, that waffle just wastes (extremely valuable) time.

Troubleshooting cascade order (and other list order snafus) is one task that still often feels to me like eating spaghetti with a spoon.

Ooh. Consider that stolen. :laughing:

But yes, never having “troubled” the great cascade before, that “help” tiddler drove me nuts (especially the “it” problem). If I understood the topic better, I’d take a well-sharpened axe to it (and come up with a better, less dramatic, more practical example).

Of course, the more intriguing issue (to me, anyway) is, how come my close buttons work while those on the demo do not? :confused:

When I get a bit further along (like hopefully getting the close animations functioning) I should probably post the code. In the meantime…

You may be running into a gotcha: the core animations require that the tiddler view/edit templates render as a single DOM node with children. Unintentional DOM nodes can be introduced by over eager paragraph generation, amongst other things. The gotcha arises because this requirement is not (and cannot) be enforced by the core.

Playing with it right now. I’ll take a looksee.

@jeremyruston

For this tiddler rendered in the custom story river…

DevTools dom…

Lots of p-elements – but which do you think might be the issue?

Hi @CodaCoder How do those story-river-tabs get into the story river? It looks like they are immediate children of the tc-story-river node. The only things that should be children of the story river are the backdrop and a sequence of tiddler frames.

How? It’s “custom”, I put them there.