Boost: build the Settings tab on the modernization chassis#48728
Boost: build the Settings tab on the modernization chassis#48728keoshi wants to merge 2 commits into
Conversation
…8717) Every legacy module is ported onto WPDS Card primitives with its advanced controls: - Cornerstone Pages — collapsible card, URL editor with plan-aware validation, "Include default pages" with plan-aware truncation, Prerender Cornerstone Pages toggle, free-plan upgrade Notice (cornerstone-10-pages), regenerate-CSS + LCP refetch side effects on save. - Critical CSS (manual) — Status panel with file count + timestamp, ProgressBar while pending, Regenerate Critical CSS button, provider error summary linking to the advanced page, regenerate suggestion banner driven by critical_css_suggest_regenerate, manual to auto upgrade Notice (cloud-critical-css). - Cloud CSS (auto) — same Status panel with auto-mode copy, hidden on free via available=false. - LCP — Status panel with last-optimized timestamp + Optimize action driving lcp_state.request-analyze, error notice for failed pages. - Page Cache — Setup-error notice with Retry + Dismiss, "Show options" collapsible: bypass patterns textarea + save, logging toggle, See logs link, Clear cache action. - Minify JS / Minify CSS — Reusable Exclude handles panel with comma-separated input + summary chip + "Load default handles" action backed by <entry>_default read-only entries. - Image CDN — Adjust image quality (3 RangeControls + Lossless toggles per JPEG/PNG/WebP) + Auto-resize lazy images sub-toggle when premium, free-plan upgrade Notice otherwise. - Image Guide — "Image resizing is unavailable" warning when the server can not run Imagick/GD. Adds generic useDataSyncEntry + useDataSyncAction hooks so per- module hooks compose a single read/write/action surface against the existing data-sync REST endpoints without dragging in @automattic/jetpack-react-data-sync-client (which would ship a second copy of React Query). Premium gating reads premium_features and exposes usePremiumFeatures().has(slug). Settings page renders as a 660px-capped column with no section headings (flat list), behind the modernization filter.
|
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 🤖 🔴 Action required: Please include detailed testing steps, explaining how to test your change, like so: 🔴 Action required: We would recommend that you add a section to the PR description to specify whether this PR includes any changes to data or privacy, like so: Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! 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. |
Restructures the Settings tab to mirror the design's IA:
- One `Card.Root` per design section ("Cornerstone pages", "Code
loading optimization", "Image CDN configuration", "Image guide")
with a `Card.Title` header and a stack of module rows in the body,
rather than one card per module.
- Cornerstone pages moves to the top of the list, contains the URL
editor (inline-expandable "Edit pages" subrow with the legacy
textarea + validation + Include defaults), the "Pre-render
cornerstone pages" toggle, AND the "Optimize LCP Images for
smoother experience" toggle with a "Last optimized X / Regenerate"
subrow. LCP groups here rather than under a separate "Image
loading optimization" section since LCP optimization is keyed off
the cornerstone-pages list.
- CSS row label is unified to "Automatically Optimize CSS Loading"
regardless of which underlying module (cloud_css / critical_css)
is available — the free-plan manual mode still surfaces the
manual→auto upsell as a persistent Notice.
- Concatenate JS / Concatenate CSS each carry an Exclude-handles
subrow ("Except: jquery, jquery-core, … | Exclude JS handles")
whose action expands an inline editor with the textarea +
Save + Load defaults.
- Image CDN configuration combines the Image CDN parent toggle
(with an Adjust quality subrow that expands the JPEG/PNG/WebP
sliders) + the Auto-Resize Lazy Images sub-toggle. Free plans
see the upgrade Notice instead.
- Image guide section uses the relabeled "Activate overlay guide
on site" toggle.
New primitives:
- `SectionCard` — Card.Root + Card.Header + Card.Title + Card.Content
with a vertical stack of children.
- `ModuleRow` — toggle + label row, body-md description, optional
`persistent` and `children` slots.
- `ModuleSubrow` — "summary | action link" row inside a soft gray
bordered chrome, with an optional expandable panel for inline
editors.
Old per-module card files (module-card, cornerstone-pages-card,
lcp-status, page-cache-meta, minify-meta, image-cdn-quality,
image-cdn-children, image-guide-children) are deleted in favor of
the four section files (cornerstone-section, code-loading-section,
image-cdn-section, image-guide-section).
Summary
PR 3 of the Boost modernization umbrella (#48717) — builds the Settings tab on the modernization chassis with full parity for every legacy module's advanced controls.
Cornerstone Pages is a collapsible card at the top, then every Boost module renders as a
Card.Rootwith its toggle, description, and per-module sub-feature panel below. The chassis stays behindrsm_jetpack_ui_modernization_boost— flip the filter on to see it, flip off and the legacy dashboard returns unchanged.What ships in each card
critical_css_suggest_regenerate, manual→auto upgrade Notice.lcp_state.request-analyze, error notice for failed pages.<entry>_defaultread-only entries.Architecture
useDataSyncEntry< Schema >+useDataSyncActionhooks (in_inc/lib/) compose every per-module read/write/action surface against the existing data-sync REST endpoints. No dependency on@automattic/jetpack-react-data-sync-client— keeps the modernized bundle from shipping a second copy of React Query.useCriticalCssState,useLcpState,usePageCacheSettings/useRunPageCacheSetup/useClearPageCache,useImageCdnQuality,useCornerstonePagesList/useCornerstonePagesProperties/useSetCornerstonePagesList,usePremiumFeatures.usePremiumFeatures().has( slug )— slugscornerstone-10-pages,cloud-critical-css,image-cdn-quality,image-cdn-liar.rsm_jetpack_ui_modernization_boost.Stacked on PR 2
This PR's base is
update/boost-modernization-overview(#48726). Once PR 2 squash-merges, re-point this PR's base totrunkfrom the GitHub UI.Test plan
add_filter( 'rsm_jetpack_ui_modernization_boost', '__return_true' );and loadwp-admin/admin.php?page=jetpack-boost. Switch to Settings.modules_state; the toggle disables while writing.?page=my-jetpack#/add-boost-image-cdn.🤖 Generated with Claude Code