Ticket #608 (closed enhancement: fixed)

Opened 4 years ago

Last modified 3 years ago

toolbar ">" should toggle between "more/less" and display extra commands on separate line

Reported by: EricShulman Owned by: EricShulman
Priority: minor Milestone: 2.5.1
Component: core Version:
Severity: trivial Keywords:
Cc:

Description (last modified by EricShulman) (diff)

This change would extend the <<toolbar>> macro to make the ">" (more) a //toggle// between "more" and "less" instead of displaying "more" and then replacing it with extra commands when clicked. It also displays the extra toolbar commands on a separate line (instead of inline), so that the more/less command will always be the last item in the regular tiddler toolbar and the added commands are more visually distinct.

This change has been successfully implemented as a TiddlyTools CoreTweak?. see  http://www.TiddlyTools.com tiddler toolbars for a working example.

merge(config.macros.toolbar,{
	moreLabel: "more",
	morePrompt: "Show additional commands",
	lessLabel: "less",
	lessPrompt: "Hide additional commands",
	});
config.macros.toolbar.onClickMore = function(ev)
{
	var e = this.nextSibling;
	var showing=e.style.display=="block";
	e.style.display = showing?"none":"block";
	this.innerHTML=showing?config.macros.toolbar.moreLabel:config.macros.toolbar.lessLabel;
	this.title=showing?config.macros.toolbar.morePrompt:config.macros.toolbar.lessPrompt;
	return false;
};

Attachments

ticket608.patch Download (3.0 KB) - added by PhilHawksworth 3 years ago.
Patch to implement more/less toggle on tiddler commands.
ticket608.2.patch Download (1.3 KB) - added by PhilHawksworth 3 years ago.
Revised patch to implement Eric's solution as described at the top of this ticket
ticket608_609.patch Download (1.7 KB) - added by EricShulman 3 years ago.
adds more/less toggle and separator syntax to toolbar handler

Change History

  Changed 4 years ago by EricShulman

  • description modified (diff)
  • summary changed from toolbar ">" toggles "more/less" and displays additional command on separate line to toolbar ">" should toggle between "more/less" and display extra commands on separate line

  Changed 4 years ago by MartinBudden

  • milestone set to 2.5

  Changed 3 years ago by FND

  • milestone changed from 2.5 to 2.4.2

  Changed 3 years ago by MartinBudden

  • owner changed from JeremyRuston to PhilHawksworth

Changed 3 years ago by PhilHawksworth

Patch to implement more/less toggle on tiddler commands.

follow-up: ↓ 6   Changed 3 years ago by PhilHawksworth

  • status changed from new to assigned

The more / less toggle was not quite implemented as initially discussed here. Rather than displaying the additional commands on a new line, they are displayed inline the same way that they have been previously. The 'less' button is displayed as the last command so that the use can simply toggle without moving their mouse.

This patch also brings the more/less commands into line with the implementation of other commands.

in reply to: ↑ 5   Changed 3 years ago by EricShulman

Replying to PhilHawksworth:

The more / less toggle was not quite implemented as initially discussed here. Rather than displaying the additional commands on a new line, they are displayed inline the same way that they have been previously. The 'less' button is displayed as the last command so that the use can simply toggle without moving their mouse. This patch also brings the more/less commands into line with the implementation of other commands.

Please.... don't do it this way!! The purpose of putting the more commands on a separate line was primarily for usability reasons:

First of all, leaving the 'more' commands on the same line can cause a BIG layout problem... there's often simply not enough room on one line to display all the commands (which is WHY the 'more' approach is needed). If there are more than just a few extra commands added, *some* of those commands will inevitably wrap onto a second line anyway, but without a clear visual separation between the original commands and the 'extra' commands that were just displayed...

... and, because automatic word-wrapping will add the linebreak wherever it needs to, the two line toolbar that results:

  • looks supremely ugly (one long line of commands with just one or two wrapped onto a second line) and,
  • makes it MUCH harder to recognize that new commands have appeared.

This is even more problematic if the commands *don't* wrap onto a second line, as the 'blink' that occurs when the single line of commands is expanded doesn't really make it apparent that anything has changed, unless you carefully study the choices that now appear in the toolbar and notice the different commands that have suddenly appeared.

By placing the 'more' commands on a second line: * it leaves enough room to actually add a practical number of additional commands * it ensures that the extra commands are visually distinct and NOT 'blended' into the existing toolbar line

As written, this patch does NOT provide the extra usability that the CoreTweak? implementation does, and would not allow that tweak to be retired from distribution and could add more confusion due to the differences between the CoreTweak?'s handling and the core patch that was submitted.

