Skip to content
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

Navigation Submenu: Add Layout Support #69225

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

Rishit30G
Copy link
Contributor

@Rishit30G Rishit30G commented Feb 18, 2025

What?

Part of #43248

Why?

The block was missing the layout support

How?

The PR adds the following to the block.json of the block to support the 'Layout'

 "supports": {
    "layout": true
 }

Testing Instructions

  • Open the editor
  • Insert the Menu block
  • Add a menu and then create a submenu for it
  • Select the submenu block and see the right panel
  • Observe that the 'Layout' section is present in the settings tab in the right panel

Screenshots or screencast

Screen.Recording.2025-02-18.at.8.53.18.AM.mov

@Mamaduka Mamaduka added [Type] Enhancement A suggestion for improvement. [Block] Submenu Affects the Submenu Block - for submenus in navigation [Feature] Layout Layout block support, its UI controls, and style output. labels Feb 18, 2025
@Rishit30G Rishit30G marked this pull request as ready for review February 18, 2025 04:56
Copy link

github-actions bot commented Feb 18, 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: Rishit30G <[email protected]>
Co-authored-by: carolinan <[email protected]>

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

@carolinan
Copy link
Contributor

I have tested the PR with the navigation block only, not the page list.
I don't think that this is the right solution, or I am not even sure what this PR is trying to solve; why does the submenu need layout support? This question needs to be answered.

Here are some notes and questions that I have from testing the PR:
The options increases the complexity of a block that is already difficult to work with.
I like the idea of being able to align the text of the menu link in the navigation block, but I don't think it should be limited to submenus.
Why can I enter a wide width option, when the submenu can never be wide?
It is difficult to understand what the content width option does, because it does not change the width of the submenu.
The design on the front does not match what I see in the editor.
If I enable "Inner blocks use content width" the submenu link text is centered by default, but neither the center, left, or right aligned options are working on the front of the site.
On the front, the arrow icon is miss aligned.

Editor:
The submenu in the navigation block in the editor, with the menu text aligned to the right

Front:
The submenu in the navigation block on the front of the site, where the text is not aligned to the right.

@Rishit30G
Copy link
Contributor Author

Hi @carolinan

Thanks for sharing the feedback and apologies for the PR if it's not appropriate enough,

The PR comes from the comment shared here: #43248 (comment)

Screenshot 2025-02-18 at 1 08 33 PM

The options increases the complexity of a block that is already difficult to work with.
I like the idea of being able to align the text of the menu link in the navigation block, but I don't think it should be limited to submenus.
Why can I enter a wide width option, when the submenu can never be wide?
It is difficult to understand what the content width option does, because it does not change the width of the submenu.
The design on the front does not match what I see in the editor.
If I enable "Inner blocks use content width" the submenu link text is centered by default, but neither the center, left, or right aligned options are working on the front of the site.
On the front, the arrow icon is miss aligned.

Thanks for this, to me based on the above points it looks like that we should not include the layout option for this menu
Should I go ahead a close the PR ?

@carolinan
Copy link
Contributor

We can keep it open for a bit since others may have something to add.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Submenu Affects the Submenu Block - for submenus in navigation [Feature] Layout Layout block support, its UI controls, and style output. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants