Add site settings for third-party blocks and theme style gating#22785
Open
Add site settings for third-party blocks and theme style gating#22785
Conversation
Collaborator
Generated by 🚫 Danger |
Contributor
|
|
Contributor
|
|
540e9af to
d50de44
Compare
Contributor
🤖 Build Failure AnalysisThis build has failures. Claude has analyzed them - check the build annotations for details. |
937ccc1 to
1ed0f7a
Compare
Contributor
Project dependencies changeslist! Upgraded Dependencies
rs.wordpress.api:android:alpha-2026-04-20, (changed from trunk-0d94794142482d1b7f9395c0afef57ac991c452e)
rs.wordpress.api:kotlin:alpha-2026-04-20, (changed from trunk-0d94794142482d1b7f9395c0afef57ac991c452e)tree +--- project :libs:fluxc
-| \--- rs.wordpress.api:android:trunk-0d94794142482d1b7f9395c0afef57ac991c452e
-| +--- com.squareup.okhttp3:okhttp:5.3.2 (*)
-| +--- com.squareup.okhttp3:okhttp-tls:5.3.2
-| | +--- com.squareup.okhttp3:okhttp:5.3.2 (*)
-| | +--- com.squareup.okio:okio:3.16.4 (*)
-| | \--- org.jetbrains.kotlin:kotlin-stdlib:2.2.21 -> 2.3.20 (*)
-| +--- net.java.dev.jna:jna:5.18.1
-| +--- rs.wordpress.api:kotlin:trunk-0d94794142482d1b7f9395c0afef57ac991c452e
-| | +--- com.squareup.okhttp3:okhttp:5.3.2 (*)
-| | +--- com.squareup.okhttp3:okhttp-tls:5.3.2 (*)
-| | +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2 (*)
-| | \--- org.jetbrains.kotlin:kotlin-stdlib:2.1.21 -> 2.3.20 (*)
-| \--- org.jetbrains.kotlin:kotlin-stdlib:2.1.21 -> 2.3.20 (*)
+| \--- rs.wordpress.api:android:alpha-2026-04-20
+| +--- com.squareup.okhttp3:okhttp:5.3.2 (*)
+| +--- com.squareup.okhttp3:okhttp-tls:5.3.2
+| | +--- com.squareup.okhttp3:okhttp:5.3.2 (*)
+| | +--- com.squareup.okio:okio:3.16.4 (*)
+| | \--- org.jetbrains.kotlin:kotlin-stdlib:2.2.21 -> 2.3.20 (*)
+| +--- net.java.dev.jna:jna:5.18.1
+| +--- rs.wordpress.api:kotlin:alpha-2026-04-20
+| | +--- com.squareup.okhttp3:okhttp:5.3.2 (*)
+| | +--- com.squareup.okhttp3:okhttp-tls:5.3.2 (*)
+| | +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2 (*)
+| | \--- org.jetbrains.kotlin:kotlin-stdlib:2.1.21 -> 2.3.20 (*)
+| \--- org.jetbrains.kotlin:kotlin-stdlib:2.1.21 -> 2.3.20 (*)
-\--- rs.wordpress.api:android:trunk-0d94794142482d1b7f9395c0afef57ac991c452e (*)
+\--- rs.wordpress.api:android:alpha-2026-04-20 (*) |
5ff6521 to
50fca51
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk #22785 +/- ##
==========================================
+ Coverage 37.15% 37.18% +0.02%
==========================================
Files 2314 2317 +3
Lines 124297 124468 +171
Branches 16882 16896 +14
==========================================
+ Hits 46188 46280 +92
- Misses 74366 74444 +78
- Partials 3743 3744 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
6fad2fb to
694d6d1
Compare
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>
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>
Call `EditorSettingsRepository.fetchEditorCapabilitiesForSite` when the user lands on My Site so the route-discovery and theme-detection results are available by the time they open Site Settings. On failure, a snackbar is shown and cached prefs retain their previous values so settings degrade to disabled rather than crashing.
12 tests covering pref delegation, route discovery persistence, theme detection, API errors, transport-level error isolation (one fetch failing doesn't block the other), and the both-fail case. Also fix MySiteViewModelTest for new constructor param.
Points at Automattic/wordpress-rs#1285 which fixes route discovery on WP.com simple sites so editor-assets and editor-settings routes appear in the API root response. Also adapts StatsDataSourceImpl to the new StatsUtmKeys API (String replaced with List<StatsUtmKey>).
Switch from hasRoute (exact path match) to hasRouteForEndpoint
(namespace + endpoint) so that WP.com sites — whose route keys
include a sites/{site_id} prefix — are correctly detected.
Requires wordpress-rs PR #1285 which adds hasRouteForEndpoint
to WpApiDetails and the ApiUrlResolver parameter.
Call fetchEditorCapabilitiesForSite during pull-to-refresh so editor settings prefs stay current without requiring a full screen resume. Show snackbar on failure in both paths.
694d6d1 to
305ccc3
Compare
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Extracts the site settings changes from #22579 and layers them on top of #22765.
GutenbergKitPluginsFeatureand editor assets route support, with DB migration (v70→71), full data model plumbing (SiteSettingsModel,SiteSettingsInterface,WPComSiteSettings), and preference XMLSiteSettingsProviderinterface — injectable abstraction overSiteSettingsTablefor reading site settings and determining block editor default, replacing staticSiteUtilscallsEditorSettingsRepository+ThemeRepository— discovers editor settings / editor assets route support viaWpApiClient.apiRoot().get()and fetches the active theme to detect block theme support; results cached in per-siteAppPrefsMySiteViewModel.onResume()triggersfetchEditorCapabilitiesForSiteso results are available before the user opens Site Settings; failures show a snackbar when there's no cached data, otherwise fall back silentlyTest plan
Theme Style Tests:
Before testing, ensure that the following feature flags are enabled:
When the app is not signed into WP.com:
When the app is signed into WP.com:
Third-Party Blocks Tests:
Before testing, ensure that the following feature flags are enabled:
When the app is not signed into WP.com:
When the app is signed into WP.com: