-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Navigation: select list view tab on contentOnly #75024
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
base: trunk
Are you sure you want to change the base?
Conversation
|
Size Change: +20 B (0%) Total Size: 2.98 MB
ℹ️ View Unchanged
|
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
mikachan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works well for me, and the code changes seem simple enough 🙌
| setSelectedTabId( firstTabName ); | ||
| // In contentOnly mode, prefer List View tab if it exists | ||
| const isContentOnlyMode = | ||
| isSectionBlock || contentClientIds?.length > 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just double-checking that we want this for all blocks, and not just Navigation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, I think the list view tab will only show when there's a block that has it, ie: the nav block (I don't think any other block has list view tab)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the list view is only intended for the navigation block in content only right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding was the list view becomes active when a navigation block is selected. Then if a different block is selected it would go back to the content tab.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
List, Buttons and Social also have the List View tab. I think Gallery could also have it too, but it hasn't been implemented yet.
|
I get the idea of this PR but I can't reproduce the problem in a fresh install Can you provide some more precise steps to actually see the problem in action before the PR? gb75024.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR 🙇
I haven't managed to test this yet, but based on the description I;m concerned that we might be making too large of a change here.
This means that when you select a template part it shows List View immediately which I believe isn't what the team working on this were aiming for.
Can we take a pause here whilst I review?
If we haven't already please can we consider what is outlined in Proposed solution on the related Issue?
|
I've requested a review from @talldan who I know has been instrumental in the wider contentOnly work. Perhaps it would be possible to come up with a solution that solves for Navigation whilst also remaining faithful to the goals of the wider contentOnly work. |
|
I'll add some comments ot the Issue with clearer intent and rationale. |
Ok, I've been able to reproduce it locally I wondered now: by default, it's selecting the leftmost element in the Inspector Why not default to List View instead, on the left in all blocks like a canonical thing? It's intuitive (at least in LTR mindset), to have by default selected the leftmost tab. |
|
I'm not sure about having the second tab as the default for patterns. Agree with @SirLouen that it feels expected for the first tab to be selected. I don't mind the idea of moving the List View tab to first. The current order matches what was proposed in Block Attribute Groups, so that might be a good place to discuss it. In terms of other ideas, the suggestion from @andrewserong (#74843 (review)) seems like a good one (switch to the List View tab whenever 'Edit Navigation' is clicked), and that's something I started looking into, but there's no API for selecting an inspector tab, so it would need something new. My other idea is that perhaps whenever a block that has the gutenberg/packages/block-editor/src/components/block-card/index.js Lines 122 to 125 in fdb5877
|
Yeah, if possible, I feel like defaulting to the list view tab should happen based on clicking "Edit Navigation" as it seems to be a clearer user intent than always switching to the list view. Otherwise, the current state of this PR feels a bit stuck to me as it buries the overview of the pattern/section. In the following video, note that when I select the CTA pattern that contains the buttons, you stay on that view even when selecting other blocks within the pattern. Then when selecting a template part, because we're on the list view, we don't see the Site Title or other blocks, because we're on the list view: 2026-01-29.14.31.24.mp4Put another way: I think the content tab is more suited as an overview / first place to land, whereas the list view feels a bit more like something you go to for making edits and changes. |
|
Thanks for all the comments here. I've updated the Issue description to provide a better overview of user requirements and various criteria. Hopefully this helps to inform the direction a bit more.
This is a good instinct. It signals clear intent to edit Navigation so it's clearly a good pattern to adopt. |


What?
Closes #74894
Makes the List View tab the default active tab when selecting blocks in contentOnly mode, instead of the Content tab.
Why?
When selecting a Navigation block (or any block) in contentOnly mode, users should immediately see the List View tab which provides essential editing functionality. Currently, the Content tab is shown by default, requiring an extra click to access List View.
How?
InspectorControlsTabscomponent to detect contentOnly modeTesting Instructions