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. Make it work with administration themes (works now)
  2. Fix existing tests:
    • Drupal\Tests\shortcut\Functional\ShortcutLinksTest::testShortcutQuickLink
    • Drupal\KernelTests\Core\Theme\Stable9LibraryOverrideTest::testStable9LibraryOverrides - Shouldn't touch Stable9 at all for this.
    • Drupal\KernelTests\Core\Theme\StableLibraryOverrideTest::testStableLibraryOverrides- Shouldn't touch Stable at all for this.
  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.

Issue fork drupal-2634854

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

tkoleary created an issue. See original summary.

tkoleary’s picture

Issue summary: View changes
wim leers’s picture

Version: 8.0.1 » 8.1.x-dev
Priority: Normal » Major
swentel’s picture

Oh yes please, a million plus for this one.

The module also contains a submodule for admin tasks (like flush caches etc), should we help out the maintainer and move those to devel then for instance ?

swentel’s picture

andrewmacpherson’s picture

Issue tags: +Accessibility

The issue summary mentions a11y but only goes as far as mentioning the screen reader experience.

We should also pay attention to the keyboard-only experience. The top-level tray links (content, structure, etc.) should remain easy to reach, i.e. without having to tab through all of the sub-menu items.

jacine’s picture

This would be a nice addition to core.

wim leers’s picture

Would we still want to do this if we'd already do #1781422: Add search/jump/command functionality to toolbar? @jacine, what do you think?

jacine’s picture

Personally, I think #1781422: Add search/jump/command functionality to toolbar belongs in contrib.

I've not actually used it yet (this is the first I've heard about it), but I watched the screencast, and my impression of it is that it's cool, but to get the most use out of it, you have to have some sort of orientation with Drupal, to know what you're looking for. It's a power user tool all the way; therefore, not something needed in core itself IMO.

What I like about admin_toolbar is the ability to add/customize the menu items, and the fact that it actually makes Toolbar useful by reducing clicks to perform tasks and helps to give an idea of where everything is.

wim leers’s picture

If you use the toolbar menu try vertically, you'd also get that sense of where everything is.

So, for that aspect, always showing the toolbar's menu vertically, and never the extremely limited horizontal one. Then it's the same on narrow screens and wide screens.

(Just to be clear, I'm just playing devil's advocate, I like admin_toolbar personally.)

jacine’s picture

I hear you, but I'd still prefer admin_toolbar personally. Using the vertical menu is something I will not do, unless mobile, which is almost never. You've got to click to expand the items, which is annoying. And Coffee doesn't solve the issue of adding/customizing items, which is the main draw of this issue for me.

Also, I consider these 2 issues unrelated. I get how some people might find the Coffee functionality useful, but at the same time, I wonder how/why it's even being considered for core inclusion. I think back to D7 days, when the top level menu items (structure, appearance, etc) were undergoing a re-org, and one of the UX problems that kept being brought up is how bad our terminology is, how hard it is for users to find stuff, and that WE as Drupal developers, basically use the browser address bar like a command line to get around those issues, etc. Coffee module just seems to mask those issues and encourage that command-line style navigation approach as a solution, which I find odd.

wim leers’s picture

Great feedback :) It's good to have that spelled out explicitly.

I wonder how/why it's even being considered for core inclusion

Because it allows power users to navigate even more quickly. And we can add aliases, to allow people to use slightly different terminology and still get useful suggestions.

Your other criticism of course still stands.


So, given all that, I'd say… let's get a core patch going? It should be mostly copy/pasting from the D8 contrib module? I sent a tweet to the module maintainers, only one of them is on Twitter: https://twitter.com/wimleers/status/700413389764476931.

gábor hojtsy’s picture

@Jacine: I think the fate of the toolbar search feature would be great discussed in #1781422: Add search/jump/command functionality to toolbar so people find the feedback there :) Thanks a lot!

eme’s picture

Hello,

I'm the co-maintainer of Admin Toolbar. To answer to Wim Leers, a patch shouldn't be too complicated indeed but it won't be a copy paste as we had to overcome the limitation of the core toolbar module that do not load the sub-element in horizontal state. Thus it should be a little patch against toolbarVisualView.js and a bunch of CSS (on that part, we should fix before #2635832: Fix all RTL issues).

I'm talking about including the admin_toolbar and not its sub-module as it seems to me that indeed having too many links at the very beginning could be confusing an not easily accessible and could stay a contrib module.

I'll go in holiday next week but will take some time to make a first patch to demonstrate after.

wim leers’s picture

@eme Awesome, thank you!

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

ressa’s picture

I second all what @Jacine said - I think Coffee is more oriented towards power users, who know what to search for. Also, Admin Toolbar serves as an educational tool for new users, in that it allows them to explore Drupal, without having to click and wait, and click and wait.

wim leers’s picture

I think everybody is +1. We just need somebody to start pushing this forward :)

ressa’s picture

Great, I just thought I'd share my 2 cents, to keep the ball rolling on getting Admin Toolbar into core :-)

tkoleary’s picture

I know you are all champing at the bit to work in backbone but don't everyone jump at once. :)

mrf’s picture

Here is a rough working patch that illustrates what admin toolbar is actually doing, almost all CSS.

There is definitely a need for some refactoring, and some additional work and testing to make sure we have accessible keyboard navigation, but I wanted to make sure we weren't scaring anyone off with unhelpful comments about backbone.

andrewmacpherson’s picture

Tagging so I can find this again.

To clarify, are we talking about having dropdown-menus and keeping the expandable-deep levels inside the vertical tray orientation?

skaught’s picture

Status: Needs work » Needs review

#21 is a great start. it does bring up to the forth menu level for hoving. I just noticed the todo about making a config.

generally:

  • children however they are all then inline.
  • missing additional coloring (or icon) to indicate next level
  • **rtl languages are broken visually.

Otherwise missing core module.manu.yml links that Admin toolbar adds in need to be completed for some things

I'ld say that as far as Admin Toolbar goes unless anyone wants to include functionality for dev's like 'clear cache' links and the like.

Certainly any #a11y concerns need a clearer review and help

--
switching status to run tests.

Status: Needs review » Needs work

The last submitted patch, 21: toolbar-dropdown-support-2634854-21-8.2.x.patch, failed testing.

Benia’s picture

I think it should be in core.

The last submitted patch, 21: toolbar-dropdown-support-2634854-21-8.2.x.patch, failed testing.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

pfrenssen’s picture

I just tried it and the dropdowns are not keyboard accessible. What's good though is that it at least doesn't break the current functionality, the menu is still visible and accessible in the standard way.

I think this is probably a good thing. There is no loss of functionality for keyboard only users, and there is added functionality for mouse users. I've never come across a dropdown menu implementation that worked 100% flawless for keyboard users.

Note that if it is not keyboard accessible this also means it is not accessible for touch users. It only works with pointing devices that support hover states.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

ressa’s picture

I just tried the patch from #21 against Drupal 8.2.8-dev and it's a big step in the right direction. It would be great to offer the 'Flush all caches', 'Run cron', and 'Run updates' links, if possible?

wim leers’s picture

#30: you don't need Flush all caches anymore in D8, or you should need it very rarely.

Anyway, overall +1 for this. I already said that more than a year ago, in #18.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

ressa’s picture

Thank you for creating the patch in #21 @mrf, here is a re-roll for 8.6.x.

Like @mrf notes, there is need of refactoring, for example the chevron-right.svg (the little blue arrow) is not showing in some situations, and also the sub-items have a little overlap.

Try the patch with the new single command to install Drupal:

  1. curl -sS https://ftp.drupal.org/files/projects/drupal-8.6.x-dev.zip --output drupal-8.6.x-dev.zip
  2. unzip drupal-8.6.x-dev.zip && rm drupal-8.6.x-dev.zip
  3. cd drupal-8.6.x-dev
  4. wget -q -O - https://www.drupal.org/files/issues/2018-05-09/toolbar-dropdown-support-2634854-34-8.6.x.patch | git apply -
  5. php core/scripts/drupal quick-start demo_umami

#2911319: Provide a single command to install & run Drupal

ressa’s picture

Issue summary: View changes

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

oriol_e9g’s picture

Status: Needs work » Needs review
Issue tags: +Needs tests
StatusFileSize
new4.07 KB

Rolled a new patch.

Status: Needs review » Needs work

The last submitted patch, 37: 2634854-37.patch, failed testing. View results

ressa’s picture

Status: Needs work » Needs review
StatusFileSize
new4.45 KB

The previous patch didn't seem to apply cleanly, and was also missing toolbar.libraries.yml file, so rolled a new patch.

Status: Needs review » Needs work

The last submitted patch, 39: toolbar-dropdown-support-2634854-39-8.7.x.patch, failed testing. View results

oriol_e9g’s picture

@ressa the patch rolled in #37 applies cleanly and I have not missing any change (see testbot), maybe you're patching an old drupal version.

ressa’s picture

Sorry @oriol_e9g, you're right. I just tried again, and your patch in#37 applies just fine. But it does not contain the toolbar.libraries.yml file, so the dropdown isn't activated.

On another note, I wonder why the testbot fails both our patches, even thought they both seem to apply fine ... The original patch in #21 passes with flying colours.

visabhishek’s picture

Status: Needs work » Needs review
StatusFileSize
new4.45 KB
new4.44 KB

Just Rerolled the Patch #41, Because it's showing "Patch Failed to apply".

The last submitted patch, 43: toolbar-dropdown-support-2634854-43-8.7.x.patch, failed testing. View results

Status: Needs review » Needs work

The last submitted patch, 43: toolbar-dropdown-support-2634854-43-8.6.x.patch, failed testing. View results

oriol_e9g’s picture

@visabhishek now we need to finish the work and update the tests.

ressa’s picture

Thanks for rerolling the patches @visabhishek, they seem to pass now. The only difference I see is this, which might be the cause?

Your patch:

 core: 8.x
 package: Core
 version: VERSION

My patch

 # core: 8.x
 package: Core
 # version: VERSION

EDIT: @oriol_e9g was right, I was using at the wrong version. The version of Drupal core at https://ftp.drupal.org/files/projects/drupal-8.7.x-dev.zip is not identical to the git-version, which is why the toolbar.libraries.yml files were different. Downloading core with git in stead like this seems to give me the correct version for Drupal core development:

git clone http://git.drupal.org/project/drupal.git drupal-8.7.x-dev
cd drupal-8.7.x-dev/
git checkout 8.7.x

Sorry for all the noise in this issue.

nancydru’s picture

I applied this to 8.6.2 and it is a vast improvement but it is still not as good as Admin Menu in 7.x. For example, I cannot go directly to a content type in the drop down.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

ivnish’s picture

+1. Core toolbar is inconvenient

voleger’s picture

StatusFileSize
new4.57 KB

Just reroll

dww’s picture

+++ b/core/modules/toolbar/toolbar.info.yml
@@ -1,6 +1,6 @@
-description: 'Provides a toolbar that shows the top-level administration menu items and links from other modules.'
+description: 'Provides a toolbar menu that shows administration menu items and links from other modules.'

I don't understand why we're changing this description. Toolbar module is still providing a toolbar, not just a menu. ;) Please revert this from the next patch.

p.s. I'm on a mission to make toolbar *not* admin-specific. Regular users can make nice use of toolbar to get access to the user tray and shortcuts (once you patch a few core issues). So, I'd definitely like to *not* further enshrine "admin" anywhere in this module.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

nod_’s picture

Latest patch duplicate the links in the menu and hover doesn't seem to work for me?

vsujeetkumar’s picture

Assigned: Unassigned » vsujeetkumar
ressa’s picture

I just applied the patch on Drupal 9 released today, which went fine, except for the toolbar.info.yml bit. Like @NancyDru commented, certain second level items, like content types and Content > Add Article are missing from the drop down. I don't see any duplicate links though, and hover also seems to work ...

vsujeetkumar’s picture

Assigned: vsujeetkumar » Unassigned
vsujeetkumar’s picture

Assigned: Unassigned » vsujeetkumar
Status: Needs work » Needs review
StatusFileSize
new4.55 KB

Re-roll patch created for 9.1.x.

sivaji_ganesh_jojodae’s picture

Status: Needs review » Needs work

Per #52 this still needs work. Info file description need not be changed. Provide interdiff to see what has been changed since previous patch.

dww’s picture

Also still definitely needs FunctionalJavascript test coverage before this should be in "Needs review". That's what the "Needs tests" tag is about.

Thanks,
-Derek

codersukanta’s picture

StatusFileSize
new525 bytes
new4.03 KB
new91.99 KB

Successfully applied the patch #59. Did manual testing and its working fine.

And reverted the description changes in

toolbar.info.yml

as recommended by #52.

Screenshot with patch:
With Patch

codersukanta’s picture

I am really sorry @vsujeetkumar, I did not notice that the issue is still assigned to you.

dww’s picture

Assigned: vsujeetkumar » Unassigned

