The $:/tags/SideBarSegment tag <<tag $:/tags/SideBarSegment>> is how Items are added to the sideBar
The Tiddler $:/core/ui/SideBarSegments/tabs is one of these and
lists the sidebar tabs with <<tag $:/tags/SideBar>>
Review $:/core/ui/SideBarSegments/tabs for the code
$:/core/ui/SideBarSegments/tabs
To cut a long story short each time you select a tab it updates explicitState="$:/state/tab/sidebar--595412856"/> with the tabs tiddlername. Eg open the Open tab and it contains $:/core/ui/SideBar/Open
Now modify the Home and Close all Buttons, perhaps using actions=<<your-actions>> on the button widget and ;
It is so each tiddler can generate its own unique state tiddler because this number is influenced by where the <<qualify prefix>> macro was invoked. It is however somewhat redundant when used in core tiddlers like the page template because the “number” will always be the same.
If you wanted to toggle something on each tiddler seperatly you need a different state tiddler for every tiddler or they would affect other tiddlers.