Repository navigation
Admin pages: unify layout under jetpack-admin-page-layout mixin - #48109
Conversation
|
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! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
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. |
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. 🤷 |
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>
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>
738a46b to
5cc4a58
Compare
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>
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>
…#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>
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):
Key mechanics, in order of commits:
base-stylesmixin — Introduces the mixin. Overrides WP core's#wpbody-content { width: 100% }(fromwp-admin/css/common.css) withwidth: autosoposition: fixed + left + right: 0can size the column correctly. Without this,width: 100%resolves to100vwunder fixed positioning and pushes the column past the viewport by the sidebar width.jetpack-components— Adds a stablejp-admin-pageclass on<AdminPage>so global stylesheets / shared mixins can target it without coupling to the hashed CSS-Modules class.@include jetpack-admin-page-layoutscoped 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:
.foldedbody class (user's persistent "Collapse menu" preference) honored at every desktop width..auto-foldbody class gated to@media (max-width: 960px)(mirroring WP's ownwp-admin.cssscoping) so stale classes after a narrow → wide resize don't mis-offset the column.(max-width: 782px)explicitly matches#wpbody-content,.folded #wpbody-content, and.auto-fold #wpbody-contentsoleft: 0wins via equal-specificity source order over the desktop fold rules.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):
Load each of the 8 pages listed above. Verify:
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):
Mobile (≤ 782px):
Resize stress test:
.auto-foldbody class.Screenshots
Desktop (1488×900)
Mobile (600×900)
🤖 Generated with Claude Code