Defining "single-tiddler mode" via the Story River

As a long-time member of the The 5,000(+) Tiddler Club, I’m always trying to reduce lag in my (often complex) wikis. I prefer Zoomin mode in any case, and I’ve historically used it in combination with solutions like the Dynaview plugin and @Yaisog’s SingleTiddlerView (which I still appreciate, but doesn’t play well with my custom page template).

It occurred to me today that the simplest way to make Zoomin truly single-tiddler might just be to restrict the list filter in my story template to… a single tiddler. Here’s the code I’m currently using in my equivalent of $:/core/ui/PageTemplate/story:

<div class=StoryRiver>
<$scrollable class="tc-story-river">
<$list
     filter="[[$:/HistoryList]get[current-tiddler]] :intersection[list<tv-story-list>] ~[list<tv-story-list>first[]]" 
<!-- ^^ filter="[list[$:/StoryList]]" in the default story template, for reference -->
     history=<<tv-history-list>>
     template="$:/core/ui/StoryTiddlerTemplate"
     storyview={{$:/view}}
     emptyMessage={{$:/config/EmptyStoryMessage}}
/>
</$scrollable>
</div>

So far, this has been working wonderfully and I haven’t experienced any issues. It’s a very simple substitution—I just tested my filter in the core PageTemplate/story and it works just as well there. It’s blazing fast, and it preserves the animated transitions, for those who care about that sort of thing. But it seems almost too good to be true, so I wanted to run it by the experts here. Can you see any potential problems I’ve overlooked?

3 Likes

That’s very interesting.

I use three custom side bar tabs which feature the various ways I populate the story river, all of them use filters that include a limit operator which takes it’s input from a slider widget so that I can use the slider to control the max number of tiddlers I want any of my custom filters to populate the story river with. And yes I notice the difference in performance when I request a shorter list.

Yours is more elegant in the sense that your code operates at the core level, this makes me wonder whether I should take a look at the core and see if I could place my limit operator at that level.

1 Like

There are discussions on GitHub and @Jeremy Ruston has created an experimental single tiddler view.
But it was forgotten as other improvements were in progress.

Like you, I think a single tiddler view can be useful for large wikis.

Look at here: Jermolene/TiddlyWiki5 at single-tiddler-mode (github.com)

1 Like

This is pretty much what my Single Tiddler View plugin does. Been using it for a long time without problems.

4 Likes

Cool, I’m going to use it, thanks for making it a plugin!

To make it works like VSCode, I also use a command palette plugin to use ctrl+tab to rotate between history tiddlers.


@Yaisog Seems it is not working, I still get multiple like normal layout.

See GitHub - tiddly-gittly/Tiddlywiki-NodeJS-Github-Template: Template to generate a auto-sync-to-github, privatcy-in-mind, freely-deployed TiddlyWiki. for nodejs version of reproduction, and 我的 TiddlyWiki — 卡片式个人网页笔记 for HTML

Did you activate the Page Template via Ctrl-Shift-L?

Yes, there are still multiple tiddlers in that layout. I’m using the layout switcher page control button instead of shortcut.

But note that my wiki template have many other plugins, maybe some of them have conflict with this technique…

Thank you for that link, Mohammad! I’d come across Jeremy’s work in this area before, but didn’t have the link readily at hand. I did a little further searching just now to see whether I could find a working demo site, but unfortunately failed to turn anything up. I’m not sure it was ever demo’d outside the prerelease site (c. 2020).

Thank you also, @Yaisog, for the direct link to your plugin. I had been using some of your earlier tips/modifications, and I was truly hoping the plugin would work for me, but it’s “heavy” enough that I would have had to modify a good deal of it to work with my preexisting page template. IIRC, I did do some experimenting when you first published it, but gave up when I couldn’t easily resolve the conflicts.

It’s gratifying to see that your single-tiddler story template takes essentially the same approach to filtering tiddlers, though! I think I was doubting myself partly because I did recall the greater complexity of your and Jeremy’s solutions and the work you put into it. Changing a single line in the view template seemed too easy.