*Permitting* the more commands to remain on the same line (assuming they fit) is, of course, appropriate for particular use-cases... but so is the ability to put the extra commands on a separate line as needed or desired for a given document.

Here's an idea that would allow flexible configuration using a very simple extension to the toolbar syntax:

  • First, don't *automatically* place the 'less' command at the end of the menu new menu. Instead, allow the placement of 'less' to be specified as part of the additional toolbar item, by using "<" (i.e., the inverse of the ">" used for 'more').
  • Then, add a special symbol (I suggest "*") to indicate where a line break should occur in the toolbar.

Thus, to produce a one-line style, with "less" at the end:

| ViewToolbar| foo bar baz > yabba dabba doo < |

resulting in:

foo bar baz more
   and
foo bar baz yabba dabba doo less

or to use the CoreTweaks? two-line style:

| ViewToolbar| foo bar baz > < * yabba dabba doo |

which would produce

foo bar baz more
   and
foo bar baz less
yabba dabba doo

With the two new additional symbols above, the full set of 'toolbar symbols' would be:

> more
< less
! separator
* line break

Which seems to fit nicely into the current toolbar definition usage (which is already using the ">" symbol, and will soon support "!" as a separator (see ticket #607).

As I write these comments, I'm starting to like this idea *a lot*... I think it is definitely the most flexible and easy-to-use approach. In fact, I will probably replace my existing CoreTweak?608 with a new one that implements the above approach instead.

Please let's discuss this a bit before reaching a conclusion for the core...

  Changed 3 years ago by FND

  • milestone changed from 2.4.2 to 2.5.1

It appears more discussion is required here, so we've decided to push this to 2.5.1 to avoid delaying the 2.4.2 release.

follow-up: ↓ 9   Changed 3 years ago by MartinBudden

  • owner changed from PhilHawksworth to EricShulman
  • status changed from assigned to new

in reply to: ↑ 8   Changed 3 years ago by PhilHawksworth

Replying to MartinBudden:

Fair enough. Let's implement Eric's solution.

  Changed 3 years ago by FND

  • owner changed from EricShulman to PhilHawksworth

follow-up: ↓ 12   Changed 3 years ago by PhilHawksworth

  • status changed from new to assigned

Changed 3 years ago by PhilHawksworth

Revised patch to implement Eric's solution as described at the top of this ticket

in reply to: ↑ 11 ; follow-up: ↓ 13   Changed 3 years ago by EricShulman

Phil... the solution "as described at the TOP of the ticket" is *NOT* the solution that was arrived at AFTER further discussion, as noted in this ticket. The original solution was NOT SUFFICIENT, as it did not provide backward-compatible support for the current single-line toolbar layout usage in addition to the intended enhanced multi-line layout.

As described above, the current solution, which has been successfully field-tested for many months as a TiddlyTools CoreTweak?, adds "<" (less) and "*" (newline) the existing ">" (more) syntax to permit flexible and robust control over the placement of the more/less, as well as the occurrence of linebreaks in the toolbar.

The current patch, ticket608.2.patch, should be removed ASAP, as it does NOT implement the solution to this ticket.

As noted in the Developer's Conference Call, I will be preparing a proper patch file for this ticket as soon as I can resolve a problem with the patch-generating tools on my system.

in reply to: ↑ 12 ; follow-up: ↓ 14   Changed 3 years ago by PhilHawksworth

Replying to EricShulman:

The current patch, ticket608.2.patch, should be removed ASAP, as it does NOT implement the solution to this ticket.

As noted in the Developer's Conference Call, I will be preparing a proper patch file for this ticket as soon as I can resolve a problem with the patch-generating tools on my system.

Eric, I was not around for that call. That's great news though. I'll remove this patch so that you can supply a patch yourself.

in reply to: ↑ 13   Changed 3 years ago by PhilHawksworth

Replying to PhilHawksworth:

Eric, I was not around for that call. That's great news though. I'll remove this patch so that you can supply a patch yourself.

In fact, I don;t have the privileges to remove a patch. Actually, I think that it is useful to keep previous patches in the system to that any discussion referencing them can have some context. The 608.2.patch is not to be applied. Eric's pending replacement will be the one to go for.

  Changed 3 years ago by MartinBudden

  • owner changed from PhilHawksworth to EricShulman
  • status changed from assigned to new

Changed 3 years ago by EricShulman

adds more/less toggle and separator syntax to toolbar handler

  Changed 3 years ago by EricShulman

as per discussion with Martin, I've attached a proper patch file for this change (more/less toggle) as well as ticket #609 (separator syntax)

  Changed 3 years ago by MartinBudden

  • status changed from new to closed
  • resolution set to fixed

Fixed in changeset:9528

Note: See TracTickets for help on using tickets.