[TOC] Table of Content - refactoring - ... again ;)

234 views
Skip to first unread message

PMario

unread,
May 2, 2019, 11:04:24 AM5/2/19
to TiddlyWiki
Hi Folks,


There are some visual improvements.

 - There are some "regression" fixes, that came with the last version
 - New "Sidebar: Open" behaviour - highlight selected tiddler
 - New "Sidebar: Contents" behaviour - highlight selected tiddler
 
And some conceptual improvements

 - More generic code, that supports "selected tiddler" highlighting
 - new plugin: "focused-tiddler", that may be included into the core.
    - It's a plugin atm, since it may interfere with
        - "dynaview-plugin" and
        - "TiddlyMaps - HotZone" plugin
 - Now concept for "tabbed-tocs"


Feedback is also very welcome here! ;)

-----------

And NO, it's not possible to "auto-expand" the tree, with the current structure of the TW TOC.

and YES, If the toc-structure is clean, it will be possible to implement "auto-expand". -> WIP

have fun!
mario


PMario

unread,
May 2, 2019, 11:05:28 AM5/2/19
to TiddlyWiki

TonyM

unread,
May 2, 2019, 8:36:59 PM5/2/19
to TiddlyWiki
Mario,

Thanks these improvements look great. 

  • Can we used the value of the "viewed tiddler" in other operations? like cause a popul if someone is looking at a specific tiddler? I think in someways what you have done is to provide access to the "active/visible tiddler" which new users often confuse with currentTiddler and advanced users would like access to for other reasons.
  • These would be very useful in conjunction with "Repopup, Volant, Mentat". effectively allowing a number of stories to be managed and visible at once on a dashboard.
  • Could I suggest that just as you used the viewTemplate to iterate tiddlers in an internal toc that we also provide the means define and use other templates. When you use the full view template to display the tiddlers within an internal TOC we could also enable an Update template that allows a given tiddler to provide selected editable fields, form like, rather than the classic editor. I think this easier to achieve inside an internal TOC but Ultimately I would like to see this even in the main story river.

Thanks for your work
Tony

PMario

unread,
May 3, 2019, 5:55:22 AM5/3/19
to TiddlyWiki
On Friday, May 3, 2019 at 2:36:59 AM UTC+2, TonyM wrote:
...
Thanks these improvements look great. 

Thx,

  • Can we used the value of the "viewed tiddler" in other operations?
Yes.

I did call it "focused-tiddler". It's a new field in the $:/HistoryList tiddler ... Changes to HistoryList activate the TW storyview "scroll-into-view" mechanism.
 
  • ... like cause a popul if someone is looking at a specific tiddler?
Should be doable. ... If an animation is active the mechanism uses the same delay that can be adjusted in the ControlPanel. eg: 400ms
 
  • I think in someways what you have done is to provide access to the "active/visible tiddler" which new users often confuse with currentTiddler and advanced users would like access to for other reasons.
Yes. ... At the moment the "focused-tiddler" field is set, if a tiddler title position reaches the upper 25% of the visible window area. eg: var treshold = viewportHeight / 4;

At the moment the mechanism uses the default Story, which is ok for the "classic" story-view. ... It will fail with some experimental story-views eg: "Stacked" which can be selected at TW prerelease. The reason is: I think I would have needed to many changes in the core to make it work. ... So it would take ages to get it merged. :/

  • These would be very useful in conjunction with "Repopup, Volant, Mentat". effectively allowing a number of stories to be managed and visible at once on a dashboard.
 
I don't know, how those plugins are implemented (Didn't have a look at the code). ... With the TW core 3 elements are involved to navigate the story.

 - The navigator-widget, which sets the "story" and "history" parameters.
    - internally it also sets the "tv-history-list" and "tv-story-list" variables.
    - those variables are now used by the TOC macros, which is much more flexible now.

 - the list-widget which is responsible to manipulate $:/StoryList - list field
    - It defines "viewTemplate" and "editTemplate"
    - The "storyview" is responsible for "animations" like: scroll-into-view, if a link is clicked and the tiddler is already open

 - story-view ... as written above is responsible for animations like
    - open tiddler animation
    - close tiddler animation
    - scroll into view ...

If those 3 elements are used in the right way, then yes. .... But I doubt that's the case.


  • Could I suggest that just as you used the viewTemplate to iterate tiddlers in an internal toc that we also provide the means define and use other templates.
yes ... That was just an example, that was easy to do. ...
 
  • When you use the full view template to display the tiddlers within an internal TOC we could also enable an Update template that allows a given tiddler to provide selected editable fields, form like, rather than the classic editor. I think this easier to achieve inside an internal TOC but Ultimately I would like to see this even in the main story river.