That's okay, there's no need for this to be assigned. Anyone is welcome to work on a JS test, which is what most needs to happen next.

Thanks,
-Derek

dww’s picture

Issue summary: View changes

Giving the summary a proper template, and accurate remaining tasks list.

Anyone's welcome to fix the current test failures. Please only upload a new patch if you've run these tests locally and confirmed they pass:

  • Drupal\Tests\shortcut\Functional\ShortcutLinksTest::testShortcutQuickLink
  • Drupal\KernelTests\Core\Theme\Stable9LibraryOverrideTest::testStable9LibraryOverrides
  • Drupal\KernelTests\Core\Theme\StableLibraryOverrideTest::testStableLibraryOverrides

Noting that the JS tests should include both:

  • Pointer hover
  • Keyboard tabbing

Thanks!
-Derek

vsujeetkumar’s picture

Status: Needs work » Needs review
StatusFileSize
new11.7 KB
new7.12 KB

@dww In this patch I have fixed fail tests, now only JS tests pending, Please review.

dww’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs frontend framework manager review

Thanks, @vsujeetkumar!

  1. +++ b/core/modules/shortcut/tests/src/Functional/ShortcutLinksTest.php
    @@ -163,10 +163,12 @@ public function testShortcutQuickLink() {
    -    $this->assertNoLink('Cron', 'Shortcut link removed from page');
    +    $links = $this->xpath('//a[normalize-space()=:label]', [':label' => 'Cron']);
    

    Not understanding why assertNoLink() isn't working for this assertion. The alternative seems more complex and brittle. Maybe add a code comment why assertNoLink() isn't enough?

  2. +++ b/core/modules/shortcut/tests/src/Functional/ShortcutLinksTest.php
    @@ -163,10 +163,12 @@ public function testShortcutQuickLink() {
    +    $this->assertTrue(empty($link), 'Shortcut link removed from page');
    

    A) This should be assertEmpty().

    B) We should move the custom 'Shortcut link removed from page' message to an inline comment, not an assertion message:

    // Ensure the shortcut link is removed from the current page.

  3. +++ b/core/modules/shortcut/tests/src/Functional/ShortcutLinksTest.php
    @@ -163,10 +163,12 @@ public function testShortcutQuickLink() {
    -    $this->assertNoLink('Cron', 'Shortcut link removed from different page');
    +    $links = $this->xpath('//a[normalize-space()=:label]', [':label' => 'Cron']);
    +    $this->assertTrue(empty($link), 'Shortcut link removed from different page');
    

    Same here for all of the above.

  4. +++ b/core/modules/toolbar/src/Controller/ToolbarController.php
    @@ -71,7 +71,7 @@ public static function preRenderAdministrationTray(array $element) {
    -    $parameters->setMinDepth(2)->setMaxDepth(2)->onlyEnabledLinks();
    +    $parameters->setRoot('system.admin')->excludeRoot()->setMaxDepth(4)->onlyEnabledLinks();
    

    I don't understand why we setRoot() and excludeRoot() here. What's wrong with the existing setMinDepth(2)?

    This change could definitely use some comments.

  5. +++ b/core/modules/toolbar/toolbar.libraries.yml
    @@ -34,7 +34,7 @@ toolbar.menu:
    -    state:
    +    component:
    

    Not clear why this change is happening in this patch. Seems out of scope, but I probably misunderstand.

  6. +++ b/core/modules/toolbar/toolbar.libraries.yml
    --- a/core/themes/stable/css/toolbar/toolbar.menu.css
    +++ b/core/themes/stable/css/toolbar/toolbar.menu.css
    
    +++ b/core/themes/stable/css/toolbar/toolbar.menu.css
    --- a/core/themes/stable/stable.info.yml
    +++ b/core/themes/stable/stable.info.yml
    
    +++ b/core/themes/stable/stable.info.yml
    --- a/core/themes/stable9/css/toolbar/toolbar.menu.css
    +++ b/core/themes/stable9/css/toolbar/toolbar.menu.css
    
    +++ b/core/themes/stable9/css/toolbar/toolbar.menu.css
    --- a/core/themes/stable9/stable9.info.yml
    +++ b/core/themes/stable9/stable9.info.yml
    

    We shouldn't be changing stable nor stable9 for this issue.

    We need to change the default toolbar module CSS file (which we already do) and then check all the core themes. Any core theme that's overriding this file needs the new styles added to their override. Core themes that don't touch it should be inheriting directly from the module CSS now, not stable or classy.

    Sorry I didn't spell this out in #65. The reason those testStableLibraryOverrides tests were failing was because we were changing libraries we shouldn't. The solution isn't to change from a 'state' to a 'component'. It's to not touch stable or stable9 at all.

  7. +++ b/core/themes/stable/css/toolbar/toolbar.menu.css
    @@ -116,3 +116,85 @@
    +  background-image: url('/core/misc/icons/0074bd/chevron-right.svg');
    

    A) This needs to use a relative URL or it'll break on sites installed in a subdirectory.

    B) There's probably other stuff in the CSS that could be improved, so tagging for frontend framework manager review.

vsujeetkumar’s picture

Assigned: Unassigned » vsujeetkumar
vsujeetkumar’s picture

Assigned: vsujeetkumar » Unassigned
Status: Needs work » Needs review
StatusFileSize
new4.62 KB
new8.32 KB

@dww I have fixed the changes mentioned in #67, Please review

#1,#2 & #3:
Because of permission not able to see 'Cron' shortcuts link with the "assertNotLink", So I have added permission now we can use "assertNotLink".
+
+ $this->drupalLogin($this->drupalCreateUser([
+ 'access toolbar', 'access shortcuts', 'administer site configuration',
+ ]));

#4: For display the child menu I have just incrase setMaxDepth(2) to setMaxDepth(4).
- $parameters->setMinDepth(2)->setMaxDepth(2)->onlyEnabledLinks();
+ $parameters->setMinDepth(2)->setMaxDepth(4)->onlyEnabledLinks();

#5: I have revert back to 'state' in toolbar.libraries.yml.
#6: Revert back all the changes in stable and stable9.

hardik_patel_12’s picture

StatusFileSize
new4.67 KB

Patch is failed to apply on 9.1.x , re-rolling the patch.

lauriii’s picture

Would be great if we could get a sign-off on this feature from product managers before we start going deeper into the implementation.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

vikashsoni’s picture

Patch is failed to apply on 9.3.x-dev , needs to re roll patch

colan’s picture

Status: Needs review » Needs work

Updated status based on previous comment.

matroskeen’s picture

I think this issue can be a good candidate to be moving forward with "Easy out of the box" initiative. I think it's not only can be added to Drupal core but also enabled by default for Umami and Standard installation profiles.

Will try to reach out to the initiative leads and see if they're interested 👌

avpaderno’s picture

Issue tags: +Needs reroll
yogeshmpawar’s picture

Assigned: Unassigned » yogeshmpawar

Working on re-roll.

yogeshmpawar’s picture

Assigned: yogeshmpawar » Unassigned
Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new4.69 KB

Straight re-roll against 9.3.x branch.

avpaderno’s picture

Status: Needs review » Needs work
yogeshmpawar’s picture

Assigned: Unassigned » yogeshmpawar

Working on custom command failures.

yogeshmpawar’s picture

Assigned: yogeshmpawar » Unassigned
Status: Needs work » Needs review
StatusFileSize
new4.67 KB
new2.96 KB
new149.08 KB

Resolved custom commands failures & added an updated patch with an interdiff.

ressa’s picture

StatusFileSize
new4.69 KB
new506 bytes
new30.02 KB
new29.91 KB

Thanks for fixing that @yogeshmpawar.

I noticed that the border of the original first level menu items seemed bigger, so here's a patch which only adds border to sub-menu items.

Main menu borders too wide
2px border

Normal borders
1px border

Tip: Use Drupal Quick Start Command for easy patch testing:

$ git clone --branch 9.3.x https://git.drupalcode.org/project/drupal.git && cd drupal && composer install
$ wget -q -O - https://www.drupal.org/files/issues/2021-11-03/2634854-83.patch | git apply -
$ php -d memory_limit=256M ./core/scripts/drupal quick-start demo_umami

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

rkoller’s picture

Status: Needs review » Needs work

I wanted to test the latest patch in #83. The patch is labeled for 9.3.x but I've tried with the current Drupal 9.4.x-dev. Even though the patch still applied successfully there was no submenu showing like in #62. So basically no admin_toolbar functionality available. And there were also no errors in the devtools shown, when i've checked. I'll set the issue to needs work again. probably needs at least a reroll against 9.4.x.

ressa’s picture

