For reference, here is the macro:
\define is-folded()
[lookup[$:/state/folded/]match[hide]]
\end
\define additional-link-actions()
<$action-log message="$messagecatcher in $:/mwi/ui/PageTemplate"
from=<<event-navigateFromTitle>>
to=<<event-navigateTo>>
modifier=<<modifier>>
storylist={{$:/StoryList!!list}} />
<$tiddler tiddler=<<event-navigateTo>> >
<$list filter="[<event-navigateFromTitle>!is[blank]] [<tv-story-list>!contains<currentTiddler>] +[nth[2]]" variable="void">
<$action-listops $tiddler=<<tv-story-list>> $subfilter="+[insertbefore:event-navigateFromTitle<currentTiddler>move<currentTiddler>]"/>
</$list>
<$action-navigate />
<$list filter="[<modifier>match[normal]]" variable="void">
<$action-deletetiddler $tiddler={{{ [all[current]addprefix[$:/state/folded/]] }}} />
<$list filter="[list[$:/StoryList]!filter<is-folded>] -[all[current]] +[addprefix[$:/state/folded/]]">
<$action-setfield $value="hide" />
</$list>
</$list>
</$tiddler>
\end
This adds closed tiddlers where I expect them in the story (below the current one), whether the Ctrl-key was used or not, and does the folding / unfolding.
The only thing I noticed is that when I create a new tiddler from the Page Toolbar, that tiddler starts folded. I don’t do that often enough that it bothers me, though, so I don’t have a workaround for it.
@TW_Tones: $action-navigate
uses the currentTiddler, after it has been set to the variable event-navigateTo which is set by the $messagecatcher
.
Have a nice day
Yaisog
PS: See also this discussion on GitHub regarding propagation of navigation events.