Skip to content

Navigation in Site View: Automatically expand all options #69343

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

dhruvikpatel18
Copy link
Contributor

@dhruvikpatel18 dhruvikpatel18 commented Feb 27, 2025

Closes #56346

What?

This PR changes the default state of navigation submenus in Site View from collapsed to expanded, making all navigation options immediately visible to users without requiring manual expansion.

Why?

When viewing the Navigation section in Site View, submenus are currently collapsed by default, requiring users to click on each section to see available options. This creates an unnecessary extra step for users trying to navigate the site structure. Having submenus expanded by default provides better discoverability and improves the overall user experience.

Testing Instructions

  1. Open the Site Editor
  2. Navigate to the Site View
  3. Observe the Navigation section
  4. Verify that all submenus are now expanded by default

Screenshots or screencast

Before

Screen.Recording.2025-02-26.at.1.15.58.PM.mov

After

Screen.Recording.2025-02-27.at.2.04.14.PM.mov

@dhruvikpatel18 dhruvikpatel18 marked this pull request as ready for review February 27, 2025 08:35
Copy link

github-actions bot commented Feb 27, 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.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: dhruvikpatel18 <dhruvik18@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: scruffian <scruffian@git.wordpress.org>

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

@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. [Block] Navigation Affects the Navigation Block labels Feb 27, 2025
Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late reply.

I think that changing the default value of the ListView component itself isn't a good approach, as it affects all the list view.

We should be able to add isExpanded prop here to override the default vaule:

@dhruvikpatel18
Copy link
Contributor Author

@t-hamano Thanks for the feedbacks, I've added isExpanded prop to sidebar-navigation-screen-navigation-menus component.

@dhruvikpatel18 dhruvikpatel18 requested a review from t-hamano April 9, 2025 07:04
Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@t-hamano t-hamano merged commit 6b75535 into WordPress:trunk Apr 9, 2025
61 checks passed
@github-actions github-actions bot added this to the Gutenberg 20.7 milestone Apr 9, 2025
chriszarate pushed a commit to chriszarate/gutenberg that referenced this pull request Jul 1, 2025
…69343)

* Navigation in Site View: Automatically expand all options

* Updated ListViewComponent function doc comment

* Add isExpanded prop to navigation menu content

* Updates the doc comment

Co-authored-by: dhruvikpatel18 <dhruvik18@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: scruffian <scruffian@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Navigation in Site View: Automatically expand all options
2 participants