Problem/Motivation

In our work to improve and address the feedback received for the submenus interactions we need to replace the flyout with a "drawer".

Note: This designs show also part of the explorations happening around the admin UI layout redesign and are not part neither from this issue nor the Navigation module.

Proposed resolution

With the goal to divide the work in several issues to work in parallel, this issue is aimed to implement the main drawer behavior, leaving for follow-ups style refinements and the accordion behavior inside the drawer.
We need to ensure the drawer works well across all viewports.
This following gifs taken from a Figma prototype show a high-level idea of the interaction expected (technical requirements can make some of these animations and interactions vary slightly):

Somenteraction notes:

  • The drawer opens when a 1st level items that has children is hovered.
  • The drawer should close with either moving outside it, with a cross at the top (can be moved into a follow-up) or when hovering another 1st level item with children.
  • Since the content of the drawer starts at the top, and the item that opens it could be at the bottom of the page, the code should account for the milliseconds the user might be moving the mouse outside the drawer to get to the top.
  • The drawer should be scrollable if it can't fit all the content. It can be moved into a follow-up

Remaining tasks

Implement the drawer.

User interface changes

The submenus interaction will change radically from flyouts to a drawer pattern.

Issue fork navigation-3427659

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

KeyboardCowboy created an issue. See original summary.

starshaped’s picture

Assigned: Unassigned » starshaped
bronzehedwick’s picture

Assigned: starshaped » bronzehedwick

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

ckrina’s picture

Title: Implement Content Funcationality » Implement drawer functionality
Issue summary: View changes
StatusFileSize
new498.09 KB
new547.97 KB
new104.25 KB

Adding more definition and screenshots on the IS to define and limit the scope.

ckrina’s picture

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

bronzehedwick’s picture

Okay, I pushed fixes for the above. Now:

  1. The mobile styles should work again
  2. The expanding nav should be in sync with the submenu animation
  3. The animations should be more performant
  4. The animation timing is abstracted to a variable
  5. Animations are disabled if user prefers-reduced-motion
  6. Lint errors are fixed

These aspects are ready for review.

TODO

There's an outstanding issue with z-index levels for the submenu drawer animation. The submenus should slide out from behind the navigation, and this works, except for the footer element, which is a sibling of the content nav. This causes the footer submenus to animate over the navigation.

Would it be okay to move the footer nav inside the content nav, and achieve the same visual effect via CSS? I'm not sure if there are accessibility implications here. Screenshot of potential markup below.

Only local images are allowed.

bronzehedwick’s picture

I pushed a fix for the footer submenu z-index issue, above, without any markup changes, and should now be fixed.

While fixing that issue, I noticed the mobile submenus don't have the correct size across screen sizes, so I'm looking into that now.

bronzehedwick’s picture

I've pushed a fix for the mobile submenu size issue, above. All known issues have fixes applied. This issue is now ready for review.

bronzehedwick’s picture

Assigned: bronzehedwick » Unassigned
Status: Active » Needs review
finnsky’s picture

Status: Needs review » Needs work

I see few issues on mobile and desktop js behaviour. i would like to have them fixed aswell.

ckrina’s picture

Issue summary: View changes
StatusFileSize
new379.07 KB

This is looking great! Almost there :D

I'm still seeing the error where, after opening one of the main parent items, it doesn't close when I hover another item:

rkoller’s picture

one detail i've noticed, if you open up a submenu you then have the label of the top level menu item as the "heading" now. That heading is clickable by the mouse but it has an invisible focus outline when you tab through the menu by keyboard (ref wcag sc 2.4.7 - focus visible).

bronzehedwick’s picture

Status: Needs work » Needs review

Confirming receipt. Working on the issues outlined.

bronzehedwick’s picture

@ckrina Woops, I forgot to fix dismissing the submenu on hover out. Pushed a fix for that!

ckrina’s picture

Assigned: Unassigned » finnsky
Status: Needs review » Needs work

Moving it back to Needs work because @finnsky is working on JS fixes.

finnsky’s picture

Status: Needs work » Needs review
finnsky’s picture

Assigned: finnsky » Unassigned
ckrina’s picture

Issue summary: View changes
Status: Needs review » Needs work
StatusFileSize
new636.34 KB

As mentioned yesterday in Slack, I'm still seeing weird behaviors and I think it's related to the fact that the open/close is reacting to hovering something else, when the event to trigger that change should be related to the element itself you’re interacting with. For example, if I leave the user menu to click on the collapse button, that should close its child drawer. But doesn't:

Moving to Needs Work to draw attention to this, because if an event as key like this needs to be changed it's better to do it in this issue.

finnsky’s picture

Status: Needs work » Needs review

This one is ready to go.

ckrina’s picture

Status: Needs review » Fixed

And merged! Thanks everybody involved, specially @bronzehedwick and @finnsky for the great work and collaboration with this time-sensitive key feature!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.