AdminPage: keep header-height rule matching on admin-ui 2.1#49101
Conversation
The consistent-header-height rule from #49080 still selected the page header via `> header`, but admin-ui 2.1 (#49018) renders it as a `<div>`, so the selector matched nothing and the tab strip began shifting again on admin-ui 2.1 consumers (Newsletter). Switch to `> :first-child`, matching the sibling header-normalization rules — it targets the header positionally and works for both admin-ui 2.0's `<header>` and 2.1's `<div>`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Code Coverage SummaryThis PR did not change code coverage! That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷 |
Fixes #
Follow-up to #49080 (consistent AdminPage header height) which regressed against #49018.
Proposed changes
.jp-admin-page__page > header, but Components: fix AdminPage SCSS module header selectors for admin-ui 2.1 #49018 bumped@wordpress/admin-uito 2.1, which renders the page header as a<div>instead of a<header>(Admin UI: Fix nested landmark in Page header WordPress/gutenberg#78001). The selector matched nothing, so the rule stopped firing and the tab strip began shifting vertically again on admin-ui 2.1 consumers (Newsletter)..jp-admin-page__page > :first-child > div:has(...), matching the three sibling header-normalization rules that Components: fix AdminPage SCSS module header selectors for admin-ui 2.1 #49018 already converted to> :first-child. This targets the header positionally and works for both admin-ui 2.0's<header>(VideoPress) and 2.1's<div>(Newsletter).Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Testing instructions
wp-buildconsumesjetpack-componentsfrom itsbuild/output, so rebuild that package first, then the dashboards:pnpm --filter @automattic/jetpack-components buildpnpm --filter @automattic/jetpack-newsletter build:wp-buildandpnpm --filter @automattic/jetpack-videopress build:wp-buildwp-admin/admin.php?page=jetpack-newsletter), switch between Subscribers and Settings. Confirm the tab strip stays at the same vertical position (the header no longer grows/shrinks).wp-admin/admin.php?page=jetpack-videopress), switch between Overview, Library, and Settings. Confirm the same — verifying the change also holds on the still-2.0.0-pinned VideoPress (<header>) consumer.