Skip to content

Admin pages: honor WP.com nav-unification 272px sidebar width#48182

Merged
CGastrell merged 1 commit intotrunkfrom
fix/admin-page-layout-nav-unification-sidebar
Apr 19, 2026
Merged

Admin pages: honor WP.com nav-unification 272px sidebar width#48182
CGastrell merged 1 commit intotrunkfrom
fix/admin-page-layout-nav-unification-sidebar

Conversation

@CGastrell
Copy link
Copy Markdown
Contributor

Fixes a regression from #48109 that shipped the jetpack-admin-page-layout mixin.

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.

  • Add $jp-sidebar-width-nav-unification: 272px alongside the existing sidebar-width constants.
  • Add a single media-gated rule (@media (min-width: 961px) { &.is-nav-unification:not(.folded) #wpbody-content { left: 272px } }) right after the existing .auto-fold rule.
  • No consumer package changes — every page that @include jetpack-admin-page-layout; picks up the fix.

Why only one rule is needed:

Viewport .folded .auto-fold Sidebar on nav-unification Existing mixin output Correct?
≥ 961 on 272 160 ❌ → fixed by this PR
≥ 961 on 36 36 ✅ (folded rule wins by specificity)
783–960 on 36 36 ✅ (auto-fold @media rule)
783–960 on 36 36
≤ 782 any any 0 (off-canvas) 0

The 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 body carries is-nav-unification):

  1. Navigate to /wp-admin/admin.php?page=jetpack-newsletter.
  2. At a desktop viewport (≥ 961px), verify the content column's left edge aligns flush with the right edge of the 272px sidebar — no gap, no horizontal clipping, no horizontal scrollbar.
  3. Click Collapse menu in the sidebar. Verify the content column realigns to the 36px folded sidebar.
  4. Resize to 900px. Verify the sidebar auto-folds to 36px and the content column realigns.
  5. Resize to 600px. Verify the sidebar slides off-canvas and the content fills the full viewport.
  6. Repeat 1–5 on admin.php?page=jetpack-social and admin.php?page=jetpack-search.
  7. On a self-hosted site (no nav-unification, 160px sidebar), verify none of the above regresses — the column should still align to 160px at expanded widths.

Measurements (before/after, 1280×720, nav-unification)

Element Before After
#adminmenuwrap width 272px 272px
#wpbody-content left 160px 272px
#wpbody-content x 160 272
#wpbody-content width 1120 (112px off-screen) 1008 (flush)

Empirically 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 .folded toggled.

🤖 Generated with Claude Code

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>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 19, 2026

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack or WordPress.com Site Helper), and enable the fix/admin-page-layout-nav-unification-sidebar branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack fix/admin-page-layout-nav-unification-sidebar
bin/jetpack-downloader test jetpack-mu-wpcom-plugin fix/admin-page-layout-nav-unification-sidebar

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 19, 2026

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

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:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

@github-actions github-actions bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Apr 19, 2026
@CGastrell CGastrell added [Status] Needs Review This PR is ready for review. and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Apr 19, 2026
@CGastrell CGastrell marked this pull request as ready for review April 19, 2026 14:15
@CGastrell CGastrell self-assigned this Apr 19, 2026
@jp-launch-control
Copy link
Copy Markdown

Code Coverage Summary

This 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. 🤷

Full summary · PHP report · JS report

@CGastrell CGastrell merged commit ac0427b into trunk Apr 19, 2026
122 of 124 checks passed
@CGastrell CGastrell deleted the fix/admin-page-layout-nav-unification-sidebar branch April 19, 2026 14:52
@github-actions github-actions bot removed the [Status] Needs Review This PR is ready for review. label Apr 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant