Skip to content

Admin pages: unify layout under jetpack-admin-page-layout mixin - #48109

Merged
CGastrell merged 11 commits into
trunkfrom
change/jetpack-admin-pages-layout
Apr 19, 2026
Merged

CGastrell merged 11 commits into
trunkfrom
change/jetpack-admin-pages-layout

Conversation

@CGastrell

@CGastrell CGastrell commented Apr 15, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #

Proposed changes

Unifies the layout of Jetpack's wp-admin pages under a single, reusable SCSS mixin (@automattic/jetpack-base-styles/admin-page-layout). After this change, every migrated page renders with a viewport-pinned content column: the Jetpack header is pinned at the top, the middle section scrolls internally, and <JetpackFooter> is pinned at the bottom. No window-level scroll; nothing leaks outside the scope.

Covered pages (8):

  • Protect
  • Social (Publicize)
  • VideoPress
  • Backup
  • Newsletter
  • Search
  • Boost (all sub-pages: BoostAdminPage, card-page, settings-page, cache-debug-log, getting-started)
  • Jetpack Network Admin (Sites + Settings)

Key mechanics, in order of commits:

  1. base-styles mixin — Introduces the mixin. Overrides WP core's #wpbody-content { width: 100% } (from wp-admin/css/common.css) with width: auto so position: fixed + left + right: 0 can size the column correctly. Without this, width: 100% resolves to 100vw under fixed positioning and pushes the column past the viewport by the sidebar width.
  2. jetpack-components — Adds a stable jp-admin-page class on <AdminPage> so global stylesheets / shared mixins can target it without coupling to the hashed CSS-Modules class.
  3. Per-page adoption commits — Each page does @include jetpack-admin-page-layout scoped to its body class (one commit per page/plugin). Search and Boost also drop inline <JetpackFooter /> renders + showFooter={false} overrides so the footer lives inside AdminPage's flex column where the mixin can pin it.

Viewport handling:

  • .folded body class (user's persistent "Collapse menu" preference) honored at every desktop width.
  • .auto-fold body class gated to @media (max-width: 960px) (mirroring WP's own wp-admin.css scoping) so stale classes after a narrow → wide resize don't mis-offset the column.
  • Mobile media query (max-width: 782px) explicitly matches #wpbody-content, .folded #wpbody-content, and .auto-fold #wpbody-content so left: 0 wins via equal-specificity source order over the desktop fold rules.
  • Sidebar widths (160, 36) and viewport breakpoints (960, 782) live in SCSS variables; admin-bar height remains var(--wp-admin-bar-height, …) for runtime override.

Related product discussion/links

Does this pull request change what data or activity we track or use?

No.

Testing instructions

On a wp.com / Jurassic Ninja site with Jetpack, Boost, Protect, VideoPress, Backup, Newsletter, Search, Publicize, and (if multisite) the JP Network Admin enabled:

Desktop (≥ 960px):

  1. Load each of the 8 pages listed above. Verify:

    • The Jetpack header is pinned at the top of the content area (immediately below the admin bar).
    • The content column aligns with the right edge of the viewport — no horizontal clipping, no horizontal scrollbar.
    • The JetpackFooter is pinned at the bottom of the content area.
    • The middle section scrolls internally (not the whole window) when content is taller than the viewport.
  2. Click "Collapse menu" in the wp-admin sidebar to fold it. Verify the content column's left edge realigns to the 36px sidebar width on each page.

Narrow desktop (783–960px):

  1. Resize the browser into this range. Verify WP auto-folds the sidebar and the content column's left edge realigns to 36px.

Mobile (≤ 782px):

  1. Resize the browser to a mobile width. Verify:
    • Sidebar slides off-canvas (accessible via the hamburger menu).
    • Content column fills the full viewport width (no 36px or 160px offset).
    • Header/footer remain pinned.

Resize stress test:

  1. Resize the browser from desktop → mobile → back to desktop. Verify the content column reflows correctly each time — no stuck 36px offset from a stale .auto-fold body class.

Screenshots

Desktop (1488×900)

Page Before After
Protect protect before protect after
Social social before social after
VideoPress videopress before videopress after
Backup backup before backup after
Newsletter newsletter before newsletter after
Search search before search after
Boost boost before boost after
Network Sites network-sites before network-sites after

Mobile (600×900)

Page Before After
Protect protect before protect after
Social social before social after
VideoPress videopress before videopress after
Backup backup before backup after
Newsletter newsletter before newsletter after
Search search before search after
Boost boost before boost after
Network Sites not captured network-sites after

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Apr 15, 2026 •

Copy link
Copy Markdown
Contributor

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 change/jetpack-admin-pages-layout branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack change/jetpack-admin-pages-layout
bin/jetpack-downloader test jetpack-mu-wpcom-plugin change/jetpack-admin-pages-layout

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 github-actions Bot added [Feature] Publicize Now Jetpack Social, auto-sharing [JS Package] Base Styles [JS Package] Components [Package] Backup [Package] Newsletter [Package] Publicize [Package] Search Contains core Search functionality for Jetpack and Search plugins [Package] VideoPress [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. [Status] In Progress Admin Page React-powered dashboard under the Jetpack menu RNA labels Apr 15, 2026
@github-actions

github-actions Bot commented Apr 15, 2026 •

Copy link
Copy Markdown
Contributor

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!


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: May 5, 2026
    • Code freeze: May 4, 2026

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Boost plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Protect plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@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 15, 2026
@jp-launch-control

jp-launch-control Bot commented Apr 15, 2026 •

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 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. [Status] In Progress labels Apr 15, 2026
@CGastrell CGastrell self-assigned this Apr 17, 2026
@CGastrell
CGastrell marked this pull request as ready for review April 17, 2026 15:17
CGastrell and others added 6 commits April 17, 2026 16:15
Introduces @automattic/jetpack-base-styles/admin-page-layout, a SCSS mixin
that standardizes Jetpack wp-admin pages: a viewport-pinned content column
with the Jetpack header pinned at the top, a middle that scrolls internally,
and JetpackFooter pinned at the bottom. No window-level scroll.

Key mechanics:

- Override WP core's "#wpbody-content { width: 100% }" (common.css) with
  "width: auto" so position: fixed + left + right: 0 can size the column
  correctly. Without this, width: 100% resolves to 100vw under fixed
  positioning and pushes the column past the viewport.
- Honor the .folded body class unconditionally (user's persistent
  "Collapse menu" preference) and gate .auto-fold to (max-width: 960px),
  mirroring WP's own wp-admin.css scoping. This keeps a stale auto-fold
  class from mis-offsetting the column after a narrow to wide viewport
  resize.
- The mobile media query matches #wpbody-content, .folded #wpbody-content,
  and .auto-fold #wpbody-content explicitly so "left: 0" wins via
  equal-specificity source order over the desktop fold rules.
- Sidebar widths and viewport breakpoints live in SCSS variables; the
  admin-bar height stays as var(--wp-admin-bar-height, default) to keep
  the documented runtime-override path open.

Exports the mixin via package.json so consumers can

    @use "@automattic/jetpack-base-styles/admin-page-layout" as *;

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds "jp-admin-page" as a second, non-CSS-Modules-hashed className on
the AdminPage root in addition to the existing hashed styles["admin-page"]
token. This gives global stylesheets and shared mixins (notably
jetpack-admin-page-layout from @automattic/jetpack-base-styles) a stable
selector to target without coupling to the hashed module name.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Scopes the shared admin-page layout to body.jetpack_page_jetpack-protect
so Protect uses the standard header-pinned / middle-scrolling /
footer-pinned layout. No other visual changes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Scopes the shared admin-page layout to body.jetpack_page_jetpack-social
(the Social menu page is served by the Publicize package) so Social uses
the standard header-pinned / middle-scrolling / footer-pinned layout.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Scopes the shared admin-page layout to body.jetpack_page_jetpack-videopress.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Scopes the shared admin-page layout to body.jetpack_page_jetpack-backup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CGastrell and others added 5 commits April 17, 2026 16:15
Adds @automattic/jetpack-base-styles as a workspace dep and scopes the
shared admin-page layout to body.jetpack_page_jetpack-newsletter. Keeps
the existing dataviews imports in place.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Search rendered JetpackFooter twice: once via AdminPage's built-in slot,
once as a sibling inside the dashboard. It suppressed the built-in slot
with showFooter={false}, which conflicted with the shared mixin's
footer-pinning rules.

Drops the showFooter={false} flag and the inline <JetpackFooter /> so
the footer lives inside AdminPage's flex column where the mixin can pin
it. Adds dashboard/scss/admin-layout.scss to scope the mixin to
body.jetpack_page_jetpack-search and imports it from dashboard/index.jsx.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Boost rendered JetpackFooter directly inside each page (BoostAdminPage,
card-page, settings-page, cache-debug-log, getting-started) and
suppressed AdminPage's built-in footer with showFooter={false}. That
left the footer outside AdminPage's flex column, so the shared mixin
could not pin it.

Drops the inline <JetpackFooter /> imports/renders and removes
showFooter={false} so the footer lives inside AdminPage where the mixin
pins it. Adds the body.jetpack_page_jetpack-boost scope in
admin-style.scss.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Scopes the shared admin-page layout to both network-admin body classes:

  toplevel_page_jetpack-network-sites    (Sites, the default view)
  jp-network_page_jetpack-network-settings   (Settings submenu)

Both share #jp-network-admin-root and branch on data-page.

The Settings class prefix is derived from the menu *title* ("JP Network")
sanitized to "jp-network", so it does NOT follow the usual
"toplevel_page_*" convention — see the
admin_print_scripts-jp-network_page_jetpack-network-settings hook in
tools/docker/mu-plugins/0-sandbox.php for the canonical reference.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Covers all ten projects touched by the admin-page-layout mixin
introduction and per-page adoption:

- base-styles     (new public mixin + export — minor, added)
- components      (AdminPage stable class — patch, changed)
- protect         (patch, changed)
- publicize       (patch, changed)
- videopress      (patch, changed)
- backup          (patch, changed)
- newsletter      (patch, changed; also adds workspace dep)
- search          (patch, changed; drops inline footer)
- boost           (patch, changed; drops inline footers)
- jetpack         (patch, enhancement — network admin)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@CGastrell
CGastrell force-pushed the change/jetpack-admin-pages-layout branch from 738a46b to 5cc4a58 Compare April 17, 2026 20:52
@CGastrell
CGastrell merged commit 2ddb7d5 into trunk Apr 19, 2026
193 of 203 checks passed
@CGastrell
CGastrell deleted the change/jetpack-admin-pages-layout branch April 19, 2026 12:10
@github-actions github-actions Bot removed [Status] In Progress [Status] Needs Review This PR is ready for review. labels Apr 19, 2026
keoshi added a commit that referenced this pull request Apr 22, 2026
Re-add the admin-page layout adoption that #48109 originally added
to `components/Admin/style.scss` — a file this branch deleted when
it moved to the new shell pattern. Scoping the mixin to
`body.jetpack_page_jetpack-backup` restores the unified wp-admin
layout (pinned Jetpack header, internally-scrolling middle, pinned
`JetpackFooter`) so Backup renders consistently with Protect,
Social, VideoPress, Newsletter, Search, Boost, and the Network
Admin pages.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ilonagl pushed a commit that referenced this pull request Apr 30, 2026
Re-add the admin-page layout adoption that #48109 originally added
to `components/Admin/style.scss` — a file this branch deleted when
it moved to the new shell pattern. Scoping the mixin to
`body.jetpack_page_jetpack-backup` restores the unified wp-admin
layout (pinned Jetpack header, internally-scrolling middle, pinned
`JetpackFooter`) so Backup renders consistently with Protect,
Social, VideoPress, Newsletter, Search, Boost, and the Network
Admin pages.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
adamwoodnz added a commit that referenced this pull request May 1, 2026
…#48437)

The jetpack-admin-page-layout mixin (#48109) forces grandchildren of
.admin-ui-page into a flex column with min-height: 0, which made
.jp-search-dashboard-top a flex item. Per spec, min-height: auto on a
flex item resolves to 0 when overflow != visible, and the section's
existing `overflow: hidden` (originally clipping the mocked-search box
shadow) let the flex algorithm crush it from 410px down to ~18px.

- Replace the outer overflow: hidden with `clip-path: inset(...)` so
  min-height: auto stays content-based; clip only at the bottom edge
  so the shadow halo stays visible on top/left/right but doesn't bleed
  into the next section.
- Square the mocked-search card's bottom corners so they meet the
  clipped edge cleanly.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Admin Page React-powered dashboard under the Jetpack menu [Feature] Publicize Now Jetpack Social, auto-sharing [JS Package] Base Styles [JS Package] Components [Package] Backup [Package] Newsletter [Package] Publicize [Package] Search Contains core Search functionality for Jetpack and Search plugins [Package] VideoPress [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. RNA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant