Click to expand all button?

119 views
Skip to first unread message

passingby

unread,
Jul 7, 2019, 4:51:02 PM7/7/19
to TiddlyWiki
Can we have a 'click to expand all' button? Specifically in toc-tabbed-internal-nav ? 

Additionally: can this behavior of expanding and contracting be implemented with mouse hover on the links? Right now we have to click the arrow on left, and it stays open till it is clicked again. 

PMario

unread,
Jul 8, 2019, 4:06:13 AM7/8/19
to TiddlyWiki
On Sunday, July 7, 2019 at 10:51:02 PM UTC+2, passingby wrote:
Can we have a 'click to expand all' button? Specifically in toc-tabbed-internal-nav ? 

This should be possible. ... At the moment, there is a pending PR at github, that fixes some problems introduced with 5.1.19 and prepares for easier plugin interaction. eg: auto-expand and highlight the focused tiddler.

Once this mechanism works it should be possible to implement the feature that you describe, at a plugin level.
 
Additionally: can this behavior of expanding and contracting be implemented with mouse hover on the links?

At the moment we don't have a widget, that activates actions on hover. ... We would need a short time delay. eg: 500ms or so. Otherwise it would be a mess.

Closing 1 branch imo would be triggered, if a different branch on the same level is opened. ... IMO this will be tricky.

In short: With 5.1.20 it may be possible if https://github.com/Jermolene/TiddlyWiki5/pull/3975 gets merged.

-m

Jeremy Ruston

unread,
Jul 8, 2019, 6:56:10 AM7/8/19
to PMario, TiddlyWiki
There's an unexpected subtlety here: even with quite a small number of tags, it is possible for a fully expanded table of contents to have many millions of entries.

For example, AMBIT's main wiki (https://manuals.annafreud.org/ambit) has just over 1,000 tags but they are so interconnected that a fully expanded table of contents had 1.4 million entries when I was doing some experiments a few months ago.

So, I tend to think an expand-all button should not be part of the core. Generally, I'm not in favour of adding more and more functionality to the core macros because it compromises one of their primary purposes: to act as simple examples for people to use as a starting point for their own macros.

Best wishes

Jeremy


On 8 Jul 2019, at 09:06, PMario <pmar...@gmail.com> wrote:


--
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 post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/fe824cd8-73a3-46eb-b64e-ab24d256cc1b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

PMario

unread,
Jul 8, 2019, 8:47:06 AM7/8/19
to tiddl...@googlegroups.com
On Monday, July 8, 2019 at 12:56:10 PM UTC+2, Jeremy Ruston wrote:
There's an unexpected subtlety here: even with quite a small number of tags, it is possible for a fully expanded table of contents to have many millions of entries.

That's also true for tiddlywiki.com documentation. That's why I think using tags to create a TOC is not the best way to do it. ... But it's definitely the easiest.
 
For example, AMBIT's main wiki (https://manuals.annafreud.org/ambit) has just over 1,000 tags but they are so interconnected that a fully expanded table of contents had 1.4 million entries when I was doing some experiments a few months ago.

That's probably a "worst case" and a "nightmare" scenario. Tags are used to define a "group" relationship between topics (titles). A TOC table of contents is used to bring a hierarchical structure to a highly interconnected system. Both goals are valid, but they are fundamentally different!

So IMO you can't have both, if you use tags only. The problem is easy to solve. Use an eg: parent-field to create a 1 to 1 relation from a "child" tiddler to the level above, the parent. I'm using this mechanism for the tocP plugin. It allows you to create different hierarchical "tracks" using different "parent"-field names.

The advantage is, that by design no duplicates can happen.
 
So, I tend to think an expand-all button should not be part of the core.

That's why I wrote: "at a plugin level"!
 
Generally, I'm not in favour of adding more and more functionality to the core macros because it compromises one of their primary purposes: to act as simple examples for people to use as a starting point for their own macros.

That's OK, as long as we prepare the core TOC, to be extendable by plugins.

-mario



Mohammad

unread,
Jul 8, 2019, 1:38:28 PM7/8/19
to TiddlyWiki
The tocP is really handy!
Does it also support exclude filter?

