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

Bug saving default sidebar tab on v5.2.1 #6492

Closed
PotOfCoffee2Go opened this issue Feb 27, 2022 · 2 comments
Closed

Bug saving default sidebar tab on v5.2.1 #6492

PotOfCoffee2Go opened this issue Feb 27, 2022 · 2 comments

Comments

@PotOfCoffee2Go
Copy link
Contributor

Steps to reproduce bug:

  1. https://tiddlywiki.com/ and download empty.html (v5.2.1)

  2. Open 'empty.html'

  3. ControlPanel -> Appearence -> Settings -> Default Sidebar Tab

  4. Change to 'Tools'

  5. Save as 'empty (1).html'

  6. Open 'empty (1).html'

  7. Just select the 'Open' tab in sidebar

  8. Save as 'empty (1) (1).html'

  9. Open 'empty (1) (1).html'

  10. "bug" - Notice that sidebar displaying the 'Open' tab (should be 'Tools')

  11. ControlPanel -> Appearence -> Settings -> Default Sidebar Tab

  12. Indicates 'Tools' is to be default sidebar tab on load

@pmario
Copy link
Contributor

pmario commented Feb 27, 2022

That's desired behaviour. In step 7) you change the tiddler $:/state/tab/sidebar--595412856 .. So it exists. As soon as this tiddler exists it will be persistent, in single-file wikis, since $:/state/* tiddlers are saved.

See the tabs macro docs It says:

default
The title of the tiddler whose tab is to be selected by default, if the state tiddler doesn't exist. The state tiddler takes precedence over this setting

You may remove all of some state tiddlers with a TW startup action ... or even simpler ...

  • You can create a tiddler named eg: my-save-exclude-filter
  • and tag it: $:/tags/Macro
  • with this content:
\define publishFilter() -[[$:/state/tab/sidebar--595412856]]

Now your sidebar-tab state filter will be excluded from the save file. .. $:/core/save/all is responsible, for what is saved in singel-file wikis. ... Using the publishFilter will allow you to define additional rules, which are added there (see the last parameter in save/all)

You could also use -[prefix[$:/state/]], if you wish to do so.

@PotOfCoffee2Go
Copy link
Contributor Author

Thanks for the detailed response. I had misinterpreted that setting to 'tools' in the ControlPanel was all that was required to keep it locked onto that sidebar tab on reload.

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

2 participants