Repository navigation
Admin pages: hide #screen-meta-links in shared layout mixin - #48195
Conversation
Core wp-admin always emits the `#screen-meta-links` wrapper (the "Screen Options" / "Help" tabs container) and gives it `margin: 0 10px 20px 0`. On WP.com (`is-nav-unification`) the wpcom toolbar adds extra buttons too. With `#wpbody-content` flipped to `position: fixed` flex by the `jetpack-admin-page-layout` mixin, that bottom margin reserves a 20px slot at the top of the content column, pushing `.jp-admin-page` down by 20px on every Jetpack admin page rendered through the WP.com shell. Self-hosted Jetpack sites don't render the wrapper at all, so the gap is invisible there — which is why this only shows up on the calypso side. Hide it in the mixin so every consumer gets the fix in one place. None of our React admin pages register screen-options or help tabs, so the buttons have no purpose. `#screen-meta` itself is left alone — core defaults it to `display:none` and only toggles it on click, which never happens here. Also drop the now-redundant local hide rule from the Search dashboard.
|
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 #
Proposed changes
#screen-meta-linksinside the sharedjetpack-admin-page-layoutmixin so it stops reserving a 20px slot at the top of the content column on every Jetpack admin page.Context
Core wp-admin always emits
#screen-meta-links(the "Screen Options" / "Help" tabs container) inwp-admin/admin-header.php, even when empty, and core CSS gives itmargin: 0 10px 20px 0. On WP.com hosted sites (is-nav-unification) the wpcom toolbar adds extra buttons too.With
#wpbody-contentflipped toposition: fixedflex byjetpack-admin-page-layout(introduced in #48109), that bottom margin reserves a ~20px slot at the top of the content column and pushes.jp-admin-pagedown by exactly 20px on every Jetpack admin page rendered through the WP.com shell. Self-hosted Jetpack sites don't render the wrapper at all (something in the local stack suppresses it), which is why this regression only shows up on the Calypso side and was missed in local testing.#screen-metaitself is not hidden by this PR — core defaults it todisplay: noneand only toggles it on click via the screen-meta-links buttons, which we've now hidden, so it never opens. Adding a redundant rule for it would be noise.Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Testing instructions
This regression is only visible on WP.com hosted sites (or any environment where the WP shell still emits
#screen-meta-links). Self-hosted local Jetpack sites won't render the element at all — testing locally will show no visual change.To verify on WP.com:
https://<your-site>/wp-admin/admin.php?page=jetpack-social, in a mobile viewport (~390×844)..jp-admin-pagecontent. In DevTools you'll find#screen-meta-linkswithdisplay: block,height: 0,margin-bottom: 20px..jp-admin-pagesits flush against the admin bar.#screen-meta-linksisdisplay: nonevia the mixin.document.getElementById('screen-meta-links').style.display = 'none'— content should jump up by 20px.Pages to spot-check (all use the mixin): My Jetpack, Backup, Boost, Newsletter, Protect, Search, Social, VideoPress, plus the Jetpack network admin page.