Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tree Macro -- Expand & Collapse all in a Branch? #3792

Open
TiddlyTweeter opened this issue Feb 22, 2019 · 11 comments
Open

Tree Macro -- Expand & Collapse all in a Branch? #3792

TiddlyTweeter opened this issue Feb 22, 2019 · 11 comments

Comments

@TiddlyTweeter
Copy link
Contributor

TiddlyTweeter commented Feb 22, 2019

Not quite sure where to put this ...
I started use the Tree macro a lot. I think its really excellent.
I looked at @morosanuae's experiment (see closed #3076)

I worked out how to fully collapse branches by deleting its $:/state/ tiddlers.

I'd like to be able, in the macro write <<tree "$:/fred/" expand-all>>. Or <<tree "$:/fred/" collapse-all>> I think that would increase its utility a lot.

@TiddlyTweeter TiddlyTweeter changed the title Tree Macro ... potentials. Tree Macro -- Expand & collapse all in a branch? Feb 22, 2019
@TiddlyTweeter TiddlyTweeter changed the title Tree Macro -- Expand & collapse all in a branch? Tree Macro -- Expand & Collapse all in a Branch? Feb 22, 2019
@00SS
Copy link
Contributor

00SS commented Feb 23, 2019

@TiddlyTweeter
@morosanuae closes all branches by deleting all related state tiddlers : <$action-deletetiddler $filter="[prefix[$:/state/tree/]]" />

So I guess to open all branches, one has to create all the proper state tiddlers which have show in their text field. Should be a cinch for you 😉

@morosanuae
Copy link
Contributor

@TiddlyTweeter @00SS Firstly, there isn't a simple and direct way of creating multiple state tiddlers by only pressing a button but I think it's possible. I saw that @Jermolene has implemented similar functionality here: https://tiddlywiki.com/#%24%3A%2Fcore%2Fui%2FControlPanel%2FStylesheet. Secondly, expanding all the branches will make the tree unusable in my opinion and degrade performance a lot especially when you have lots of tiddlers like me (thousands).

@00SS
Copy link
Contributor

00SS commented Feb 23, 2019

Though I have not looked at the code too deeply (I would probably get dizzy), I would hope wherever the filter makes a folder icon (branch-node), a state tiddler has to be made? It may even be clever to not reveal (open) anything beginning with $:/state/ & $:/temp/, and have a separate button for expanding System & Shadow tiddlers.

You have thousands of System tiddlers? Wow!

@morosanuae
Copy link
Contributor

@00SS

I would hope wherever the filter makes a folder icon (branch-node), a state tiddler has to be made?

The "list" widget used internally can be used to automate the display of things like folder icons but cannot be used to automate the creation of tiddlers. One must press a button to create a tiddler, e.g. state tiddler. The branch node is such a button.

It may even be clever to not reveal (open) anything beginning with $:/state/ & $:/temp/

I think an auxiliary exclusion filter (and parameter) can be added. I already use that in my private enhanced version of the macro.

and have a separate button for expanding System & Shadow tiddlers

I don't really understand this one. What would be the purpose of that?

You have thousands of System tiddlers? Wow!

In my testing/development wiki yes. But when I mean system tiddlers I mean all the tiddlers with system role (prefixed with $:/) including shadows. The default (empty) version of TiddlyWiki alone has around 2000 "system role" tiddlers.

@00SS
Copy link
Contributor

00SS commented Feb 24, 2019

and have a separate button for expanding System & Shadow tiddlers

I don't really understand this one. What would be the purpose of that?

Sorry, I was a little unclear. I am aware there MUST be a button to create the state tiddlers to "open" all the branches, just like there is one in your very nicely made tree-v2 macro to "close" all branches.

What I meant was, there could be one button for "opening" only the System branch, and another for only "opening" the Shadow branch - depending on which radio box option (System or Shadow) one had chosen. That way, the performance degrade would be much less than by having them all open at one time.

@TiddlyTweeter
Copy link
Contributor Author

@morosanuae I agree that expanding the whole tree would likely damage performance. In any case it wouldn't make much sense as you'd get buried in too many items.

But for specific branches it could be very, very useful. For instance I have the branch "$:/tt/ts/ser/" that has 43 tiddlers total spread over 5 sub-branches. That seems useful to have expansion for and with manageable impact.

I'll look at the Jermolene thing you mentioned. Thanks

cc @00SS

@morosanuae
Copy link
Contributor

@TiddlyTweeter Maybe the specific branch expanding would be useful but what if I mistakenly expand the "core" branch for example. Bam! The system is jammed! I've run into similar problems when I used the "list" widget that has a default filter that includes all the tiddlers.
And the problem with creating multiple state tiddler in a batch remains. I don't know if the Jeremy approach will suit this case. I didn't inspected it yet.
Anyway this is not going to be a part of the "core" functionality of TiddlyWiki too soon so...

@TiddlyTweeter
Copy link
Contributor Author

Anyway this is not going to be a part of the "core" functionality of TiddlyWiki too soon so...

Right. Just FYI I use the tree to (1) speed up "developing" TW; (2) improve my understanding of how TW works. For public apps the existing macro seems to cover most cases I can think of so that is not an issue.

But expanding its potential in a plugin is a good idea--if you have the time and interest for it.

I'm not sure how big the wider audience for it is. For a long time I ignored it ... till I took it out the sidebar and statred integrating it into Tiddlers where it shines best IMO.

@TiddlyTweeter
Copy link
Contributor Author

One obvious component might be to add a "filter tree" to the Advanced Search tabs?

@morosanuae
Copy link
Contributor

@TiddlyTweeter

Just FYI I use the tree to (1) speed up "developing" TW; (2) improve my understanding of how TW works.

From the beginning of using TW I was looking for something to aid me in understanding of the system structure. I'm also more efficient at planning and developing when I have a big picture of what's going on internally so I know what you're saying.

But expanding its potential in a plugin is a good idea--if you have the time and interest for it.

This is one of my plans but... I have interest in it but I don't have a lot of free time. Maybe this spring. I'll keep you informed. I've noted that you are willing to help. Thanks.

@TiddlyTweeter
Copy link
Contributor Author

TiddlyTweeter commented Oct 22, 2019

I will close this as it seems any innovation in "Tree View"would be best suited to a plugin for reasons laid out by @morosanuae here & @Jermolene in #4260

FYI, in my own case--solving the OP for my functional needs--I simply click in the normal way to open "branches" in Explorer. I then have a macro under a button that changes the value of the state tiddlers under a branch (including nested branches) from "show" to "hide" and vice-versa. I also have a "delete" button that clears all tree states. Functionally this gives what I need, i.e. selective expansion of nested branches that can be "bulk" hidden/shown.

Before I close this it I want to "bookmark" related notes so some of the important "Tree View" discussions can be found.

I will close the issue in a couple of days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants