What are these numbers in the "$:/state/" tiddlers/What is the best way to open a specific tab with a button?

I know that I can modify the text field of a “state” tiddler e.g.$:/state/tab/sidebar--595412856 with an $action in a $button widget to change the active tab in a tabs macro, but the number that appears next to these state tiddlers confuses me…

They are explicitly defined in the tiddlers that contain the tabs macro, so I shouldn’t in theory be afraid of them changing, but I’m asking to be safe.

I don’t really care what they are, just if they could change (thus making my buttons obsolete)

  • There is a right way to make a button open a specific tab?

qualifiers, I found that they can change on nodejs versionwhen server is restarted. I have startup actions to expand a specific level of the toc that I need to adjust when restarting the server.

I assume it is the same for tabs macro.

See this post for a good method of determining the qualifier and dealing with them.

1 Like

But in this case it really does seem to be hard-coded, which is odd:

<$macrocall $name="tabs" tabsList="[all[shadows+tiddlers]tag[$:/tags/SideBar]!has[draft.of]]" default={{$:/config/DefaultSidebarTab}} state="$:/state/tab/sidebar" class="tc-sidebar-tabs-main" explicitState="$:/state/tab/sidebar--595412856"/>

The same number is used in the upcoming 5.3.0, so it really does seem to be hard-coded. I’m surprised a more descriptive explicitState wasn’t used.

1 Like

The explicitState in your example is needed to be able to implement keyboard handling to switch between tabs.

If you open AdvancedSearch you can use CTRL-ALT left-arrow or right-arrow keys to switch between tabs.

The odd qualifier-name is used for backwards compatibility reasons.

1 Like

I’m sorry I couldn’t reply earlier. Thanks everyone for the replies!
So I understand that I should use just as is e.g. $:/state/tab/sidebar--595412856, right?


By the way, interesting reading

-Sam

yes. But only for that particular tabs macro. The qualify number is different for every core tabs macro. … So if you want to manipulate them, you have to find the corresponding number first