Skip to content

Components: fix AdminPage SCSS module header selectors for admin-ui 2.1#49018

Merged
CGastrell merged 2 commits into
trunkfrom
fix/admin-page-scss-header-selectors
May 22, 2026
Merged

Components: fix AdminPage SCSS module header selectors for admin-ui 2.1#49018
CGastrell merged 2 commits into
trunkfrom
fix/admin-page-scss-header-selectors

Conversation

@CGastrell
Copy link
Copy Markdown
Contributor

Sibling fix to #49006.

Proposed changes

Adapt the AdminPage SCSS module in js-packages/components to @wordpress/admin-ui 2.1's DOM change. admin-ui 2.1 removed render={ <header /> } from the Page component's outer Stack (Gutenberg PR #78001 — "Fix nested landmark in header"), so the rendered page header is now a <div> instead of a <header>. The three jetpack-side overrides in this module all targeted the <header> element by tag and silently stopped matching on 2.1, restoring admin-ui's defaults beneath us.

  • Replace the three :global(.jp-admin-page__page > header) selectors with > :first-child. :first-child matches the same element <header> did in 2.0 and the new <div> in 2.1 — backward + forward compatible. The selectors fix the three regressions:
    • .without-bottom-border mode (used by AdminPage when tabs are present) no longer hides admin-ui's hairline border under the header.
    • position: relative; z-index: 1; (JETPACK-1386, disables admin-ui's sticky header on Jetpack admin pages) no longer applies — sticky re-engages globally.
    • The visual-slot [aria-hidden="true"] centering rule no longer applies — the JetpackLogo pins to top-left of the 24px grid cell.
  • Bump @wordpress/admin-ui from 2.0.0 to 2.1.0 in js-packages/components' package.json — consumer-side pin for the version this fix targets (same convention used in Base styles: Fix admin-page-layout header selector for admin-ui 2.1 #49006 and Newsletter: Drop dead admin-ui build-style import; pin admin-ui 2.1.0 #49007).

Together with #49006 (the sibling fix in the js-packages/base-styles admin-page-layout mixin), this resolves the publicize page header spacing regression that surfaced during local testing of #48404 (Renovate's monorepo-wide @wordpress/* bump). On a connected dev install with admin-ui 2.1 + the bumped consumers, the Publicize dashboard's title and subtitle were rendering "compacted" — that turned out to be the cumulative visual effect of the three overrides above ceasing to fire, not a missing gap in admin-ui's CSS. Verified empirically: applying the swap restores Publicize to its expected appearance.

Why this dashboard was the visual canary: publicize's "Publish once. Share everywhere." subtitle is the shortest in the codebase at 33 characters (single line). Long subtitles (Newsletter, Scan, Search, VideoPress, Protect — all 45–71 chars) wrap and visually mask the symptom; publicize doesn't.

Related product discussion/links

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

No.

Testing instructions

  1. Apply the bump from #48404 (or wait for it to land) so @wordpress/admin-ui@2.1.0 is the resolved version. Without 2.1 in the tree, this PR is a no-op visually — the rules still match <header> via :first-child.
  2. Build the affected packages:
    pnpm jetpack build --deps packages/publicize packages/newsletter packages/videopress packages/search packages/scan plugins/protect packages/my-jetpack
  3. On a connected Jetpack dev install, navigate to /wp-admin/admin.php?page=jetpack-publicize — the Publicize page header. Confirm:
    • Title and subtitle have the expected vertical rhythm (no perceptible compaction).
    • Header is NOT stickily pinned (JETPACK-1386 behavior preserved — admin-ui's default sticky is suppressed).
    • When tabs are present on other dashboards (Newsletter, Protect, etc.), the hairline border between header and tabs row is removed (.without-bottom-border is firing).
    • JetpackLogo visual slot is vertically centered.
  4. Spot-check the other dashboards (Newsletter, VideoPress, Search, Scan, Protect, My Jetpack) for the same three behaviors — none should have regressed.
  5. No new build, lint, or test failures.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 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 May 20, 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. [Status] In Progress labels May 20, 2026
@CGastrell CGastrell self-assigned this May 20, 2026
@CGastrell CGastrell marked this pull request as ready for review May 22, 2026 12:46
Replace the three `> header` selectors in the AdminPage SCSS module
with `> :first-child` so they keep matching after @wordpress/admin-ui
2.1 changed the page header element from <header> to <div>.

Together with #49006 (which applied the same fix to the shared
admin-page-layout mixin in js-packages/base-styles), this resolves the
publicize page header spacing regression that surfaced on PR #48404 —
the title/subtitle ' compaction' was the cumulative effect of the three
jetpack-side overrides (sticky-disable, border removal, visual-slot
centering) silently ceasing to fire, not a missing gap.

Also bumps @wordpress/admin-ui from 2.0.0 to 2.1.0 in this package as
the consumer-side pin of the version this fix targets.
@CGastrell CGastrell force-pushed the fix/admin-page-scss-header-selectors branch from 0dc21dc to add52fe Compare May 22, 2026 12:51
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 22, 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-scss-header-selectors branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack fix/admin-page-scss-header-selectors
bin/jetpack-downloader test jetpack-mu-wpcom-plugin fix/admin-page-scss-header-selectors

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

@jp-launch-control
Copy link
Copy Markdown

jp-launch-control Bot commented May 22, 2026

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

…ader

The dashboard test was scoping the Jetpack Logo locator via
`page.locator( 'header' )` — coupling to admin-ui 2.0's <header>
element. admin-ui 2.1 renders the page header as a <div>
(WordPress/gutenberg#78001), so the locator finds nothing once this
PR's admin-ui pin lands.

Swap the locator to `.jp-admin-page__page > :first-child` — same
positional pattern this PR uses in the SCSS module, matches both the
old <header> and the new <div>. Updates the surrounding comment to
explain the choice.
@github-actions github-actions Bot added [Plugin] Search A plugin to add an instant search modal to your site to help visitors find content faster. [Tests] Includes Tests E2E Tests labels May 22, 2026
@CGastrell CGastrell merged commit 35d3e78 into trunk May 22, 2026
119 of 120 checks passed
@CGastrell CGastrell deleted the fix/admin-page-scss-header-selectors branch May 22, 2026 13:50
@github-actions github-actions Bot removed [Status] In Progress [Status] Needs Review This PR is ready for review. labels May 22, 2026
dhasilva added a commit that referenced this pull request May 22, 2026
…9101)

The consistent-header-height rule from #49080 still selected the page
header via `> header`, but admin-ui 2.1 (#49018) renders it as a `<div>`,
so the selector matched nothing and the tab strip began shifting again on
admin-ui 2.1 consumers (Newsletter). Switch to `> :first-child`, matching
the sibling header-normalization rules — it targets the header
positionally and works for both admin-ui 2.0's `<header>` and 2.1's
`<div>`.

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

E2E Tests [JS Package] Components [Plugin] Search A plugin to add an instant search modal to your site to help visitors find content faster. RNA [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant