How to create a button to fold all toc-selective-expandable

Incidentally I had an idea about using the date time stamps on state tiddlers to see the most recently expanded and collapsed tiddlers in a given TOC, using the state tiddlers naming standard/prefix of course.

As a result I would recommend setting the text field to open (or I assume closed/empty) rather than deleting the state tiddlers, and perhaps if possible also with timestamps=no to retain the created/modified data.

  • This would allow us to preserve the state changes in large TOC’s

Why would we want to maintain state changes in large TOC’s?

  • To save and restore the state for a large complex TOC
  • To identify and open the last TOC expanded
  • To alter the appearance of recently selected
  • To be able to playback all expand/collapse activities just now using modified today

This make me wonder if a few simple tweaks in the TOC and other macros and solutions with how we manage state tiddlers, it would permit additional features to be developed such as expand and collapse steps to a particular tiddler.

Perhaps another feature of custom TOC’s @pmario