Admin UI: change default heading level from h2 to h1#77617
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. |
|
Size Change: +23 B (0%) Total Size: 7.77 MB 📦 View Changed
ℹ️ View Unchanged
|
retrofox
left a comment
There was a problem hiding this comment.
It makes sense to me, and the changes are consistent. LGTM.
dd72c83 to
50ba970
Compare
|
Flaky tests detected in b9c0cf2. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/25001250521
|
…editor These Page components are rendered inside nested landmark regions within the site editor layout, where h2 is the semantically correct heading level. They were relying on the old default of 2 which changed to 1.
0b8c865 to
b9c0cf2
Compare
What?
Why?
Use of h1 is important for accessibility on pages where the title heading is clearly the main heading of the page. That's not the case in all site-editor pages, where the navigation sidebar includes "page heading" outside the actual
Pagecomponent.Currently, we're manually switching to h1 on "top level pages" like on Fonts and Connectors, which is when
headingLevelwas initially added.Since many of the default use cases by plugin developers and also within Gutenberg are "classic sidebar + Page", it's reasonable to default to h1 so that consumers (especially plugin developers) don't need to worry about this.
In future, I'd expect WP Build to just handle the semantics depending on what we're building, so that nobody needs to think about the right accessible heading level.
How?
Default to h1 instead of h2 in the page header.
Testing Instructions
See affected screens:
Standalone admin pages
connectors-home/wp-admin/options-general.php?page=options-connectors-wp-adminguidelines/wp-admin/options-general.php?page=guidelines-wp-admintaxonomies/wp-admin/options-general.php?page=taxonomies-wp-adminfont-list/wp-admin/themes.php?page=font-library-wp-admin&p=%2Ffont-listSite Editor
navigation-list/wp-admin/admin.php?page=site-editor-v2&p=%2Fnavigation%2Flistnavigation-edit/wp-admin/admin.php?page=site-editor-v2&p=%2Fnavigation%2Fedit%2F{id}pattern-list/wp-admin/admin.php?page=site-editor-v2&p=%2Fpatterns%2Flist%2F{type}post-list/wp-admin/admin.php?page=site-editor-v2&p=%2Ftypes%2F{type}%2Flist%2F{slug}styles/wp-admin/admin.php?page=site-editor-v2&p=%2Fstylestemplate-part-list/wp-admin/admin.php?page=site-editor-v2&p=%2Ftemplate-parts%2Flist%2F{area}Make sure to test both versions of the site editor (see Gutenberg→Experiments):

Testing Instructions for Keyboard
Screenshots or screencast
Examples of pages that should remain h1:



Examples of pages that should remain h2:
Use of AI Tools
Created by using Cursor.