Skip to content

Add site settings for third-party blocks and theme style gating#22785

Draft
jkmassel wants to merge 4 commits intojkmassel/wpapiclient-wpcom-supportfrom
jkmassel/site-settings-rust
Draft

Add site settings for third-party blocks and theme style gating#22785
jkmassel wants to merge 4 commits intojkmassel/wpapiclient-wpcom-supportfrom
jkmassel/site-settings-rust

Conversation

@jkmassel
Copy link
Copy Markdown
Contributor

@jkmassel jkmassel commented Apr 9, 2026

Summary

Extracts the site settings changes from #22579 and layers them on top of #22765.

  • New "Use Third-Party Blocks" site setting — toggle in Site Settings gated behind GutenbergKit and editor assets support, with DB migration (v70→71), full data model plumbing (SiteSettingsModel, SiteSettingsInterface, WPComSiteSettings), and preference XML
  • Enhanced "Use Theme Styles" gating — contextual warnings when the site lacks editor settings support (disabled) or when the active theme is not a block theme
  • SiteSettingsProvider interface — injectable abstraction over SiteSettingsTable for reading site settings and determining block editor default, replacing static SiteUtils calls (now @Deprecated)
  • Per-site AppPrefs — three new prefs (SITE_SUPPORTS_EDITOR_SETTINGS, SITE_SUPPORTS_EDITOR_ASSETS, SITE_THEME_IS_BLOCK_THEME) for caching editor capability discovery results

Test plan

  • Open Site Settings on a WP.com site with GutenbergKit enabled — verify "Use Theme Styles" and "Use Third-Party Blocks" toggles are visible
  • On a site without editor settings support — verify "Use Theme Styles" is disabled with an unsupported message
  • On a site without editor assets support — verify "Use Third-Party Blocks" is disabled with an unsupported message
  • On a site with a non-block theme — verify "Use Theme Styles" shows a warning about non-block themes
  • Toggle both settings and reopen Site Settings — verify state is persisted
  • Verify DB migration runs cleanly on upgrade (v70→71)

Add a new "Use Third-Party Blocks" toggle in Site Settings, gated
behind GutenbergKit and editor assets support. Enhance the existing
"Use Theme Styles" toggle with contextual warnings when the site
lacks editor settings support or uses a non-block theme.

Includes SiteSettingsProvider interface for injectable access to
site settings from the local DB, replacing static SiteUtils calls
for block editor default detection.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dangermattic
Copy link
Copy Markdown
Collaborator

dangermattic commented Apr 9, 2026

1 Error
🚫 Please add tests for class EditorSettingsRepository (or add unit-tests-exemption label to ignore this).
1 Warning
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

jkmassel and others added 3 commits April 9, 2026 15:52
Gate the "Use Third-Party Blocks" toggle behind the remote
gutenberg_kit_plugins feature flag in addition to the existing
GutenbergKit and editor assets checks. Also simplify the summary
string by removing "and styles" per reviewer feedback.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…tion

Add ThemeRepository to fetch the active theme via WP API and determine
if it is a block theme. Add EditorSettingsRepository to discover
editor settings and editor assets route support via manifest/API root
queries. Wire SiteSettingsFragment to use EditorSettingsRepository for
gating theme styles and third-party blocks toggles.

Also adds manifest route fetching methods to WpApiClientProvider for
discovering available REST routes on WP.com and self-hosted sites.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove fetchWpComManifestRoutes and fetchSiteManifestRoutes from
WpApiClientProvider. EditorSettingsRepository now uses the standard
WpApiClient.request { it.apiRoot().get() } for all site types,
which already handles WP.com vs self-hosted URL resolution.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wpmobilebot
Copy link
Copy Markdown
Contributor

App Icon📲 You can test the changes from this Pull Request in WordPress Android by scanning the QR code below to install the corresponding build.

App NameWordPress Android
Build TypeDebug
Versionpr22785-e6d6139
Build Number1488
Application IDorg.wordpress.android.prealpha
Commite6d6139
Installation URL1eks3the3ei50
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Copy Markdown
Contributor

App Icon📲 You can test the changes from this Pull Request in Jetpack Android by scanning the QR code below to install the corresponding build.

App NameJetpack Android
Build TypeDebug
Versionpr22785-e6d6139
Build Number1488
Application IDcom.jetpack.android.prealpha
Commite6d6139
Installation URL47ivjc1am2660
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants