Skip to content

Boost: build the Settings tab on the modernization chassis#48728

Open
keoshi wants to merge 2 commits into
update/boost-modernization-overviewfrom
update/boost-modernization-settings
Open

Boost: build the Settings tab on the modernization chassis#48728
keoshi wants to merge 2 commits into
update/boost-modernization-overviewfrom
update/boost-modernization-settings

Conversation

@keoshi
Copy link
Copy Markdown
Contributor

@keoshi keoshi commented May 12, 2026

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.Root with its toggle, description, and per-module sub-feature panel below. The chassis stays behind rsm_jetpack_ui_modernization_boost — flip the filter on to see it, flip off and the legacy dashboard returns unchanged.

What ships in each card

  • Cornerstone Pages — URL textarea with plan-aware validation (same-site URL guard, "homepage already included" guard, 1-page free / 10-page premium limit), Include default pages action with plan-aware truncation tooltip, Prerender Cornerstone Pages toggle, free-plan upgrade Notice. Saving regenerates Cloud CSS when enabled and invalidates LCP state — same side effects as the legacy panel.
  • Critical CSS (manual) — Status card with file count + timestamp, ProgressBar while pending, Regenerate Critical CSS button, provider-error summary linking to the legacy Critical CSS Advanced page, regenerate-suggestion banner driven by critical_css_suggest_regenerate, manual→auto upgrade Notice.
  • Cloud CSS (auto) — Same Status panel with auto-mode copy. Filtered out on free.
  • LCP — Status panel with last-optimized timestamp + Optimize action firing lcp_state.request-analyze, error notice for failed pages.
  • Page Cache — Setup-error notice with Retry + Dismiss, Show options collapsible with 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 the <entry>_default read-only entries.
  • Image CDN — Adjust image quality (3 RangeControls + Lossless toggles for JPEG / PNG / WebP) + Auto-resize lazy images sub-toggle on premium; free-plan upgrade Notice otherwise.
  • Image Guide — "Image resizing is unavailable" warning Notice when the server can't run Imagick or GD.

Architecture

  • Generic useDataSyncEntry< Schema > + useDataSyncAction hooks (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.
  • Per-module hooks: useCriticalCssState, useLcpState, usePageCacheSettings / useRunPageCacheSetup / useClearPageCache, useImageCdnQuality, useCornerstonePagesList / useCornerstonePagesProperties / useSetCornerstonePagesList, usePremiumFeatures.
  • Premium gating: usePremiumFeatures().has( slug ) — slugs cornerstone-10-pages, cloud-critical-css, image-cdn-quality, image-cdn-liar.
  • Settings page renders as a 660px-capped column, flat list (no section headings), behind 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 to trunk from the GitHub UI.

Test plan

  • Flip add_filter( 'rsm_jetpack_ui_modernization_boost', '__return_true' ); and load wp-admin/admin.php?page=jetpack-boost. Switch to Settings.
  • Toggle every module on and off — each card's toggle round-trips through modules_state; the toggle disables while writing.
  • Cornerstone Pages — expand the card; add a custom URL; save; reload and confirm it persists. Try saving a same-site URL and a wrong-site URL — the wrong-site URL surfaces a validation error and disables Save. Click Include default pages when present.
  • Critical CSS (manual) — click Regenerate Critical CSS; the ProgressBar appears, the file count updates when complete, the timestamp ticks up.
  • LCP — enable the module; the Status panel reports the analysis state; click Optimize to retrigger.
  • Page Cache — expand Show options; add a bypass pattern; save; toggle logging; click Clear cache + See logs.
  • Minify JS / CSS — expand the per-card panel; add a handle; save; reload and confirm the summary chip updates. Click Load default handles to merge the curated list in.
  • Image CDN (free) — turn the module on; the upgrade Notice appears with an Upgrade now button pointing at ?page=my-jetpack#/add-boost-image-cdn.
  • Image CDN (premium) — Quality sliders + Lossless toggles + Auto-resize lazy images render and round-trip.
  • Image Guide — on a server without Imagick/GD the "unavailable" warning appears.
  • Flip the filter off → reload → legacy Boost dashboard renders unchanged.

🤖 Generated with Claude Code

…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.
@github-actions github-actions Bot added the [Plugin] Boost A feature to speed up the site and improve performance. label May 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 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 🤖


🔴 Action required: Please include detailed testing steps, explaining how to test your change, like so:

## Testing instructions:

* Go to '..'
*

🔴 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:

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

My PR adds *x* and *y*.

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!


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.

@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 12, 2026
@keoshi keoshi added [Status] In Progress and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels May 12, 2026
@jp-launch-control
Copy link
Copy Markdown

jp-launch-control Bot commented May 12, 2026

Code Coverage Summary

No summary data is available for parent commit dc43c50, so cannot calculate coverage changes. 😴

If that commit is a feature branch rather than a trunk commit, this is expected. Otherwise, this should be updated once coverage for dc43c50 is available.

Full summary · PHP report · JS report

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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Plugin] Boost A feature to speed up the site and improve performance. [Status] In Progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant