Switch between two story views keep the same tiddler in view

193 views
Skip to first unread message

Mohammad

unread,
Dec 15, 2020, 10:27:23 AM12/15/20
to TiddlyWiki
I have asked this question before with no luck.

1. Assume I am in Classic story view and I have five tiddlers open and tiddler A is under focus (or at least the last one I get into by clicking a link)
2. Then I switch to Zoomin story view and see tiddler A. Then I navigate among those tiddlers say from Open tab in sidebar.
3. Now I return to Classic view, what I see it is not the last tiddler in focus (opened) in Zoomin view instead Tiddlywiki opens the first Tiddler in the story list and focuses on that!

My question is how can I switch between two story view but have the same tiddler under focus in both views? Is it possible in TW 5.1.23?

--Mohammad

Saq Imtiaz

unread,
Dec 15, 2020, 10:53:51 AM12/15/20
to TiddlyWiki
We don't have a working implementation for tracking and restoring focus state and/or story scroll position.

You probably need to save and restore that yourself using tm-navigate or tm-scroll messages.

Mohammad

unread,
Dec 15, 2020, 11:01:34 AM12/15/20
to TiddlyWiki
Thanks Saq!

I have written something like below with no luck

\define navigate-to-last() 
<$set name="lastTid" tiddler="$:/HistoryList" field="current-tiddler">
<$action-navigate $to=<<lastTid>> $scroll="yes"/> </$set>
\end  

Then I have a manual button to switch the Story View and then call navigate-to-last

What do you think? What is wrong with this code?

Mohammad

unread,
Dec 15, 2020, 11:09:41 AM12/15/20
to TiddlyWiki
The action button is like this of course it is bonded with a shortcut keys combination

<$button>Switch View
<$action-setfield $tiddler="$:/view" text={{{ [{$:/view}match[classic]then[zoomin]else[classic]] }}} />
<<navigate-to-last>>
</$button>

Saq Imtiaz

unread,
Dec 15, 2020, 11:51:52 AM12/15/20
to TiddlyWiki
Try this:
<$button actions=<<navigate-to-last>>>Switch View
<$action-setfield $tiddler="$:/view" text={{{ [{$:/view}match[classic]then[zoomin]else[classic]] }}} />
</$button>

Mohammad Rahmani

unread,
Dec 15, 2020, 1:06:20 PM12/15/20
to tiddl...@googlegroups.com
Thank you Saq,

No success.
I start from Classic View with tiddler A, switch to Zoomin View, have A in fous
then, open a few tiddlers and then switch back to Classic View. Tiddlywiki always opens
the first tiddler in my Open tab (e.g the first one in the story river) and navigates to .

--
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/ca8160f2-1c97-4cac-96cf-3c73e52b7bc4n%40googlegroups.com.

Saq Imtiaz

unread,
Dec 15, 2020, 1:23:40 PM12/15/20
to TiddlyWiki
I suspect the problem is that the navigate is handled before the story view has actually switched.

If you can post a file to play and experiment with, I can try to take a look as time allows.

Mohammad Rahmani

unread,
Dec 15, 2020, 1:29:27 PM12/15/20
to tiddl...@googlegroups.com
Sue, I prepare a minimal example! Should I post here or on GitHub Dev discussion board?



Best wishes
Mohammad


Saq Imtiaz

unread,
Dec 15, 2020, 1:40:34 PM12/15/20
to TiddlyWiki
Here should be fine. Thank you.

Mohammad Rahmani

unread,
Dec 15, 2020, 1:48:25 PM12/15/20
to tiddl...@googlegroups.com
Hi Saq,

This is a minimal sample.


Best wishes
Mohammad


story-view-switch-goto-last-tiddler.html

Mohammad Rahmani

unread,
Dec 17, 2020, 12:49:31 AM12/17/20
to tiddl...@googlegroups.com
Hi Saq,

 I tried to use the log mechanism in TW 5.1.23. I think the $navigate does not work correctly.
 Or on story view switching, Classic story view forces to refresh the story river and always focuses on the first item in the story list.

Best wishes
Mohammad

Saq Imtiaz

unread,
Dec 17, 2020, 2:56:44 AM12/17/20
to TiddlyWiki
Hi Mohammad,

Apologies, I did look into this briefly yesterday but I got distracted and forgot to reply.

So the underlying issue is that switching the story view triggers a refresh of the list widget that displays the entire story river. However, the action-navigate is handled before the list widget is refreshed, that is in the zoom story view. 

We do not currently have a way to deal with this in the core that I can think of immediately, but two potential options for the future are:
- a mechanism to save and restore the focused tiddler. (See https://github.com/Jermolene/TiddlyWiki5/issues/4782)
- a way to delay the execution of an action: https://github.com/Jermolene/TiddlyWiki5/issues/5036

Regards,
Saq

Mohammad Rahmani

unread,
Dec 17, 2020, 8:22:58 AM12/17/20
to tiddl...@googlegroups.com
Hi Saq,
 Many thanks for your time and effort.

I follow the references you mentioned. The reason I have to switch is, I use a zoomin story view for slideshow while classic story view for authoring and editing. Sometime in slideshow mode you need to return to author mode and need to have the same tiddler in focus. I tried to use classic view for both modes but I think TW gets slow when there's several tens of tiddlers.



Best wishes
Mohammad


Saq Imtiaz

unread,
Dec 17, 2020, 8:33:00 AM12/17/20
to TiddlyWiki
Two ideas:
- you could use the dynaview plugin so that only tiddlers in view are rendered, negating concerns over performance with too many open tiddlers.
OR
- you could actually modify the storylist to make the last focussed tiddler the first one in the story. It isn't ideal since the story order will not remain the same, but it will mean the user returns to the same tiddler.

Mohammad Rahmani

unread,
Dec 17, 2020, 8:50:35 AM12/17/20
to tiddl...@googlegroups.com
Thanks Saq,
First I go with dynaview to see how it works.


Best wishes
Mohammad


Reply all
Reply to author
Forward
0 new messages