Different implementation of custom buttons for different toolbars

I was reviewing my notes about subj and found out that my draft from this thread Documentation about toolbars is not accurate.

I can have an Edit toolbar (or View toolbar) button like this:

<$button>
<$action-sendmessage $message="tm-modal" $param="SampleModal" />
{{$:/core/images/discord}}
</$button>

Here SampleModal is a tiddler that has content displayed in the modal window.

If I tag this tiddler $:/tags/EditToolbar and save, the button starts getting displayed in tiddler edit window.

But it seems that creating a custom button for the Editor toolbar isn’t as simple as changing the $:/tags/EditToolbar tag to $:/tags/EditorToolbar. I had to do the following changes (by looking at core buttons code):

  1. Remove the explicit <$button> widget wikitext, leave only action code:
<$action-sendmessage $message="tm-modal" $param="SampleModal" />
  1. Remove the transclusion of button icon, add the icon as icon field instead

  2. If I want the button to always show up, have a mandatory condition field with non-empty value.

Could anybody please explain the implementation inconsistencies here? What makes the Editor toolbar so different?

See the docs at: https://tiddlywiki.com/#How%20to%20create%20dynamic%20editor%20toolbar%20buttons

There is no inconsistency. TW UI Toolbar buttons are created using list-widgets and templates.

So the “code” only has to be created once. The toolbar button configurations contains the values that define the button behaviour. That’s basically it.

The templates are: