From 1e5a5f4280e24d3cc6e68ce14262cc9aa69ad2dc Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Wed, 22 Oct 2025 16:38:09 -0400 Subject: [PATCH 1/9] feat: Relocate editor use theme styles preference to site settings This is a more appropriate long-term location rather than experimental features. --- .../java/org/wordpress/android/WordPressDB.java | 5 ++++- .../android/models/SiteSettingsModel.java | 8 ++++++++ .../android/ui/posts/GutenbergKitActivity.kt | 4 +--- .../android/ui/posts/GutenbergKitWarmupHelper.kt | 5 ++--- .../android/ui/prefs/SiteSettingsFragment.java | 15 ++++++++++++++- .../android/ui/prefs/SiteSettingsInterface.java | 8 ++++++++ WordPress/src/main/res/values/key_strings.xml | 1 + WordPress/src/main/res/values/strings.xml | 2 ++ WordPress/src/main/res/xml/site_settings.xml | 6 ++++++ 9 files changed, 46 insertions(+), 8 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/WordPressDB.java b/WordPress/src/main/java/org/wordpress/android/WordPressDB.java index cdd5a69209f9..1b5e7f751d83 100755 --- a/WordPress/src/main/java/org/wordpress/android/WordPressDB.java +++ b/WordPress/src/main/java/org/wordpress/android/WordPressDB.java @@ -22,7 +22,7 @@ import java.io.OutputStream; public class WordPressDB { - private static final int DATABASE_VERSION = 69; + private static final int DATABASE_VERSION = 70; // Warning renaming DATABASE_NAME could break previous App backups (see: xml/backup_scheme.xml) @@ -184,6 +184,9 @@ public WordPressDB(Context ctx) { // so the table creation depended on that screen being opened. Now that we need this table in other // places, we have to be sure the table exists even if PublicizeListActivity was never opened. PublicizeTable.createTables(mDb); + case 69: + // add editor theme styles site setting + mDb.execSQL(SiteSettingsModel.ADD_USE_THEME_STYLES); } mDb.setVersion(DATABASE_VERSION); } diff --git a/WordPress/src/main/java/org/wordpress/android/models/SiteSettingsModel.java b/WordPress/src/main/java/org/wordpress/android/models/SiteSettingsModel.java index 7d47715cf0a5..106d1a3a7473 100644 --- a/WordPress/src/main/java/org/wordpress/android/models/SiteSettingsModel.java +++ b/WordPress/src/main/java/org/wordpress/android/models/SiteSettingsModel.java @@ -69,6 +69,7 @@ public class SiteSettingsModel { private static final String AMP_ENABLED_COLUMN_NAME = "ampEnabled"; private static final String JETPACK_SEARCH_SUPPORTED_COLUMN_NAME = "jetpackSearchSupported"; private static final String JETPACK_SEARCH_ENABLED_COLUMN_NAME = "jetpackSearchEnabled"; + private static final String USE_THEME_STYLES_COLUMN_NAME = "useThemeStyles"; public static final String SETTINGS_TABLE_NAME = "site_settings"; @@ -104,6 +105,8 @@ public class SiteSettingsModel { + " add " + JETPACK_SEARCH_SUPPORTED_COLUMN_NAME + " BOOLEAN;"; public static final String ADD_SITE_ICON = "alter table " + SETTINGS_TABLE_NAME + " add " + SITE_ICON_COLUMN_NAME + " INTEGER;"; + public static final String ADD_USE_THEME_STYLES = "alter table " + SETTINGS_TABLE_NAME + + " add " + USE_THEME_STYLES_COLUMN_NAME + " BOOLEAN DEFAULT 1;"; public static final String CREATE_SETTINGS_TABLE_SQL = "CREATE TABLE IF NOT EXISTS " @@ -194,6 +197,7 @@ public class SiteSettingsModel { public boolean ampEnabled; public boolean jetpackSearchSupported; public boolean jetpackSearchEnabled; + public boolean useThemeStyles = true; public String quotaDiskSpace; @Override @@ -238,6 +242,7 @@ && equals(timezone, otherModel.timezone) && ampSupported == otherModel.ampSupported && jetpackSearchEnabled == otherModel.jetpackSearchEnabled && jetpackSearchSupported == otherModel.jetpackSearchSupported + && useThemeStyles == otherModel.useThemeStyles && maxLinks == otherModel.maxLinks && equals(defaultPostFormat, otherModel.defaultPostFormat) && holdForModeration != null @@ -303,6 +308,7 @@ public void copyFrom(SiteSettingsModel other) { ampEnabled = other.ampEnabled; jetpackSearchSupported = other.jetpackSearchSupported; jetpackSearchEnabled = other.jetpackSearchEnabled; + useThemeStyles = other.useThemeStyles; if (other.holdForModeration != null) { holdForModeration = new ArrayList<>(other.holdForModeration); } @@ -367,6 +373,7 @@ public void deserializeOptionsDatabaseCursor(Cursor cursor, SparseArrayCompatwp_pref_site_default_image_quality wp_pref_key_optimize_video wp_pref_key_gutenberg_default_for_new_posts + wp_pref_key_use_theme_styles wp_pref_site_default_video_width wp_pref_site_default_encoder_bitrate wp_pref_site_discussion diff --git a/WordPress/src/main/res/values/strings.xml b/WordPress/src/main/res/values/strings.xml index 7da1edbadeb8..535b8e61c722 100644 --- a/WordPress/src/main/res/values/strings.xml +++ b/WordPress/src/main/res/values/strings.xml @@ -702,6 +702,8 @@ Your WordPress.com site supports the use of Accelerated Mobile Pages, a Google-led initiative that dramatically speeds up loading times on mobile devices Use Block Editor Edit new posts and pages with the block editor + Use Theme Styles + Make the block editor look like your theme Password updated To reconnect the app to your self-hosted site, enter the site\'s new password here. Homepage Settings diff --git a/WordPress/src/main/res/xml/site_settings.xml b/WordPress/src/main/res/xml/site_settings.xml index e86f76632c9a..58339f49b6bb 100644 --- a/WordPress/src/main/res/xml/site_settings.xml +++ b/WordPress/src/main/res/xml/site_settings.xml @@ -132,6 +132,12 @@ android:summary="@string/site_settings_gutenberg_default_for_new_posts_summary" android:title="@string/site_settings_gutenberg_default_for_new_posts" /> + + From dbe5942dc7616f314c5949bae4cb8e30226f9c92 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Wed, 22 Oct 2025 16:38:53 -0400 Subject: [PATCH 2/9] task: Remove unused experimental feature: editor theme styles --- .../ui/prefs/experimentalfeatures/ExperimentalFeatures.kt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/prefs/experimentalfeatures/ExperimentalFeatures.kt b/WordPress/src/main/java/org/wordpress/android/ui/prefs/experimentalfeatures/ExperimentalFeatures.kt index 5299031c02f5..5728476b6ddf 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/prefs/experimentalfeatures/ExperimentalFeatures.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/prefs/experimentalfeatures/ExperimentalFeatures.kt @@ -30,11 +30,6 @@ class ExperimentalFeatures @Inject constructor( R.string.experimental_block_editor, R.string.experimental_block_editor_description ), - EXPERIMENTAL_BLOCK_EDITOR_THEME_STYLES( - "experimental_block_editor_theme_styles", - R.string.experimental_block_editor_theme_styles, - R.string.experimental_block_editor_theme_styles_description - ), EXPERIMENTAL_APPLICATION_PASSWORD_FEATURE( "experimental_application_password_feature", R.string.experimental_application_password_feature, From 88f614960f28b653ed6d5268b607d0b5c1d73594 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Wed, 22 Oct 2025 16:47:09 -0400 Subject: [PATCH 3/9] fix: Toggle theme styles preference via GutenbergKit status This preference only impacts GutenbergKit. --- .../wordpress/android/ui/prefs/SiteSettingsFragment.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/prefs/SiteSettingsFragment.java b/WordPress/src/main/java/org/wordpress/android/ui/prefs/SiteSettingsFragment.java index 54f23fba8b08..7d1a0c031c25 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/prefs/SiteSettingsFragment.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/prefs/SiteSettingsFragment.java @@ -81,6 +81,7 @@ import org.wordpress.android.ui.bloggingreminders.BloggingRemindersViewModel; import org.wordpress.android.ui.jetpackoverlay.JetpackFeatureRemovalPhaseHelper; import org.wordpress.android.ui.plans.PlansConstants; +import org.wordpress.android.ui.posts.GutenbergKitFeatureChecker; import org.wordpress.android.ui.prefs.EditTextPreferenceWithValidation.ValidationType; import org.wordpress.android.ui.prefs.SiteSettingsFormatDialog.FormatType; import org.wordpress.android.ui.prefs.homepage.HomepageSettingsDialog; @@ -193,6 +194,7 @@ public class SiteSettingsFragment extends PreferenceFragment @Inject UiHelpers mUiHelpers; @Inject JetpackFeatureRemovalPhaseHelper mJetpackFeatureRemovalPhaseHelper; @Inject BloggingPromptsSettingsHelper mPromptsSettingsHelper; + @Inject GutenbergKitFeatureChecker mGutenbergKitFeatureChecker; private BloggingRemindersViewModel mBloggingRemindersViewModel; @@ -1077,8 +1079,8 @@ public void initPreferences() { WPPrefUtils.removePreference(this, R.string.pref_key_homepage, R.string.pref_key_homepage_settings); } - // hide theme styles preference if block editor is not enabled - if (!SiteUtils.isBlockEditorDefaultForNewPost(mSite)) { + // hide theme styles preference if GutenbergKit is not enabled + if (!mGutenbergKitFeatureChecker.isGutenbergKitEnabled()) { WPPrefUtils.removePreference(this, R.string.pref_key_site_editor, R.string.pref_key_use_theme_styles); } From dec5d8ad7394c9cf052571e8481772bf9384e9d7 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Wed, 22 Oct 2025 17:00:32 -0400 Subject: [PATCH 4/9] fix: Avoid removing the theme styles preference for WPCOM Simple sites The theme styles preference shares a parent preference section with the toggle for enabling the block editor. --- .../org/wordpress/android/ui/prefs/SiteSettingsFragment.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/prefs/SiteSettingsFragment.java b/WordPress/src/main/java/org/wordpress/android/ui/prefs/SiteSettingsFragment.java index 7d1a0c031c25..fbb82329285e 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/prefs/SiteSettingsFragment.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/prefs/SiteSettingsFragment.java @@ -2168,8 +2168,6 @@ private void removeNonWPComPreferences() { private void removeEditorPreferences() { WPPrefUtils.removePreference(this, R.string.pref_key_site_editor, R.string.pref_key_gutenberg_default_for_new_posts); - WPPrefUtils.removePreference(this, R.string.pref_key_site_screen, - R.string.pref_key_site_editor); } private void removeCategoriesPreference() { From 45145e829685cbfb0e4e270ba75cf97d4315db17 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Wed, 22 Oct 2025 17:19:40 -0400 Subject: [PATCH 5/9] fix: Preserve local theme styles settings The value is not tracked on the server, nor returned by the API response. --- .../java/org/wordpress/android/ui/prefs/WPComSiteSettings.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/prefs/WPComSiteSettings.java b/WordPress/src/main/java/org/wordpress/android/ui/prefs/WPComSiteSettings.java index 0c0fe096605d..beba14352ea5 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/prefs/WPComSiteSettings.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/prefs/WPComSiteSettings.java @@ -181,9 +181,11 @@ public void onResponse(JSONObject response) { // Local settings boolean location = mSettings.location; + boolean useThemeStyles = mSettings.useThemeStyles; mSettings.copyFrom(mRemoteSettings); mSettings.postFormats = currentPostFormats; mSettings.location = location; + mSettings.useThemeStyles = useThemeStyles; SiteSettingsTable.saveSettings(mSettings); } From 20cb6494ebc6115dba1c135056a1d0ca992f3f1f Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Wed, 22 Oct 2025 21:55:00 -0400 Subject: [PATCH 6/9] refactor: Address lint warnings --- .../org/wordpress/android/ui/posts/GutenbergKitActivity.kt | 2 -- .../org/wordpress/android/ui/posts/GutenbergKitWarmupHelper.kt | 3 --- 2 files changed, 5 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/posts/GutenbergKitActivity.kt b/WordPress/src/main/java/org/wordpress/android/ui/posts/GutenbergKitActivity.kt index d847756b23c4..5b5e1a9c50ad 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/posts/GutenbergKitActivity.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/posts/GutenbergKitActivity.kt @@ -169,10 +169,8 @@ import org.wordpress.android.ui.posts.reactnative.ReactNativeRequestHandler import org.wordpress.android.ui.posts.sharemessage.EditJetpackSocialShareMessageActivity import org.wordpress.android.ui.posts.sharemessage.EditJetpackSocialShareMessageActivity.Companion.createIntent import org.wordpress.android.ui.prefs.AppPrefs -import org.wordpress.android.ui.prefs.experimentalfeatures.ExperimentalFeatures.Feature import org.wordpress.android.ui.prefs.SiteSettingsInterface import org.wordpress.android.ui.prefs.SiteSettingsInterface.SiteSettingsListener -import org.wordpress.android.ui.prefs.experimentalfeatures.ExperimentalFeatures import org.wordpress.android.ui.reader.utils.ReaderUtilsWrapper import org.wordpress.android.ui.suggestion.SuggestionActivity import org.wordpress.android.ui.suggestion.SuggestionType diff --git a/WordPress/src/main/java/org/wordpress/android/ui/posts/GutenbergKitWarmupHelper.kt b/WordPress/src/main/java/org/wordpress/android/ui/posts/GutenbergKitWarmupHelper.kt index 7b793345f94e..f84f326fb1f7 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/posts/GutenbergKitWarmupHelper.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/posts/GutenbergKitWarmupHelper.kt @@ -8,8 +8,6 @@ import org.wordpress.android.fluxc.model.SiteModel import org.wordpress.android.fluxc.network.UserAgent import org.wordpress.android.fluxc.store.AccountStore import org.wordpress.android.modules.BG_THREAD -import org.wordpress.android.ui.prefs.experimentalfeatures.ExperimentalFeatures -import org.wordpress.android.ui.prefs.experimentalfeatures.ExperimentalFeatures.Feature import org.wordpress.android.util.AppLog import org.wordpress.android.util.AppLog.T import org.wordpress.android.util.PerAppLocaleManager @@ -33,7 +31,6 @@ class GutenbergKitWarmupHelper @Inject constructor( private val perAppLocaleManager: PerAppLocaleManager, private val gutenbergKitFeatureChecker: GutenbergKitFeatureChecker, private val gutenbergKitPluginsFeature: GutenbergKitPluginsFeature, - private val experimentalFeatures: ExperimentalFeatures, @Named(BG_THREAD) private val bgDispatcher: CoroutineDispatcher ) { private var lastWarmedUpSiteId: Long? = null From 029082a186a852f95ef2ca6430a74f0c875c9f1b Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Wed, 22 Oct 2025 22:11:38 -0400 Subject: [PATCH 7/9] refactor: Remove lingering theme styles experimental feature references --- WordPress/src/main/res/values/strings.xml | 2 -- .../experimentalfeatures/ExperimentalFeaturesViewModelTest.kt | 3 --- 2 files changed, 5 deletions(-) diff --git a/WordPress/src/main/res/values/strings.xml b/WordPress/src/main/res/values/strings.xml index 535b8e61c722..dd506731f4ce 100644 --- a/WordPress/src/main/res/values/strings.xml +++ b/WordPress/src/main/res/values/strings.xml @@ -973,8 +973,6 @@ Experimental block editor will become the default in a future release and the ability to disable it will be removed. Experimental block editor Access additional block types and settings - Experimental block editor styles - Apply theme styles to the editor Experimental block editor plugins Share feedback Are you willing to share feedback on the experimental editor? diff --git a/WordPress/src/test/java/org/wordpress/android/ui/prefs/experimentalfeatures/ExperimentalFeaturesViewModelTest.kt b/WordPress/src/test/java/org/wordpress/android/ui/prefs/experimentalfeatures/ExperimentalFeaturesViewModelTest.kt index f56546c04cd4..e07435afedd9 100644 --- a/WordPress/src/test/java/org/wordpress/android/ui/prefs/experimentalfeatures/ExperimentalFeaturesViewModelTest.kt +++ b/WordPress/src/test/java/org/wordpress/android/ui/prefs/experimentalfeatures/ExperimentalFeaturesViewModelTest.kt @@ -69,14 +69,12 @@ class ExperimentalFeaturesViewModelTest : BaseUnitTest() { @Test fun `init loads enabled state from experimental features`() = test { whenever(experimentalFeatures.isEnabled(Feature.EXPERIMENTAL_BLOCK_EDITOR)).thenReturn(true) - whenever(experimentalFeatures.isEnabled(Feature.EXPERIMENTAL_BLOCK_EDITOR_THEME_STYLES)).thenReturn(false) createViewModel() val states = viewModel.switchStates.value assertThat(states[Feature.EXPERIMENTAL_BLOCK_EDITOR]).isTrue() - assertThat(states[Feature.EXPERIMENTAL_BLOCK_EDITOR_THEME_STYLES]).isFalse() } @Test @@ -145,7 +143,6 @@ class ExperimentalFeaturesViewModelTest : BaseUnitTest() { @Test fun `state flow emits correct initial state`() = test { whenever(experimentalFeatures.isEnabled(Feature.EXPERIMENTAL_BLOCK_EDITOR)).thenReturn(true) - whenever(experimentalFeatures.isEnabled(Feature.EXPERIMENTAL_BLOCK_EDITOR_THEME_STYLES)).thenReturn(false) createViewModel() From 9d08da3c892a97e24f2cffbb5cc007b9608cd789 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Wed, 22 Oct 2025 22:31:03 -0400 Subject: [PATCH 8/9] refactor: Address lint warnings and build errors --- .../org/wordpress/android/ui/posts/GutenbergKitActivity.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/posts/GutenbergKitActivity.kt b/WordPress/src/main/java/org/wordpress/android/ui/posts/GutenbergKitActivity.kt index 5b5e1a9c50ad..3c056bd60280 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/posts/GutenbergKitActivity.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/posts/GutenbergKitActivity.kt @@ -376,9 +376,7 @@ class GutenbergKitActivity : BaseAppCompatActivity(), EditorImageSettingsListene @Inject lateinit var postConflictResolutionFeatureConfig: PostConflictResolutionFeatureConfig - @Inject lateinit var gutenbergKitFeature: GutenbergKitFeature @Inject lateinit var gutenbergKitPluginsFeature: GutenbergKitPluginsFeature - @Inject lateinit var experimentalFeatures: ExperimentalFeatures @Inject lateinit var activityNavigator: ActivityNavigator @@ -2277,7 +2275,7 @@ class GutenbergKitActivity : BaseAppCompatActivity(), EditorImageSettingsListene val featureConfig = GutenbergKitSettingsBuilder.FeatureConfig( isPluginsFeatureEnabled = gutenbergKitPluginsFeature.isEnabled(), - isThemeStylesFeatureEnabled = siteSettings?.getUseThemeStyles() ?: true + isThemeStylesFeatureEnabled = siteSettings?.useThemeStyles ?: true ) val appConfig = GutenbergKitSettingsBuilder.AppConfig( From 00afd4029ae6c856e809593ef683a0082ed29622 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Wed, 22 Oct 2025 22:42:12 -0400 Subject: [PATCH 9/9] refactor: Remove unused import --- .../java/org/wordpress/android/ui/posts/GutenbergKitActivity.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/posts/GutenbergKitActivity.kt b/WordPress/src/main/java/org/wordpress/android/ui/posts/GutenbergKitActivity.kt index 3c056bd60280..86eea8ad6b5c 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/posts/GutenbergKitActivity.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/posts/GutenbergKitActivity.kt @@ -206,7 +206,6 @@ import org.wordpress.android.util.analytics.AnalyticsTrackerWrapper import org.wordpress.android.util.analytics.AnalyticsUtils import org.wordpress.android.util.analytics.AnalyticsUtils.BlockEditorEnabledSource import org.wordpress.android.util.config.ContactSupportFeatureConfig -import org.wordpress.android.util.config.GutenbergKitFeature import org.wordpress.android.util.config.GutenbergKitPluginsFeature import org.wordpress.android.util.config.PostConflictResolutionFeatureConfig import org.wordpress.android.util.extensions.setLiftOnScrollTargetViewIdAndRequestLayout