TiddlyWiki / TiddlyWiki5

A self-contained JavaScript wiki for the browser, Node.js, AWS Lambda etc.
https://tiddlywiki.com/
Other
8.04k stars 1.19k forks source link

Proposal: make navigator.js + friends "multi - story" aware. #4354

Open pmario opened 5 years ago

pmario commented 5 years ago

At the moment, the navigator-widget contains some hardcoded variables, that are used to navigate the "main" story-river.

On the other hand, we have the tv-xxxx-list variables, that propagate the active story and history. ... BUT this info isn't used by the core at the moment, since it was included with version: TW 5.1.15 with PR #2904 in June 2017

The list-widget also contains a parameter that allows us to define the history-list that should be used for list-navigation. ... BUT it doesn't use or set the variable in the right way. .... probably an oversight in #2904

The navigator-widget is relatively heavy-weight, compared to other widgets (605 sloc). So it should be only "instantiated" if really needed.

The link-catcher was introduced by: saqimtiaz and is used to "catch and modify" the tm-navigate message. ... linkcatcher allows us to "group" navigation events, that should "land" in a "different" story-river or should do completely different things.

So with the combination of

we are able to handle every navigation request on the "link-level" with only 1 navigator instance. ...

That means if the link-widget would send the tv-story-list and tv-history-list information with the tm-navigate message, and navigator.js would use this info, multi-story handling would be finished!

pmario commented 5 years ago

Meta-PR will follow soon!

pmario commented 5 years ago

-- reserved --

pmario commented 5 years ago

In TW the list-widget is responsible to "redraw" the story, using the story-list tiddler.

A story redraw happens if and only if the active history-list tiddler has been changed.

navigator.js changes the history-list current-tiddler filed if tm-navigate tells it to do so.

So the only 2 elements, that are really important, if we want to trigger a story refresh are

pmario commented 5 years ago

DOM animations like: ".scrollintoview()" are calculated by so called "story-views" like classic.js

story-views are instantiated using the list-widget.

pmario commented 5 years ago

I think, that's all the elements, that are effected by this proposal if we add: $:/core/modules/utils/dom/scroller.js to the list ;)

pmario commented 5 years ago

If this proposal is done. "Proposal: a sidebar tab where we can save and restore stories"

4319 will be as simple as calling some macros.

pmario commented 4 years ago

Just introduced "interactive test framework at GG"

https://wikilabs.github.io/editions/trigger/ should help to detect problems.

pmario commented 4 years ago

related to: "Implement more of TiddlyWiki's black box logic as customisable action strings #3967"

Jermolene commented 4 years ago

Hi @pmario I'm struggling to understand this ticket, I'm afraid. Well, I understand the proposal in the last paragraph of your OP, but I don't understand what features it enables?

Is it that your story handling plugin wants to dynamically change the current storylist tiddler from $:/StoryList to whatever is selected in the sidebar? I'd imagined that it would copy the data to $:/StoryList.