The Home Button from Early Days

I think Home button appeared in early days of Tiddlywiki 5. It can be used on the sidebar (page controls). On click, it shows the default tiddlers in the stroy river and refreshes the url to correct location.

But it is a button! Why we cannot assign some actions to it?
What do you think to have a slot under $:/ControlPanel > Basic > Default actions like Default tiddlers?

For example when I click the Home buttons I like to create a Journal tiddler for today if one does not exist.

What do you think? What other actions do you like to have?

Note: I do not want to create another user defined button! I like to see how better I can use the existing Home button!

This is a related discussion.

@Mohammad it is a little more specific than you say;

Its equivalent to open default tiddlers, and the default tiddlers are a configurable option.

I have argued for a mechanism to add any action to any button but that is a more expansive solution. See below.

  • However your limiting this to the existing Home button is in my view somewhat problematic

Because I consider the Home button as opening the “Home” tiddler I am not always happy with it opening other tiddlers, so I created two additional home buttons,

  • One opens the Home tiddler
  • One closes all and Opens the Home tiddler (the reset story option)
  • And we still have the normal home which applied the default tiddlers.

Then using Appearance > Toolbars > Page Toolbar I choose which to display and in which order.

alt-home-buttons.json (1.4 KB)

Whenever wanting to modify existing buttons another approach is to clone and modify them and hide the existing one behind more, this allows you to choose later.

This is a good idea, basically we can add a macro to each button;
actions=<<button-actions buttonname>>

And have this macro use as the actions any tiddler with the tag $:/tags/buttonname/action

  • Then any tiddler with the tag “$:/tags/buttonname/action” action will be applied.
  • I can give you this soon if you want it?

IF that can be done without breaking backwards compatibility, yes! Otherwise, no!

TT

Thank you all.

@TW_Tones

What I proposed is like this

from

<$button message="tm-home" 

to

<$button message="tm-home"  actions={{myactions}}
  • Now allow users to have their own actions, here do as below
    • Create myactions` tiddler
    • As an example just put below action inside it
    • <$action-sendmessage $message="tm-modal" $param="SampleWizard"/>
    • save
  • Click on the Home button and see what happen.

Summary

What I need to be added into the core is

In $:/core/ui/Buttons/home add actions to $button like actions={{$:/DefaultActions}}
Then users can edit $:/DefaultActions and put their actions inside this tiddler.

I assume this is backward compatible.

1 Like

@Mohammad this would work, but it would forever tie $:/DefaultActions to the home button and do nothing for configuring actions on any other button.

Rather than change the core to accommodate one case let us provide a more general solution, perhaps with the first button to transition being the Home button, but then once established transition every other button.

I will prepare a package to demonstrate this today.

In this reply I provide the steps, the plan and code example to implement this ultimately for all buttons, but starting with the home button. With the last step includes the feature you are looking for with $:/DefaultActions.

This plan to allow the addition of actions to any button is very simple and flexible, the reason I have being slow to submit a change to the core has being I want to do it to every existing button for reasons I have detailed elsewhere. But let us start with this use case; the Home button and your desire to have a $:/DefaultActions tiddler for the Home button.

First install this enabling macro button-actions-macro.json (515 Bytes) I plan to propose for addition to the core. It will have no effect unless the automatic tag names are used.

Now let us modify the home button to make use of this feature, as I would plan to do to all existing buttons, with a slightly different approach needed for just a few buttons already using action=.
new-home-button.json (784 Bytes) so if my plan was executed this would already exist in the core. In fact every button would be modified this way. Again installing this nothing happens until further configuration is done.

  • A few need different handling because they already use the actions= parameter on the button definition.
  • The modified home button I provide here can be assigned any action tiddler by tagging the action tiddler with $:/tags/button-actions/home - see next step.

Now dealing with the “Home Button from Early Days” to achieve what you are asking for you would simple add the following tiddler; $ _DefaultActions.json (214 Bytes) ie $:/DefaultActions

  • if you have the support of the community this tiddler (Although empty) could also become part of the core facilitating the user setting of the default actions on the Home button.
  • We could also make this tiddler editable like default tiddler is in $:/core/ui/ControlPanel/Basics
  • In this case I included your desired actions to create or edit todays Journal (but this is unlikely to be the default action for home - if any).
    • Of note is the Journal Button already has its actions externalised to its own tiddler $:/core/ui/Actions/new-journal so we just transclude that in as {{$:/core/ui/Actions/new-journal}}to $:/DefaultActions
  • Also note that this is triggered on the use of the home button, not at startup, as are the default tiddlers, but this too could be provisioned.

What do you think?

See this Proof of Concept https://all-button-actions.tiddlyhost.com (currently building)

Thank you Tony! Yes, that way you can add actions to any button.

Note, $:/DefaultActions what was I invented :wink:

Yes all credit to you for the idea of $:/DefaultActions

  • With my Solution in place, $:/DefaultActions is the only tiddler you need for your idea to be realised
    • With the tag $:/tags/button-actions/home
  • You may also want to edit $:/core/ui/ControlPanel/Basics to allow it to be edited however we can propose another core change that allows custom settings, perhaps an additional tab “custom” on Settings > info?
  • I will make a defaultActions package and add it to my POC site

I have decided to bite the bullet, and prepare all buttons to use this method.

  • I have managed to do this for 35 buttons so far
  • I have some remaining which are a little trickier
    • $:/core/ui/Buttons/fold-bar
    • $:/core/ui/Buttons/delete yes tricky
    • $:/core/ui/Buttons/cancel yes tricky
    • $:/core/ui/Buttons/export-page
    • $:/core/ui/Buttons/language
    • $:/core/ui/Buttons/palette
    • $:/core/ui/Buttons/encryption
    • $:/core/ui/Buttons/more-page-actions

I just wanted to emphasis that is not a core tiddler, we can use other name! It is selected in comparison to $:/DefaultTiddler.

I have added more buttons on my demo that allow additional actions to be assigned to most if not all buttons. All button actions.

I will launch a new topic to request comments.

1 Like