I don't understand, why everyone wants to edit tiddlers with the ViewTemplate, instead of using EditTemplates. ViewTemplates are the wrong tool here. ... Even the name is wrong!

The edit mechanism is well tested and has no side effects. ... We can have a 100 different EditTemplates if we want and we should start to use them.

No offence - just some thoughts ;)

have fun!
mario

TonyM

unread,
May 3, 2019, 6:13:58 AM5/3/19
to TiddlyWiki
Mario

Thanks for your responses. On the last item I am happy to use either modified edit templates or view templates since the idea of an update template is just a controlled or form based edit which is a non generic tiddler edit mode allowing the designer to simplify and control the elements to be edited by a user.

If there is a way to use multiple edit views or templates I am yet to find it, so please share.

Thanks and great work
Tony

PMario

unread,
May 3, 2019, 9:10:44 AM5/3/19
to TiddlyWiki
On Friday, May 3, 2019 at 12:13:58 PM UTC+2, TonyM wrote:
...

Thanks for your responses. On the last item I am happy to use either modified edit templates or view templates since the idea of an update template is just a controlled or form based edit which is a non generic tiddler edit mode allowing the designer to simplify and control the elements to be edited by a user.


You are right. The existing EditTemplate is way to complicated for ordinary designers to be used as an example for a "simple" tiddler "form"...
 

If there is a way to use multiple edit views or templates I am yet to find it, so please share.


The new "toc-tabbed-internal-nav" could be an example for a "tiddler-based" story, that allows us to generate simpler forms.

Such a story needs 2 elements:

 - A navigation section
 - A View / Edit section

The navigation section could be as simple as 2 links like: [[Tiddler 1]] [[Tiddler 2]]

The ViewTemplate could be as simple as:

<h1><<toc-caption>></h1>
<$transclude mode="block"></$transclude>

The EditTemplate ... depends on the use-case has to be done.

We'd need to specify the "simplest" tiddler editor, that still makes sense. 

have fun!
mario


Mohammad

unread,
May 4, 2019, 10:40:22 PM5/4/19
to TiddlyWiki
Hi Mario,

I like the new feature, highlight the tiddler under focus in TOC.
This way we can effectively step through contents without missing where we were.
I am going to experiment with it and will return hopefully with some more feedback.

Mohammad

Mohammad

unread,
May 5, 2019, 11:50:03 AM5/5/19
to TiddlyWiki
Hi Mario,
 I have two comments

  1. By default when you open a tiddler from TOC on the sidebar it is open at top of story list and this makes confusion. You clicked on TOC item from top to bottom but you see tiddler from bottom to top and when scroll focused tiddlers is the reverse direction
  2. When an item in the TOC is red (means focused-tiddler) by hovering mouse it gets underline but loses its red color! This makes second confusion. I think focuses tiddler is highlighted even when pointer is on that.
The exclude works fine in semantic way!

-Mohammad

PMario

unread,
May 5, 2019, 4:24:42 PM5/5/19
to TiddlyWiki
On Sunday, May 5, 2019 at 5:50:03 PM UTC+2, Mohammad wrote:
...
 I have two comments

Thx for testing.
 
  1. By default when you open a tiddler from TOC on the sidebar it is open at top of story list and this makes confusion. You clicked on TOC item from top to bottom but you see tiddler from bottom to top and when scroll focused tiddlers is the reverse direction
This setting can be changed in the ControlPanel: Settings: Tiddler Opening Behaviour. ... It's just a test version, where I did test several settings. 
  1. When an item in the TOC is red (means focused-tiddler) by hovering mouse it gets underline but loses its red color! This makes secondconfusion. I think focuses tiddler is highlighted even when pointer is on that.
Same here. Just a test CSS. To show the possibilities. ... It needs more refactoring. ... We may even add it to the palette, so users can change the behaviour if they want.

Keep the feedback coming :)

have fun!
mario



Mohammad

unread,
Jun 10, 2019, 4:15:49 PM6/10/19
to TiddlyWiki
Hi Mario,
 Is there any chance to have this refactored toc macro in TW 5.1.20?
Some features are really demanding by many users (like exclude,...)
Also the focused item and colored  toc item are really helpful!

--Mohammad

PMario

unread,
Jun 10, 2019, 5:13:47 PM6/10/19
to TiddlyWiki
Hi,
I'm creating a new PR atm. ...

An official "exclude" parameter will be part of the fix.

The "focused-tiddler" plugin will not be part of the PR. It will be a new wikilabs plugin.

-mario

Mohammad

unread,
Jun 10, 2019, 10:52:11 PM6/10/19
to TiddlyWiki
Thanks Mario,
 I would appreciate to notify community!

Best
Mohammad
Reply all
Reply to author
Forward
0 new messages