Add dropdowns to horizontal toolbar menu (as with 'admin toolbar' in contrib)

Created on 14 December 2015, over 8 years ago
Updated 24 February 2024, 3 months ago

Problem/Motivation

Admin Toolbar → provides the same type of dropdown and flyout functionality that Admin Menu provided in Drupal 7.

It was always the intention of the Spark team to provide dropdown functionality when the bar is in horizontal mode, but this was never implemented since the the user is able to access the subtree through the vertical menu.

Adoption of Admin Menu shows that users like the immediacy of dropdowns and since they don't conflict with the vertical orientation there's really no reason not to include them.

Admin Menu module does have a Drupal 8 branch but that branch does not (AFAICT) extend the existing core toolbar. Admin Toolbar module does extend the core toolbar and therefore seems to be a good candidate for inclusion in Drupal 8.1. Admin Toolbar appears to have a stable Drupal 8 release (I have it running on several sites and have encountered no bugs yet). I have not tested it for a11y or i18n but I don't *think* a11y is a problem since the entire subtree is already exposed to screen readers via Drupal Announce. Someone should test it with an RTL language.

In addition to improving general usability, dropdown menus (regardless of which module implements them) will also help the problems of navigation and discoverability seen in UMN testing:

"This is a jambled-up hardware store with no wayfinding. I have to go through every aisle looking for electrical outlets."

Proposed resolution

Add the drop-down menu functionality of Admin Toolbar to the core Toolbar. So existing admin menu items at various depth levels can be accessed directly through the toolbar

This issue should not add additional menu items that don't exist . For example, items like Content > Add Content > etc. and Content > Add Content > etc, or cache rebuild links that are added admin_toolbar_tools submodule of Admin Toolbar are helpful, but if they don't exist on your site, this issue should not aim to create them. There are benefits to having such links but it does not have to be in the scope of this issue.

Remaining tasks

  1. (works now)
  2. Fix existing tests → :
  3. Add new JS tests:
    • Pointer hover
    • Keyboard tabbing
  4. Reviews / improvements
  5. Accessibility review
  6. UX review
  7. Frontend framework manager review
  8. RTBC
  9. Commit

User interface changes

TBD.

API changes

None.

Data model changes

None.

Release notes snippet

TBD.

✨ Feature request
Status

Needs work

Version

11.0 🔥

Component
Toolbar  →

Last updated 1 minute ago

  • Maintained by
  • 🇫🇷France @nod_
Created by

🇺🇸United States tkoleary

