Admin pages: honor WP.com nav-unification 272px sidebar width#48182
Admin pages: honor WP.com nav-unification 272px sidebar width#48182
Conversation
The jetpack-admin-page-layout mixin hardcodes a 160px sidebar at expanded widths. On the WP.com wp-admin (body.is-nav-unification) the sidebar is actually 272px, so the pinned content column started 112px inside the sidebar and extended past the viewport on the right, visibly cropping Newsletter, Social, Search, etc. when accessed from WP.com. Below the auto-fold breakpoint (<= 960px) the sidebar narrows to 36px on both surfaces, and .folded always wins at 36px, so only the expanded-default state needs adjusting. 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 a regression from #48109 that shipped the
jetpack-admin-page-layoutmixin.Proposed changes
The mixin hardcodes a 160px sidebar at expanded widths. On WordPress.com's wp-admin (
body.is-nav-unification) the sidebar is actually 272px, so the pinned content column started 112px inside the visible sidebar and extended past the viewport on the right — visibly cropping Newsletter, Social, Search, Protect, VideoPress, Backup, Boost, and Jetpack Network Admin when accessed from WordPress.com.$jp-sidebar-width-nav-unification: 272pxalongside the existing sidebar-width constants.@media (min-width: 961px) { &.is-nav-unification:not(.folded) #wpbody-content { left: 272px } }) right after the existing.auto-foldrule.@include jetpack-admin-page-layout;picks up the fix.Why only one rule is needed:
.folded.auto-foldThe only broken state on nav-unification is the expanded default at ≥ 961px; every other state already resolved correctly via specificity or existing media-gated rules. The
:not(.folded)guard preserves the folded rule's win at wide widths.Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Testing instructions
On a WordPress.com site with Jetpack plugins installed (Newsletter, Social, Search, etc.), sign in to the wp-admin (any site where
bodycarriesis-nav-unification):/wp-admin/admin.php?page=jetpack-newsletter.admin.php?page=jetpack-socialandadmin.php?page=jetpack-search.Measurements (before/after, 1280×720, nav-unification)
#adminmenuwrapwidth#wpbody-contentleft#wpbody-contentx#wpbody-contentwidthEmpirically confirmed on https://outside34.wordpress.com/wp-admin/admin.php?page=jetpack-newsletter (and
jetpack-social,jetpack-search) at 600/900/961/1280px viewports, and with.foldedtoggled.🤖 Generated with Claude Code