Page MenuHomePhabricator

Evaluate navigational menu handle/trigger styling
Open, Needs TriagePublic

Assigned To
None
Authored By
alexhollender_WMF
Jun 24 2022, 2:35 PM
Referenced Files
F35272742: T311306 Native navigational menus.mp4
Jun 24 2022, 8:35 PM
F35272737: image.png
Jun 24 2022, 8:23 PM
F35271916: image.png
Jun 24 2022, 2:35 PM
F35271913: image.png
Jun 24 2022, 2:35 PM
F35271904: image.png
Jun 24 2022, 2:35 PM
F35271832: image.png
Jun 24 2022, 2:35 PM
F35271892: image.png
Jun 24 2022, 2:35 PM
F35271890: image.png
Jun 24 2022, 2:35 PM

Description

Description

See parent task for general information.

Navigational menus usually consist of two parts: 1) the menu handle/trigger (i.e. the thing you click on to open the menu), 2) the menu links/items (i.e. the things inside of the menu). This task is specifically about the styling of the menu handle/trigger.

image.png (1×898 px, 89 KB)

Native HTML references
The menu handle/trigger is a kind of button. Unfortunately there is no clear default styling for such an element in HTML (HTML provides a <select> menu, but no such navigational menu). Two HTML elements that function similarly to menu handle/triggers are:

  • the summary element which is part of the details tag. This is an element that you click on in order to reveal additional information, much like a menu handle/trigger.
  • input element, such as a checkbox or radio. These are clickable elements that function more as toggles rather than typical buttons.

By default the summary element looks like this:

Screen Shot 2022-06-24 at 9.48.54 AM.png (36×89 px, 2 KB)

Presumably the arrow next to the text indicates both that the element is clickable, and that when clicked it will reveal additional information.

Menu handles/triggers in Wikimedia interfaces
Currently there are a few different types of handles/triggers for our navigational menus:

dropdownsicon buttonquiet buttonnormal button (?)input
image.png (400×1 px, 45 KB)
image.png (640×400 px, 24 KB)
image.png (848×766 px, 44 KB)
can't find a navigational menu w/ a normal button, but here is a select menu with one
image.png (250×670 px, 11 KB)
image.png (1×912 px, 124 KB)

Challenge

I think what's currently implemented in production works well when menu handles/triggers are icon buttons, normal buttons, or inputs. I think the challenge comes when menu handles/triggers are quiet buttons (which I think will be the most common case, in addition to icon buttons). Why is this a challenge? Because quiet buttons are styled very similarly to links, and in the case where there is a quiet button as a menu handle/trigger located next to other links, there is visual disharmony between the two very similar, yet slightly differently styled, elements. For example:

image.png (478×2 px, 128 KB)

For comparison:

image.png (452×1 px, 100 KB)
image.png (452×1 px, 260 KB)

Proposal

  • If the handle/trigger is a quiet button, the label should always include a icon to indicate that it is clickable, and is a menu handle/trigger.
  • If the handle/trigger is a quiet button the label should be styled as font-weight: normal so that it is visually harmonious with surrounding link elements.
    • In order to achieve this in a systematic way we could either a) decide that all quiet buttons have font-weight: normal styling (which I think is a good choice, though recognize it's a bigger decision), or b) create a new component, or a variant of the quiet button component, for menu handle/triggers

Event Timeline

For completion, there have been solutions to semantically enable navigational menus in the past with only HTML and CSS and/or server response without JS:

  • Using nested <ul><li><a href="…">…</a><ul><li><a href="…"> solutions where the dropdowns are shown on CSS display and :hover/:focus for CSS only approximation of such elements. (repeated from Slack thread)
  • select could be used for navigation purposes as well when bound to a form element and server response. In OOUI we provide DropdownInputWidget for such and other cases

@Volker_E can you clarify your thoughts around adding this to the list of examples? as far as I understand it is a select menu, whereas this task is about navigational menus

dropdowns
image.png (400×1 px, 45 KB)

As I've explained in my last comment in T311270 I don't agree with using link (blue text with underlined when hover) for items that are not text links within text/paragraph. I think this behavior should be reserved for links within block texts (e.g. links within the article) instead of using it for clickable items.

I think for this menu trigger we should use the quiet dropdown button we already have in our system instead of adding an arrow in all links.

As I've explained in my last comment in T311270 I don't agree with using link (blue text with underlined when hover) for items that are not text links within text/paragraph. I think this behavior should be reserved for links within block texts (e.g. links within the article) instead of using it for clickable items.

I think for this menu trigger we should use the quiet dropdown button we already have in our system instead of adding an arrow in all links.

This proposal does not specify the color of the menu handle/trigger, it just specifies the use of a icon, and non-bold font.

Even though being seen next to the tabs make this look as a little disharmonious, ultimately IMO it makes sense to make this element bold in keeping with standard button style, as this is an action to trigger an overlay menu, which is somewhat different from details/summary, where summary is part of the details element.

I agree that the menu handle/triggers are buttons (specifically "navigational menu buttons").
"Dropdown" or <select> elements are usually used to select options, and usually shouldn't contain links or other interactive content. The <summary> element is typically used in cases like FAQs, or with hidden text. The <input> element in the typeahead search is most similar to a combobox with autocomplete, which also distinct from everything else.

Something to note, I think it can be confusing to compare styling based on native HTML elements, because the HTML used is often an implementation detail. What actually matters is how we define a particular UI element, i.e. it can be clarifying to refer to the ARIA web pattern when talking about UI elements. For example, we use the checkbox hack to implement Vector's "navigation menus", meaning the <input> is styled and coded to be a "menu button". Alternatively you could use <summary>/<details> to implement a "navigation menu", but it should still be consistent so the <summary> should look and behave a button. On a similar note, ARIA definitions help differentiate components that look similar. The native <select> element and combobox pattern look nearly identical, but they have different requirements that impact the nuances of the design, and shouldn't be compared 1 to 1.