[RFC] Add additional actions to most buttons

Folks I have implemented my Idea: Addition to core hacking button actions no need to read, just for reference. On the following POC site;

https://all-button-actions.tiddlyhost.com/

Also as raised in response to The Home Button from Early Days

Basically I have added a facility that allows you to place some actions in a tiddler and tag it with a tag of the form $:/core/ui/Buttons/buttoname where “buttonname” is the short name at the end of the existing core buttons.

Then every time you click that button your additional actions will be performed.

Rational

  • Designers of wikis often find there solutions having to present a button to cause an action, to trigger something. This sometimes feels a little too manual, and hard to automate.
  • Yet at the same time we are always making use of the view, edit and page controls buttons for everyday actions such as editing, saving tiddlers, saving the wiki or many other actions.
  • Being able to add configurable actions to any button, allows us to use these to trigger other actions perhaps even respond to what you just did at the right time.

I am keen to hear feedback from the community.

I believe in most cases this adds very little overhead and size, and I would suggest one day it could exist in the standard distribution.

Hi @TW_Tones, I find this idea interesting.
One idea I am contemplating is the tiddler save button that would, when it is a brand new tiddler, automatically add a Streams node. Do you think your mechanism would allow these types of actions?

Yes, I expect this is possible but I need to think how we identify it is a new tiddler.

An alternative approach would be on save tiddler to conditionally do what every is needed to add the stream if it has not already being done. Ie on any save at any time, not only on new tiddlers.

Streams provides the ability to include a + to add the stream at any time on any tiddler

  • Why not just use this functionality?
    • that is there is no need to create a stream unless you really are about to enter content into the stream

Or do you have some other idea?

  • If you explain the actions you want, I can do it on the demo site.

Hi Tones,

I am trying to streamline my workflow, though I agree it is only a minor improvement. Since I am exclusively using Streams nodes for content, I find myself creating an empty root tiddler every time, only to immediately turn around to add a first node, in which I place my content. Like you suggest, all I need to do is first save, then press +.

I think there are a few ways to achieve this, but one that seemed relatively simple is to overload the “save tiddler” button. If for example, I include a couple of reveal widgets based on the presence / absence of a specific field, the button could save then create a new first node when the field is absent (ie, brand new tiddler) (and also set the field), or alternatively behave regularly when the field is already present, suggesting this is not a brand new tiddler.

1 Like

I just want to remind you I have a demo wiki here https://all-button-actions.tiddlyhost.com

I moved the examples to their own tiddler and added another example wich is actualy quite good;

Example add an action to the close button
See “On close open focused” tiddler, which is tagged $:/tags/button-actions/close and as a result will be actioned each time you use the close button in this wiki.

  • What this does is rather than just close the tiddler, it will close and navigate to the last tiddler according to the value in $:/HistoryList!!current-tiddler
  • The condition ensures if you close the current-tiddler it will not imediatly reopen it.
  • You could modify the condition to only navigate with ctrl-click

What is nice about it is if you scroll down selectively closing tiddlers the focus always returns to the last tiddler (If is not one you closed).

Well it is now, Just visit my demo site, create a tiddler and tag it $:/tags/button-actions/save

  • Now enter any actions you want to happen on every click of the save button, the “tick button” in the edit view.
  • Remember you can wrap it in a list or reveal widget to do a conditional check, like !has[stream-type]

For reference purposes, I stumbled on a prior attempt by me to achieve this.

1 Like

There seems to be a problem in the right sidebar : dropdown

Thanks one missing “>” in the $:/core/ui/Buttons/language tiddler.

On that demo site as noted on the Home page there is an alternate layout that activates actions tagged $:/tags/on-navigate for navigation actions. Yet to be tested comprehensively.