Thanks for the feedback @rkoller, I have re-rolled the patch for 9.4. Tugboat fails (see #3275720: Tugboat fails, dead link) but when it works again, we should be able to preview it there.

Some second level items, like content types and Content > Add Article are still missing from the drop down.

q0rban made their first commit to this issue’s fork.

rkoller’s picture

StatusFileSize
new61.35 KB
new86.18 KB

thanks for the reroll @ressa ! i've applied and tested the merge request diff on a 9.4.x install on DDEV. the patch applied properly. the changes in /core/modules/toolbar/css/toolbar.menu.css and /core/modules/toolbar/src/Controller/ToolbarController.php are there. i've also cleared caches with drush several times and ensured that the admin_tool module, i usually use per default on test installs, is disabled and uninstalled.

already wanted to write that i am still unable to see any effect of the patch but then i've remembered and tried something. per default i always use Claro as admin theme when i test. There i am unable to see any of the admin_toolbar functionality this patch introduces on a code level. BUT when i switch to Seven it works!

The configuration menu item looks correct
the configuration menu item with its submenu items - working admin_toolbar like functionality
while for the structure menu item only the sub menu items for display modes are shown, for every other item they are missing.
the structure menu item with its submenu items but sub menu items only showing for display modes
not sure if that is the intended result compared to the menu structure admin_menu provides.

Edit: Forgot to mention tested on MacOS 10.13.6 with Safari 13.1.2 as well as the latest version of Firefox

catch’s picture

Title: Add "Admin Toolbar" module to core toolbar » Add dropdowns to horizontal toolbar menu (as with 'admin toolbar' in contrib)

Retitling to make it a bit clearer what's being proposed. This could use the screenshots embedding in the issue summary for easier review.

ressa’s picture

Issue summary: View changes

Thanks for checking the patch @rkoller. You're right that the patch doesn't work at all for Claro, which I also just discovered via the fixed Tugboat live preview, since #3277057: Make Claro the default admin theme in Standard profile landed and made Claro the default admin theme.

I have added a new "Make it work with administration themes" item in the "Remaining tasks" list with Claro, Seven, and Olivero which is also included under "Administration theme". Interestingly, the patch works for Olivero.

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).

In my mind, the goal should be to give the same user experience as Admin Toolbar, giving immediate access to all links at the deepest levels.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

mgifford’s picture

Issue tags: +wcag211

Referencing WCAG 2.1.1 SC.

gábor hojtsy’s picture

@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.

bnjmnm made their first commit to this issue’s fork.

bnjmnm’s picture

Issue summary: View changes

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.

bnjmnm’s picture

Issue tags: +Field UX
bnjmnm’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
lauriii’s picture

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.

bnjmnm’s picture

The most recent push makes the submenu item navigable via arrow keys instead of tabs, so it's not necessary tab through every darn item on a journey. The test for keyboard nav was removed and this is now better to test manually.

Claro focus styles also added.

lauriii’s picture

StatusFileSize
new66.21 KB

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

lauriii’s picture

Status: Needs review » Needs work

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.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

bnjmnm’s picture

Status: Needs work » Needs review

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

smustgrave’s picture

Status: Needs review » Needs work

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

Maybe we could get a 11.x branch also?

camilledavis’s picture

I made an MR to add keyboard navigation to the admin_toolbar here: https://www.drupal.org/project/admin_toolbar/issues/3286466

camilledavis’s picture

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. Using my assistive software (Vimium) I'm unable to navigate the toolbar because the chevrons in the horizontal mode are not a separate element that open/closes the menus (the way they are in vertical mode).

The functionality I'm relying on assigns a key sequence to all visible UI elements so it can be clicked/toggled directly using the keyboard, and is a common feature in assistive software (for example Voice Control, ShortCat and VimMotion provide this functionality for macOs). So having the collapse/expand button be its own element would make it easier in general for assistive software to interact with. 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)

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

quietone’s picture

Status: Needs work » Postponed

The Toolbar Module was approved for removal in #3476882: [Policy] Move Toolbar module to contrib.

This is Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.

The deprecation work is in #3484850: [meta] Tasks to deprecate Toolbar module and the removal work in #3488828: [meta] Tasks to remove Toolbar module.

Toolbar will be moved to a contributed project before Drupal 12.0.0 is released.

quietone’s picture

Project: Drupal core » Toolbar
Version: main » 1.x-dev
Component: toolbar.module » Code
Status: Postponed » Needs work

Toolbar has moved to contrib