Live updates comments and jobs are added and updated live.
  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

  • Accessibility

    It affects the ability of people with disabilities or special needs (such as blindness or color-blindness) to use Drupal.

  • Needs accessibility review

    Used to alert the accessibility topic maintainer(s) that an issue significantly affects (or has the potential to affect) the accessibility of Drupal, and their signoff is needed (see the governance policy draft for more information). Useful links: Drupal's accessibility standards, the Drupal Core accessibility gate.

  • Needs frontend framework manager review

    Used to alert the fron-tend framework manager core committer(s) that a front-end focused issue significantly impacts (or has the potential to impact) multiple subsystems or represents a significant change or addition in architecture or public APIs, and their signoff is needed (see the governance policy for more information). If an issue significantly impacts only one subsystem, use Needs subsystem maintainer review instead, and make sure the issue component is set to the correct subsystem.

  • Field UX

    Usability improvements related to the Field UI

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇭🇺Hungary Gábor Hojtsy Hungary

    @bnjmnm pinged me for product management feedback. Given that https://www.drupal.org/project/admin_toolbar → is the 4th most installed module, I think it would make sense to add it to core. Its a universal improvement. There was lots of resistence to add it to Drupal 7 when the current toolbar was added I think because the popup menus would have caused confusing with the overlay also popping up. With the overlay gone, I don't think that argument stands anymore.

    That said, it would be great to somehow figure out which parts of the contrib module are 80%, as in including them in core would essentially serve as a replacement and remove the use case to install the separate contrib module for most sites. That would be a genuine improvement. If we are only adding part of the module but most sites would still install the contrib module then IMHO we would not move the needle too much.

    Finally there are some high profile contrib projects that would be good to coordinate with, such as Gin Toolbar, so that they are not caught by surprise and/or improvements they need may be taken into account as well.

  • First commit to issue fork.
  • @bnjmnm opened merge request.
  • 🇺🇸United States bnjmnm Ann Arbor, MI

    Added the admin_toolcore branch that works with admin themes, and makes the menu depths configurable.

    Also, like you observed and @NancyDru as early as November 2018 (#48) most of the deeper links are missing, such as display modes, but also Content Types > Article (missing) > Manage fields (missing) and Content > Add Content (missing) > Article (missing).

    These links don't exist in the Adminstration Menu by default, thus they are not available in the updated toolbar here. There is a submodule of Admin Toolbar admin_toolbar_tools that generate these links, but I don't think replicating that should be in this issue's scope. This issue is introducing many beneficial UI changes already. Attempting to create NEW menu items within this issue's scope introduces it's own complexity and concerns . Those additional links can be added in a followup.

    Still needs test coverage as mentioned in #65. It may be possible to port some of the tests from Admin Toolbar.

  • 🇺🇸United States bnjmnm Ann Arbor, MI
  • last update about 1 year ago
    29,370 pass
  • last update about 1 year ago
    29,373 pass
  • Status changed to Needs review about 1 year ago
  • 🇺🇸United States bnjmnm Ann Arbor, MI
  • 🇫🇮Finland lauriii Finland

    Tested this manually. I think we need to make some minor design improvements to how we indicate links with subitems, as well as focus styles. On top of that, we probably should try to address #6 because right now navigating the toolbar using keyboard is certainly more tedious than it used to be.

  • last update about 1 year ago
    29,383 pass
  • last update about 1 year ago
    29,385 pass
  • 🇫🇮Finland lauriii Finland

    Made some minor changes to the styles in collaboration with @ckrina.

  • last update about 1 year ago
    29,386 pass
  • Status changed to Needs work about 1 year ago
  • 🇫🇮Finland lauriii Finland

    I don’t this we need to provide an option in core to limit the menu depths. This could be part of the contrib module functionality. There are benefits to keeping the experience consistent across sites by limiting the configuration options people have on things that are not critical.

    The main reason I’m thinking we should remove it is that there are efforts to redesign the toolbar and I don’t know if this feature will make sense anymore after that. From that perspective, adding it will add more complexity.

    Also, this doesn’t change the configuration for the vertical toolbar, and it's not something we have provided as a configuration there. In future if this is deemed as something we need, we could add it separately as its own feature.

  • last update about 1 year ago
    29,400 pass
  • Status changed to Needs review about 1 year ago
  • 🇺🇸United States bnjmnm Ann Arbor, MI

    I agree with #107 - it was my personal preference anyway but I was trying to go with an approach that is more likely to land. Since a PM is making the suggestion I think this seems like a choice that won't obstruct things 🙂. The menu depth stuff has been removed from the MR

  • Status changed to Needs work about 1 year ago
  • 🇺🇸United States smustgrave

    Seems there are some issues in the MR possibly from a rebase?

    Maybe we could get a 11.x branch also?

  • Open on Drupal.org →
    Environment: PHP 8.2 & MySQL 8
    last update 12 months ago
    Not currently mergeable.
  • last update 12 months ago
    29,446 pass
  • last update 12 months ago
    29,446 pass
  • Note that accessible keyboard navigation is being added to the admin_toolbar module in this issue: https://www.drupal.org/project/admin_toolbar/issues/3286466 ✨ Tabbing order does not satisfy 508 accessibility requirements Needs review

    Maybe the same pattern can be used here

  • I'm testing 3821 (in Firefox) and had a few issues:

    1. If I set the menu to vertical orientation, then back to horizontal, the arrow icons disappear and there is no more focus state

    2. I find it unintuitive that the vertical and horizontal modes use different keyboard navigation patterns. I also wasn't able to navigate the horizontal toolbar using my assistive software (Vimium browser addon which allows you to access any interactive element on the page using a 2-letter sequence) because the chevrons in the horizontal mode are not a separate element that open/closes the menus (the way they are in vertical mode).

    Though not every keyboard-only user uses Vimium, this kind of functionality is pretty common in assistive software (for example Voice Control, ShortCat and VimMotion provide this functionality for macOs). Having the collapse/expand button be its own element would make it easier in general for assistive software to interact with.

    For this reason I think the chevrons should be their own element and allow keyboard users to open/close the associated menu by pressing "Enter" or "Space" while under focus. This could be implemented in addition to the "arrow keys" functionality (and in general I think it's a good accessibility principle to provide multiple ways to do the same thing)

Production build 0.69.0 2024