Problem/Motivation

So while creating/editing the menu link, the Parent item select input of the Menu Settings opens up a very long list of the every single possible menu item in one giant select list which can be a little crazy.

Steps to reproduce

- Navigate to edit any menu link.
- Open the Parent link select list.

Proposed resolution

So the proposed solution that we came up with after having a discussion with @lauriii was to have 2 separate select list. The first select list will contain the List of main menus and based on the selection of the first select list the second select list would contain it’s subitems.

Remaining tasks

  1. Accessibility review
  2. Add-form-11x

  3. Update now that #2519362: Redesign the menu link add form to be less overwhelming is fixed. Make sure the two work well together. See Comment #37.
  4. Update the "before" and "after" screenshots in the issue summary now that #2519362: Redesign the menu link add form to be less overwhelming is fixed.

User interface changes

Current add-form:-
Add-form-11x

Current edit-form:-
Edit-form-11x

Proposed
Edit-form-collapsed:-
collapsed

Edit-form-expanded:-
expanded

Add-form-collapsed:-
addform

Add-form-expanded:-
addform

Menu-link-selection-expanded:-
menulink

Parent-link-selection-expanded:-
parent

API changes

Data model changes

Issue fork drupal-1428520

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ELC’s picture

Here's a screen shot showing the existing selection plus the proposed change .. as each box is selected, the children are ajax loaded

and a patch off the current git repository.

sun’s picture

Title: GOOG2012UX: Menu parent item selection - made less crazy » Improve menu parent link selection
Component: menu system » menu.module
Issue tags: -d8ux +Usability
jenlampton’s picture

updating tags
Wonder if there's any chance this can get into D7 too? :)

chris_h’s picture

This still requires an user to know what weight means and essentially guess what weight other items in the menu are in order to fit it in the correct place the first time around.

It would be better to take an approach along the lines of Menu Browser or Menu Order which get rid of weights entirely and allow users to choose a menu and drag & drop an item either as a child of a page, or above/below a sibling.

Also referencing #1101600: Users need to be able to select from list when adding menu items to a menu, which is the flipside to this problem from the list links page.

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

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should 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.

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

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should 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.

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

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should 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.

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

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should 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.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should 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.

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

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should 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.

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

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.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.

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

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should 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.

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

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

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

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

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should 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.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should 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.

smustgrave’s picture

This seems like it would still be useful.

seems to be about what https://www.drupal.org/project/cshs does.

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

Utkarsh_33’s picture

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

Utkarsh_33’s picture

Next things to work on this is to get some code clean-up and maybe add some tests for this.

Utkarsh_33’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs issue summary update

Issue summary hasn't been updated in 12 years, so definitely think it should be updated to todays template.

Applying the MR though not seeing any difference when adding a menu link.

Utkarsh_33’s picture

Issue summary: View changes
Utkarsh_33’s picture

FileSize
473.4 KB
541.66 KB

Attaching the screenshots demonstrating the new way of selecting the parent list.

Utkarsh_33’s picture

Status: Needs work » Needs review

smustgrave’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: -Needs issue summary update

Added screenshots from #28 to issue summary.

Moving to NW for threads from tim.plunkett, saving credit for.

Utkarsh_33’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Only rebased to see if the pipeline would pass. Had a bunch of errors before but think that was gitlab issue.

Believe this is good, as all threads have least been answered. And confirmed I get the same behavior as the screenshots

benjifisher’s picture

I am adding #3379293: Make it easier to add a child menu item as a related issue. It is a complementary solution to the same problem.

The tests that I added in that issue should catch any problems, but it would be reassuring to have someone test manually that the changes here do not affect the default selection we get when using the "add child" link.

benjifisher’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs review
Issue tags: +Needs accessibility review

I think this issue should also get an accessibility review, just to make sure it works well with keyboard navigation, scree readers, and such. I am adding the tag for that and setting the status back to NR.

Thanks for the attention to the issue summary. That will help in the review process.

smustgrave’s picture

Status: Needs review » Needs work

Tabbing is fine.

But reading https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Liv... think we may need aria-live for the section that is auto updating.

rkoller’s picture

FileSize
46.65 KB
181.59 KB
575.4 KB

While testing this issue I still had the changes for #2519362: Redesign the menu link add form to be less overwhelming applied. Turns out both issues are intertwined:

edit menu link page

Quickly chatted with @benjifisher in the #accessibility channel where he posted the other issue and we were in agreement that the menu select field should be moved over to the sidebar right above the parent link select field. He recommended to post this comment on both issues and whichever issue is fixed second should adapt for the other.

And two additional observations when the select fields are announced by a screenreader (VoiceOver in my case).

1. The greater and less than announcements are confusing (see less_greater_than.mp4) and since menu and parent link are no single select field anymore < and > are not necessary anymore to visually distinguish menus for sighted users

2. For screenreader users the list is flat and none hierarchical (see flat.mp4). The pause just slightly differs based on the number of dashes.

benjifisher’s picture

Issue summary: View changes
benjifisher’s picture

FileSize
26.5 KB

We should make the same change to the node-edit form. I am not sure whether it makes sense to do that as part of this issue or if it should be a follow-up.

screenshot showing the "Menu settings" section of the node-edit form

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

Utkarsh_33’s picture

FileSize
1015.74 KB

So now the menu select list does not contain the < and > icons as requested in #37.1Menu select list updated. Also #37.2 can be a follow-up for this issue.

Utkarsh_33’s picture

@benjifisher can
#39 be done in a follow-up as well?

Utkarsh_33’s picture

Status: Needs work » Needs review
lauriii’s picture

Status: Needs review » Needs work

Posted some feedback on the MR.

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

benjifisher’s picture

From #42:

@benjifisher can #39 be done in a follow-up as well?

Yes. That is what I meant by this: "I am not sure whether it makes sense to do that as part of this issue or if it should be a follow-up."

Utkarsh_33’s picture

Status: Needs work » Needs review
smustgrave’s picture

Not on the accessibility team but still wonder if #36 applies. For the need of an aria-live region.

Nitin shrivastava’s picture

I'm not very familiar with the comment in #36. Could someone please provide some insights or suggestions about it?

I've executed MR #47, applied it successfully, and tested it locally Presently, the interface showcases two distinct dropdowns, each delineating the parent link and menu. I've enclosed a screenshot capturing the changes made after the patch.

Example

Nitin shrivastava’s picture

Status: Needs review » Reviewed & tested by the community
narendraR’s picture

Status: Reviewed & tested by the community » Needs work
FileSize
173.9 KB

Sometime it shows Parent link before Menu, which is not correct. See attached SS.

Utkarsh_33’s picture

I have added the weight to the select element.Attaching the screenshot for the same.

djsagar’s picture

Status: Needs work » Needs review
narendraR’s picture

Status: Needs review » Needs work

Follow-up needs to be created for #37.2 and #39

Utkarsh_33’s picture

Status: Needs work » Needs review
Utkarsh_33’s picture

I have opened a follow-up for #39 in Improve menu parent link selection for node edit form.

Utkarsh_33’s picture

narendraR’s picture

Status: Needs review » Reviewed & tested by the community

Follow-up created, feedback addressed and changes looks good to me. Marking as RTBC.

narendraR’s picture

Status: Reviewed & tested by the community » Needs review

Marking as NR for `Needs accessibility review` and `Usability`

smustgrave’s picture

Status: Needs review » Needs work

Dynamic content which updates without a page reload is generally either a region or a widget. Simple content changes which are not interactive should be marked as live regions. A live region is explicitly denoted using the aria-live attribute.

Using a screen reader (mac's version of one) there is no announcement of the dynamic change to the list.

For the menu link followup I've always used https://www.drupal.org/project/cshs which has worked well.

benjifisher’s picture

Issue summary: View changes
Issue tags: +Needs issue summary update

Marking as NR for `Needs accessibility review` and `Usability`

The "Usability" tag means that the issue affects usability (and is intended to improve it). There is a separate tag, "Needs usability review", for issues that need review by the Usability team or a topic maintainer. For official descriptions of the issue tags, see Issue tags -- special tags.

Another reason to set this issue back to NW is that #2519362: Redesign the menu link add form to be less overwhelming was just fixed. We need to update the work here, and we need new "before" and "after" screenshots. I am updating the "Remaining tasks" in the issue summary and adding the tag for an issue summary update.

edit: oops, that issue is still RTBC. But it looks like it will be fixed any minute now.

Utkarsh_33’s picture

FileSize
419.47 KB

I have made some changes according to the latest changes in #2519362: Redesign the menu link add form to be less overwhelming. Attaching the screenshots of the initial steps.
image

AaronMcHale’s picture

Issue tags: +Needs screenshots

Can we get new before and after screenshots in the issue summary now that #2519362: Redesign the menu link add form to be less overwhelming has landed.

Ideally five screenshots:

  1. Before: dropdown collapsed
  2. Before: dropdown expanded
  3. After: both dropdowns collapsed
  4. After: menu dropdown expanded
  5. After: parent link dropdown expanded

Thanks,
-Aaron

Utkarsh_33’s picture

Utkarsh_33’s picture

Status: Needs work » Needs review

I have added screenshots for both the states for both the forms as requested in #63.Marking it to needs review.

kunal.sachdev’s picture

Issue tags: -Needs screenshots

Before and after screenshots are added and the changes looks good to me. But this still needs accessibility review.

benjifisher’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs screenshots

I am restoring the "Needs screenshots" issue tag because we still need to update the "Current" (or "before") screenshot now that #2519362: Redesign the menu link add form to be less overwhelming is fixed.

Usability review

We discussed this issue at #3405362: Drupal Usability Meeting 2023-12-15. That issue has a link to a recording of the meeting.

For the record, the attendees at the usability meeting were @AaronMcHale, @Emma Horrell, @benjifisher, @rkoller, @simohell, and @worldlinemine.

We agreed that this issue is a big improvement. Besides the usability problem of a really long select list, sometimes two parts of the menu tree look similar. For example, the links under "blog" might be similar to the links under "services". In this case, it is easy to move a link to the wrong place. If those similar sections are parts of different menus, then it will be much easier to avoid mistakes with this change.

Another point is that there are two ways to change the parent of a menu link: from the edit page for the link, or from the listing page for the menu. But if you want to move a link to a different menu, it can only be done from the edit page for the link. After this issue, that will be much easier.

There is one change that the Usability group would like to see as part of this issue:

  • When the Menu selection changes, move the focus to the Parent link select list.

This should be implemented with a delay, so that it is possible to navigate the Menu select list from the keyboard without constantly moving to the other select list. Or perhaps trigger the change of focus on mouse events but not keyboard events. I expect the Accessibility review will have more specific guidance.

In a separate Slack discussion, we considered whether the Menu and Parent link select lists should be grouped in a <details> element. Opinions were split: some like it the way it is, and others think the two select lists should be grouped for consistency with the other elements in the sidebar. If they are grouped, then the <details> element should be open by default. It looks as though the current MR uses a <div> element to group the two select lists.

Another idea for a follow-up issue: consider changing the Add form to be consistent with the Edit form. Currently, the Add form only shows elements of the selected menu as possible parent links. That was a good idea before this issue, but it is worth reconsidering once this issue is fixed. I think it would simplify the code and make the two forms more consistent if we simply set a default value for the Menu select list.

Another idea came up: out of scope for this issue, but worth considering in a separate one. Just as the node module logs an Info message whenever a node is created, edited, or deleted, we should consider the same sort of logging for menu links. That would make it easier to fix the problem if, despite this issue, an administrator accidentally moves a link to the wrong place.

Yet another idea (also out of scope): add a search function to the "Parent link" select list.

If you want more feedback from the usability team, a good way to reach out is in the #ux channel in Slack.

Utkarsh_33’s picture

Issue summary: View changes
FileSize
355.93 KB
404.05 KB
Utkarsh_33’s picture

Issue tags: -Needs screenshots

Attached the screenshots of both the form before this patch.

Utkarsh_33’s picture

There is one change that the Usability group would like to see as part of this issue:

When the Menu selection changes, move the focus to the Parent link select list.
This should be implemented with a delay, so that it is possible to navigate the Menu select list from the keyboard without constantly moving to the other select list. Or perhaps trigger the change of focus on mouse events but not keyboard events. I expect the Accessibility review will have more specific guidance.

I think this can be done once we get a accessibility review on this.

Utkarsh_33’s picture

Another idea for a follow-up issue: consider changing the Add form to be consistent with the Edit form. Currently, the Add form only shows elements of the selected menu as possible parent links. That was a good idea before this issue, but it is worth reconsidering once this issue is fixed. I think it would simplify the code and make the two forms more consistent if we simply set a default value for the Menu select list.

I created a follow-up for this Consider changing the menu-link Add form to be consistent with the Edit form.

Utkarsh_33’s picture

Yet another idea (also out of scope): add a search function to the "Parent link" select list.

I think this would also help us to provide users with a good UX.I created a follow-up for the same in Add search functionality to the "Parent link" select list..

Utkarsh_33’s picture

Status: Needs work » Needs review

I have created the follow-ups that are or could be a great enhancement in conjunction with this issue and also attached the required SS. Marking it needs review as it still needs reviews of accessibility team so that we have a good understanding of how should be proceed with the remaining tasks.

bnjmnm’s picture

  1. There was a suggestion for "When the Menu selection changes, move the focus to the Parent link select list." - this isn't something I'd approve in my role as accessibility maintainer. The expectation is focus would remain on the control being manipulated. Deviating from this expectation would likely cause more confusion than it would offer any benefits.
  2. The now-two select elements should be semantically grouped, you can reference the related elements section of these W3 docs.
bnjmnm’s picture

Status: Needs review » Needs work
kunal.sachdev’s picture

Status: Needs work » Needs review
bnjmnm’s picture

Status: Needs review » Needs work

The accessibility of the grouping seems to work, but having it in a fieldset is introducing some style problems due to there being fairly opinionated fieldset styles that aren't ideal for this use case (particularly in Claro). Suggestion in MR.

kunal.sachdev’s picture

Issue summary: View changes

Updated the IS as before screenshots were added in #68.

kunal.sachdev’s picture

Status: Needs work » Needs review
Issue tags: -Needs issue summary update
omkar.podey’s picture

Status: Needs review » Reviewed & tested by the community

@bnjmnm could you approve that the aria-label in div looks good. Thanks

nod_’s picture

Umm, with umami, when I go to this page after applying the patch: https://drupal.ddev.site/en/admin/structure/menu/link/entity.entity_view... I see that the parent menu is "User account menu" and the parent is the correct "Display mode" from the Administration menu, saving the link doesn't break anything but there is something wrong with the default value for the parent menu.

bnjmnm’s picture

Status: Reviewed & tested by the community » Needs work
FileSize
181.01 KB
124.38 KB

Ran into the same thing as @nod_ in #81