I am interested to use it in some of my plugins.

--Mohammad

PMario

unread,
Jul 8, 2019, 6:24:46 PM7/8/19
to TiddlyWiki
On Monday, July 8, 2019 at 7:38:28 PM UTC+2, Mohammad wrote:
The tocP is really handy!
Does it also support exclude filter?

Not yet.

-m

Mohammad

unread,
Jul 8, 2019, 10:57:58 PM7/8/19
to TiddlyWiki
Hello Passingby,

Have a look at TW-Scripts

You find small code to open all tiddlers meed some criteria!
As Jeremy recommends it is not good for a large wiki TOC, but
this can be used for your own case.

--Mohammad

Always consult TW-Scripts it may have some clues

TonyM

unread,
Jul 8, 2019, 11:08:07 PM7/8/19
to TiddlyWiki
Mario's To co is great.

The built in toc macros serve their purpose with contents etc... It is however a reoccurring theme for people to try and force them to do more.

I think it would be a good idea to provide a simple recursive process example in tiddlywiki.com examples which would assist people building there own custom trees. Taking this approach allows people to move trees into fields like Mario's tocP and get full control.

I am happy to write it if you agree. It will also be an opportunity to describe unwanted recursion as well.

I would still need some help addressing the expand all part of the OT original thread.

Regards
Tony

passingby

unread,
Jul 9, 2019, 3:13:40 PM7/9/19
to TiddlyWiki


On Monday, July 8, 2019 at 7:57:58 PM UTC-7, Mohammad wrote:
Hello Passingby,

Have a look at TW-Scripts

You find small code to open all tiddlers meed some criteria!
As Jeremy recommends it is not good for a large wiki TOC, but
this can be used for your own case.

--Mohammad

Always consult TW-Scripts it may have some clues

Hello Mohammed,
I have already bookmarked your TW-Scripts! I find it very informative and insightful.

On this link you ll see a table of contents button which when  pressed presents a tree with branches which can be expanded and collapsed. Additionally on the top there is a 'expand all' link which toggles the whole table of content.

I think its beyond my TW programming skill to hack out something like this. Also the need is not that pressing. So I am going ahead without it. 

Jeremy Ruston

unread,
Jul 9, 2019, 5:10:34 PM7/9/19
to tiddl...@googlegroups.com
Hi Mario


On 8 Jul 2019, at 13:47, PMario <pmar...@gmail.com> wrote:

That's OK, as long as we prepare the core TOC, to be extendable by plugins. 

The only sense in which the TOC macros should be extendable is by local overrides of the internal macros (e.g. a local override of <<toc-caption>>).

If a plugin wants to make a better TOC it is more robust and future proof for it to duplicate the core code, rather than trying to hook into it.

Part of the problem here is that the core TOC macros are currently running at 200 lines because of all the complexity we’ve levered in. The heart of them is much simpler than that; it’s not some massive piece of infrastructure that we need to structure for partial reuse.

Best wishes

Jeremy

Mohammad

unread,
Jul 11, 2019, 2:38:10 AM7/11/19
to TiddlyWiki


On Tuesday, July 9, 2019 at 11:43:40 PM UTC+4:30, passingby wrote:


On Monday, July 8, 2019 at 7:57:58 PM UTC-7, Mohammad wrote:
Hello Passingby,

Have a look at TW-Scripts

You find small code to open all tiddlers meed some criteria!
As Jeremy recommends it is not good for a large wiki TOC, but
this can be used for your own case.

--Mohammad

Always consult TW-Scripts it may have some clues

Hello Mohammed,
I have already bookmarked your TW-Scripts! I find it very informative and insightful.



I see! It is a customized TOC macro! Not sure but I think MarkS has published here a revised TOC macro and it may be useful!

Adam S.

unread,
Jul 11, 2019, 6:24:37 AM7/11/19
to TiddlyWiki
I would like to have the opposite of this. I often have multiple things expanded and would like to close them all up with one click. In some programs I can use alt+click to close up all groups for example, that would be a great functionality if it is possible.


On Sunday, July 7, 2019 at 10:51:02 PM UTC+2, passingby wrote:
Reply all
Reply to author
Forward
0 new messages