Repository navigation
List View: Enhance list view to display heading level with title - #70136
Infinite-Null wants to merge 3 commits into
Conversation
|
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. |
t-hamano
left a comment
There was a problem hiding this comment.
Thanks for the PR!
Additional design feedback may be needed, but from a code perspective, let's avoid adding block-specific processing to the useBlockDisplayTitle hook.
We should be able to change the label by adding __experimentalLabel field. Example:
|
Hi @t-hamano, Thank you for the feedback. I have made the necessary changes. Please review it at your convenience. |
|
Thanks for the update! I think the approach itself is good. Another important thing is that we always need to take localization into account. In the current implementation, the order is fixed, like We should be able to do it like this: if ( context === 'list-view' ) {
const listViewTitle =
customName || ( hasContent ? content : __( 'Heading' ) );
return sprintf(
/* translators: list view text. 1: heading level. 2: heading content. */
__( '%1$s: %2$s' ),
`H${ level }`,
listViewTitle
);
}Also, I think the code itself is mostly good, but I'd like to hear what the designers think about this change. @WordPress/gutenberg-design |
t-hamano
left a comment
There was a problem hiding this comment.
The code seems fine, let's wait for design feedback.
|
Great! Thank you for working on this @Infinite-Null To me it seems to do the job it needs to do. It looks identical with selecting a Heading block. |
|
@Infinite-Null @karmatosed actually just added some designs for this in #42181 I think instead of adding the heading level as raw text we should instead dynamically swap out the icon to use the heading level icons as @karmatosed showed there :) Let me know if you have any questions / concerns about this. |
This is technically possible, but there are two points to be aware of:
|
|
Sorry for the late reply! The Heading block seems to render icons depending on the level now. I think this is related to the variation added to the Heading block in #73823.
I'd like to close this PR, but thanks for your efforts! |


What?
This PR enhances the List View by displaying the heading level (H1, H2, etc.) alongside the heading title, making it easier to identify and navigate the heading hierarchy.
Closes #54631
Why?
List View doesn't visually indicate heading levels, making it difficult for users to understand the document structure without selecting each heading individually.
Testing Instructions for Keyboard
Testing Instructions for Keyboard
Screenshot: