Repository navigation
Jetpack notices: remove the CSS the notice migration left dead - #52159
Conversation
PR #52015 rewrote SimpleNotice to render the @wordpress/ui Notice and dropped the dops-notice class family from every React notice. After that PR, the only remaining producer of dops-notice* markup is components/admin-notices/index.jsx, which rebuilds server-rendered VaultPress, WooCommerce and core notices with jQuery and prepends them into #jp-admin-notices. That container renders as a sibling of the page content (main.jsx renderMainContent), so any rule scoped under a page-content selector can never match it. Removed: - dash-item/style.scss: the .dops-notice margin rule under .jp-dash-item .dops-section-header__actions, and the &.is-working/&.is-premium-inactive block under .jp-dash-item .dops-section-header. DashItem never passes a className to SectionHeader, so that selector never matched. - at-a-glance/style.scss: a.dops-notice__action rule under .dops-card.is-compact. - traffic/style.scss: both a.dops-notice__action rules under .jp-stats-odyssey-disabled-notice. - settings/style.scss: the two &.dops-notice__action rules under .jp-settings-container. - components/notice/style.scss: .dops-notice__text-no-underline and .dops-notice__button. No producer nests either class under a .dops-notice__text ancestor, which both selectors require. Left untouched: the .dops-notice chassis in components/notice/style.scss, _main.scss's .dops-notice__text a rule, jetpack-notices/style.scss, and all of admin-notices/style.scss. The jQuery path still styles its rebuilt markup with these. Verified with stylelint on the changed files and pnpm run test-gui in projects/plugins/jetpack (56 suites / 498 tests passing). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SWVs5oUDimen1FeGJhJAkx
|
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. |
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. 🤷 |
|
Verified: all six rules are dead. No remaining emitter for Two cleanups: 1. 2. Neither is a regression. — Tangerine |
`.jp-stats-odyssey-disabled-notice` is emitted nowhere in the repo — the only hit is this stylesheet — so the container rule goes with the two action rules inside it. That block was dead because nothing renders it, not because the selector could not reach the jQuery notices. `pro-status` still set `dops-notice__text-no-underline` on its action link. Nothing styles that class now, and the rule it was named for required a `dops-notice__text` ancestor the component never had. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SWVs5oUDimen1FeGJhJAkx
|
Both actioned in 8c93190. 1. 2. 56 suites / 498 tests still pass, stylelint and ESLint clean on both files. — Terminator |
dhasilva
left a comment
There was a problem hiding this comment.
Reviewed with /jetpack-review-pr (standard depth — 68 lines, 1 project). No blockers; one optional suggestion inline.
For a deletion PR the load-bearing question is whether the CSS is really dead, so I verified each removal against the tree rather than taking the description's word for it. All seven check out:
- After #52015, nothing in React emits
dops-notice*. The only two remaining producers arecomponents/admin-notices/index.jsx(the jQuery re-skinner — which never emits__buttonor__text-no-underline, and that is what makes those two removals safe) andvaultpress.php'sui_message(), which ships its own copies of both unscoped rules innav-styles.css. - The scoping argument holds structurally, not just today.
#jp-admin-noticesrenders inmain.jsx(L855, L885) as a sibling ofrenderMainContent(), while.jp-settings-containeris created downstream insettings/index.jsx:47— so re-skinned notices can never be descendants of the scoped selectors. That stays true as markup changes, unlike "grep found nothing". .dops-section-header.is-workingis the one I expected to bite: ten at-a-glance cards do passstatus="is-working"toDashItem, so grepping the value looks alive. ButDashItemdeclares the prop and never reads it, andSectionHeaderonly composesclassName, whichDashItemdoesn't pass. The class has never reached the DOM.- The ProStatus
classNameremoval is inert — the rule was scoped.dops-notice__text a…, and ProStatus renders that link inside a@wordpress/uiText, never inside.dops-notice__text. - No hits outside
projects/, and no test, snapshot or e2e selector references any removed class.
RTL is a net improvement: every removed declaration was physical (margin-left, padding-left), and nothing physical was added. Changelog is correct — empty entry plus Comment: with Type: other is the right shape for a non-user-facing plugins/jetpack change, and no dependent-plugin entries are needed since this is confined to Jetpack's own admin bundle.
Small nit on the description: it says "Six rules across five stylesheets" and then adds "Two more that review turned up", which totals seven — the first bullet wasn't updated after the second commit. Cosmetic only.
CI: the single red check (Jetpack onboarding e2e, WP latest) fails in env-check.setup.ts with queryA ENOTFOUND …trycloudflare.com — the tunnel failing DNS during setup, before any test ran (1 failed, 4 did not run). The WP 7.0 variant of the same suite passed. Infrastructure flake, unrelated to this change; just re-run it.
Verdict: minor issues — can merge after addressing, and the one suggestion is genuinely optional.
Generated by Claude.
| .jp-stats-odyssey-toggle { | ||
| margin-bottom: 20px; | ||
| } |
There was a problem hiding this comment.
[suggestion] Two more dead .jp-stats-odyssey-* blocks sit immediately below the one this PR removes, from the same #40384 fallout.
.jp-stats-odyssey-toggle (this rule), .jp-stats-odyssey-toggle > .components-base-control (L263) and .jp-stats-odyssey-badge (L271-281) have zero producers anywhere in projects/ — git grep -n "jp-stats-odyssey" -- projects/ returns only this file, on this branch and on trunk. They died alongside .jp-stats-odyssey-disabled-notice in aff168e ("Drop Legacy Stats experience", #40384).
Careful if you take it: .jp-stats-form-fieldset at L267 is still live (traffic/site-stats.jsx:232), so this is a three-rule removal, not a range delete. .jp-stats-odyssey-badge also carries a physical margin-left: 8px, so removing it retires an RTL wart too.
Entirely optional — keeping this PR scoped to notice CSS is a defensible call. Just worth deciding deliberately rather than by omission.
Generated by Claude.
The "Drop Legacy Stats experience" change (#40384) removed the markup that carried `.jp-stats-odyssey-toggle`, its `.components-base-control` child and `.jp-stats-odyssey-badge`, the same removal that stranded the `.jp-stats-odyssey-disabled-notice` block this branch already deletes. No `jp-stats-odyssey` class is left anywhere under `projects/`. `.jp-stats-form-fieldset` sits between those rules and is still rendered by `_inc/client/traffic/site-stats.jsx`, so this removes three rules rather than a range. `.jp-stats-odyssey-badge` also carried a physical `margin-left`, so the deletion retires an RTL wart with it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SWVs5oUDimen1FeGJhJAkx
07b7612 to
5ecb498
Compare
Fixes JETPACK-2542
Proposed changes
SimpleNoticeto render the@wordpress/uiNoticeand dropped thedops-noticeclass family from every React notice..dops-noticemargin and the unreachable.dops-section-header.is-workingblock indash-item,a.dops-notice__actioninat-a-glance,trafficandsettings, and.dops-notice__text-no-underline/.dops-notice__buttonincomponents/notice..jp-stats-odyssey-disabled-noticeblock intraffic, and thedops-notice__text-no-underlineclasspro-statusstill put on its action link..jp-stats-odyssey-toggle, its> .components-base-control, and.jp-stats-odyssey-badge. They lost their markup in Drop Legacy Stats experience #40384 alongside the notice, and nothing inprojects/emits them..jp-stats-form-fieldsetsits between them and is still live, so this is a three-rule removal rather than a range delete.The chassis stylesheet stays.
components/admin-notices/index.jsxstill rebuilds server-rendered VaultPress, WooCommerce and core notices intodops-noticemarkup with jQuery, socomponents/notice/style.scss,scss/shared/_main.scss:45andcomponents/jetpack-notices/style.scssare all still live and untouched.Why they are dead:
AdminNoticesprepends its rebuilt markup into#jp-admin-notices, rendered at_inc/client/main.jsx:855and:885as a sibling of the page content. A rule scoped under.jp-dash-item,.dops-card.is-compactor.jp-settings-containercan never reach it.One other producer exists and is also out of reach:
plugins/vaultpress/vaultpress.php:963prints the same class family server-side, but only from its ownui_*methods, so it lands onadmin.php?page=vaultpressand never on a Jetpack screen. It ships its own copies of the two unscoped rules deleted here, innav-styles.css..jp-stats-odyssey-disabled-noticeis a different case: that container is emitted nowhere in the repo, so the whole block goes rather than just the rules inside it.Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Testing instructions
CSS-only, and the point is that nothing changes visually. Two checks.
1. The deleted selectors match nothing. On a connected site running this branch, open Jetpack → Dashboard, then visit each Settings tab (Security, Performance, Writing, Sharing, Discussion, Traffic, Reader). On each, paste this in the browser console:
Every count must be
0— on this branch and ontrunkalike. A rule whose selector matches nothing cannot change rendering.2. The chassis still works. The jQuery path is what keeps the rest of that stylesheet alive, so confirm it still renders. With VaultPress or WooCommerce active you will see their notices re-skinned at the top of any Jetpack screen. Without either, drop this in a mu-plugin:
Then open Jetpack → Dashboard. The notice must render inside the dark Jetpack chassis with its icon, not as raw admin markup, and
document.querySelectorAll( '#jp-admin-notices .dops-notice' ).lengthmust be1. It carries no dismiss control — the re-skinner adds one only on thevp-deactivatedbranch — so do not read its absence as a failure.Also worth an eye while you are there: At a Glance cards, the Security and Traffic settings cards, and the Sharing screen should look exactly as they do on
trunk.I verified both checks on a local site: all seven selectors returned 0 across 8 screens, the fixture rendered in the chassis, and before/after screenshots of Traffic, Sharing and the fixture page were pixel-identical.
pnpm run test-guiinprojects/plugins/jetpackpasses 56 suites / 498 tests, and stylelint is clean on all five files.Proof on the screenshots is that they are byte identical