Skip to content

Conversation

@AKSHAT2802
Copy link

@AKSHAT2802 AKSHAT2802 commented Jul 21, 2025

Trac ticket: https://core.trac.wordpress.org/ticket/49876

This PR improves the clarity of available menu items in the WordPress Customizer by visually differentiating which items are already added to the current menu. The styling is reversed from typical patterns — unused items are emphasised in bold, while in-use items appear with normal font weight

Benefits:

  • Makes unused items immediately stand out for easier discovery and selection.
  • Accurate visual feedback when toggling between different menus in the Customizer.

@github-actions
Copy link

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@joedolson
Copy link
Contributor

This feedback is purely visual; it's going to need to also be available to screen reader users. Perhaps by appending screen-reader-text with the text "(in current menu)" to the item.

@AKSHAT2802 AKSHAT2802 marked this pull request as ready for review July 21, 2025 17:19
@github-actions
Copy link

github-actions bot commented Jul 21, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props akshat2802, joedolson, alexstine.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@AKSHAT2802
Copy link
Author

AKSHAT2802 commented Jul 22, 2025

Thanks @joedolson for the quick review 🙇
I have updated the PR to improve accessibility.

I also suggest that instead of in current menu, we add already in current menu, which could provide a more appropriate context to the users.

@joedolson joedolson self-requested a review September 2, 2025 15:47
@joedolson
Copy link
Contributor

I think the in current menu and already in current menu are pretty much synonymous; but I'll ask some screen reader users for opinions here.

If you have an opinion, @alexstine, that would be appreciated.

@alexstine
Copy link

@AKSHAT2802 @joedolson The text "in current menu" is fine. Thanks.

@joedolson
Copy link
Contributor

In testing, I found that this has a pretty strange bug - when I attempt to scroll the list of pages, most of the items disappear. I don't have time right this moment to track this down, but I wanted to mention it in a comment now, if you want to try to explore it @AKSHAT2802.

To reproduce: I was testing in Firefox on MacOS.

Open the customizer, going to add items to a menu.

Before doing anything else, swipe on the track pad to explore the list of pages. In my test, this resulted in most items in the list disappearing. I haven't yet explored this further, yet.

Additionally, the same functionality will need to be applied in both the admin menu management and in the customizer; we want to always try and keep user experience parity between those two interfaces.

@AKSHAT2802
Copy link
Author

In testing, I found that this has a pretty strange bug - when I attempt to scroll the list of pages, most of the items disappear. I don't have time right this moment to track this down, but I wanted to mention it in a comment now, if you want to try to explore it @AKSHAT2802.

To reproduce: I was testing in Firefox on MacOS.

Open the customizer, going to add items to a menu.

Before doing anything else, swipe on the track pad to explore the list of pages. In my test, this resulted in most items in the list disappearing. I haven't yet explored this further, yet.

Hii @joedolson
I’ve retested this PR, and it’s working well for me. Items are not disappearing when scrolling in the Customizer, and the font weight correctly reflects the intended behaviour — unused items are bold and in-use items are normal.
(Tested on Chrome & Firefox for MacOS)
PFA:

Screen.Recording.2025-09-10.at.11.46.13.PM.1.1.mov

Additionally, the same functionality will need to be applied in both the admin menu management and in the customizer; we want to always try and keep user experience parity between those two interfaces.

Thanks for the feedback. As mentioned in the comment, I thought this ticket was scoped only to the Customizer → Menus section, so this PR focuses on that interface.

I agree that parity should also be maintained in the Appearance → Menus screen. Could you please guide me on how we should differentiate the items there? 🙇 At the moment, items in that screen are displayed in normal font weight by default.

@joedolson
Copy link
Contributor

I'd say that the comment that suggests that ticket was about the customizer was actually wrong; based on the original reporter, I'd say that the ticket was about the admin menu manager. Regardless, I generally prefer to do both at the same time, to ensure that we're keeping the two interfaces in sync.

Re: differentiating on appearance.

I actually don't think we should use font weight to do this in either menu. To me, it's not very clear.

For the admin menu management, where there are checkboxes in use, perhaps we can use the same mechanism that the bulk editor uses for managing categories? It uses an indeterminate state for checkboxes. See https://core.trac.wordpress.org/changeset/57580 for how that was done.

For the customizer, there's an existing "selected" state added by the class item-added on the menu-item-handle div. That state is used to visually indicate that you have added an item to the menu; a similar state could be used to indicate that a listed item is already in the menu. I'd just use the same state, but without reducing the contrast.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants