Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
701b05f
Bump GutenbergKit to v0.13.2
jkmassel Feb 6, 2026
3ff57a6
Remove old EditorConfigurationBuilder and GutenbergKitWarmupHelper
jkmassel Feb 6, 2026
03803c6
Simplify GutenbergKitSettingsBuilder API
jkmassel Feb 6, 2026
4b8a3a4
Refactor GutenbergKitActivity editor configuration
jkmassel Feb 6, 2026
7dfbd59
Add GutenbergEditorPreloader for background dependency fetching
jkmassel Feb 6, 2026
c011476
Inject GutenbergEditorPreloader into GutenbergKitEditorFragment
jkmassel Feb 6, 2026
20bc902
Align usage with GBKit changes
jkmassel Feb 9, 2026
5ed5834
Add Theme / Editor Settings repos
jkmassel Feb 9, 2026
f9938de
Simplify preloading for debugging
jkmassel Feb 10, 2026
c6ff4c9
fix: Pass null post ID for local drafts in GutenbergKit (#22580)
dcalhoun Feb 10, 2026
883eb04
Remove unused code from ThemeRepository, EditorDependencyStore, and G…
jkmassel Feb 10, 2026
470d1c5
Add siteSupportsEditorSettings preference to AppPrefs and AppPrefsWra…
jkmassel Feb 10, 2026
fc6e23e
Fix EditorSettingsRepository and add detailed logging
jkmassel Feb 10, 2026
754cca6
Convert GutenbergKitSettingsBuilder from object to injectable class
jkmassel Feb 10, 2026
bab37b1
Fetch editor settings during preloading and use preloaded dependencies
jkmassel Feb 10, 2026
5a07d20
Add editor assets support check and use SiteModel for pref APIs
jkmassel Feb 10, 2026
5560b6c
Add theme block style detection and site settings UI
jkmassel Feb 10, 2026
a056ed6
Use site's "Use Theme Styles" setting for editor configuration
jkmassel Feb 10, 2026
dc9f058
Add "Use Third-Party Blocks" site setting for editor plugin support
jkmassel Feb 10, 2026
81441fa
Add WP.com simple site support to WpApiClient
jkmassel Feb 11, 2026
d6044b9
Build editor assets endpoint for self-hosted sites
jkmassel Feb 11, 2026
e372a10
Fix deprecation warning
jkmassel Feb 11, 2026
26fbb8b
Stabilize Editor Preloader
jkmassel Feb 11, 2026
bf71abb
Use firstOrNull() in ThemeRepository to avoid crash on empty response
jkmassel Feb 11, 2026
484e3b3
Fix cursor leak and test compile errors in GutenbergKitSettingsBuilder
jkmassel Feb 11, 2026
c7068ef
Add isLoadingMore to LaunchedEffect keys in ObserveLoadMore
jkmassel Feb 11, 2026
8aaa5f7
Add `ThemeRepositoryTest`
jkmassel Feb 11, 2026
e219c7f
Extract SiteSettingsProvider interface for testability
jkmassel Feb 11, 2026
af3039c
Extract shouldPreload method in GutenbergEditorPreloader
jkmassel Feb 11, 2026
18d8baa
Clean up EditorDependencyStore and WpApiClientProvider
jkmassel Feb 11, 2026
11fca9d
Remove EditorDependencyStore and inline into GutenbergEditorPreloader
jkmassel Feb 11, 2026
d18dab2
Refactor GutenbergEditorPreloader for multi-site caching
jkmassel Feb 11, 2026
103ef61
Pass SiteModel through GutenbergKitEditorFragment.newInstance
jkmassel Feb 11, 2026
07b3d6b
Remove unused SiteSettingsModel import from test
jkmassel Feb 11, 2026
f55ad97
Move isBlockEditorDefault into SiteSettingsProvider
jkmassel Feb 11, 2026
8fbcc84
Extract EditorServiceProvider to make preloader testable
jkmassel Feb 11, 2026
d4715d6
Add GutenbergEditorPreloaderTest
jkmassel Feb 11, 2026
4e756c4
Replace mock<ThemeWithEditContext> with real data class instance
jkmassel Feb 11, 2026
ed26a2b
Add SiteSettingsProviderImplTest
jkmassel Feb 11, 2026
85dc17c
Replace mock EditorDependencies with real data class instance
jkmassel Feb 11, 2026
defe1c7
Update GutenbergKit to integrate/wp-android branch
jkmassel Feb 11, 2026
2218b4c
work-in-progress
jkmassel Mar 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.io.OutputStream;

public class WordPressDB {
private static final int DATABASE_VERSION = 70;
private static final int DATABASE_VERSION = 71;


// Warning renaming DATABASE_NAME could break previous App backups (see: xml/backup_scheme.xml)
Expand Down Expand Up @@ -184,9 +184,12 @@
// 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:

Check failure on line 187 in WordPress/src/main/java/org/wordpress/android/WordPressDB.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

End this switch case with an unconditional break, return or throw statement.

See more on https://sonarcloud.io/project/issues?id=wordpress-mobile_WordPress-Android&issues=AZ0O3k4X9n3_gm6Y9liE&open=AZ0O3k4X9n3_gm6Y9liE&pullRequest=22579
// add editor theme styles site setting
mDb.execSQL(SiteSettingsModel.ADD_USE_THEME_STYLES);
case 70:
// add third-party blocks setting
mDb.execSQL(SiteSettingsModel.ADD_USE_THIRD_PARTY_BLOCKS);
}
mDb.setVersion(DATABASE_VERSION);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.wordpress.android.datasets

import org.wordpress.android.fluxc.model.SiteModel
import org.wordpress.android.models.SiteSettingsModel

/**
* Provides site-level settings for a given [SiteModel].
*/
interface SiteSettingsProvider {
fun getSettings(site: SiteModel): SiteSettingsModel?
fun isBlockEditorDefault(site: SiteModel): Boolean
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package org.wordpress.android.datasets

import org.wordpress.android.fluxc.model.SiteModel
import org.wordpress.android.models.SiteSettingsModel
import javax.inject.Inject
import javax.inject.Singleton

@Singleton
class SiteSettingsProviderImpl @Inject constructor() :
SiteSettingsProvider {
override fun getSettings(site: SiteModel): SiteSettingsModel? {
val cursor = SiteSettingsTable.getSettings(site.id.toLong())
?: return null
return cursor.use {
if (it.moveToFirst()) {
SiteSettingsModel().also { model ->
model.deserializeOptionsDatabaseCursor(it, null)
}
} else {
null
}
}
}

override fun isBlockEditorDefault(site: SiteModel): Boolean {
val editor = site.mobileEditor
if (editor.isNullOrEmpty()) return true
val isWpComSimple = site.isWPCom && !site.isWPComAtomic
return isWpComSimple || editor == GUTENBERG_EDITOR_NAME
}

private companion object {
const val GUTENBERG_EDITOR_NAME = "gutenberg"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
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";
private static final String USE_THIRD_PARTY_BLOCKS_COLUMN_NAME = "useThirdPartyBlocks";

public static final String SETTINGS_TABLE_NAME = "site_settings";

Expand Down Expand Up @@ -107,6 +108,9 @@
+ " 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 ADD_USE_THIRD_PARTY_BLOCKS = "alter table " + SETTINGS_TABLE_NAME
+ " add " + USE_THIRD_PARTY_BLOCKS_COLUMN_NAME
+ " BOOLEAN DEFAULT 0;";

public static final String CREATE_SETTINGS_TABLE_SQL =
"CREATE TABLE IF NOT EXISTS "
Expand Down Expand Up @@ -198,6 +202,7 @@
public boolean jetpackSearchSupported;
public boolean jetpackSearchEnabled;
public boolean useThemeStyles = true;
public boolean useThirdPartyBlocks = false;

Check warning on line 205 in WordPress/src/main/java/org/wordpress/android/models/SiteSettingsModel.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make useThirdPartyBlocks a static final constant or non-public and provide accessors if needed.

See more on https://sonarcloud.io/project/issues?id=wordpress-mobile_WordPress-Android&issues=AZ0O3k4A9n3_gm6Y9liD&open=AZ0O3k4A9n3_gm6Y9liD&pullRequest=22579
public String quotaDiskSpace;

@Override
Expand Down Expand Up @@ -243,6 +248,7 @@
&& jetpackSearchEnabled == otherModel.jetpackSearchEnabled
&& jetpackSearchSupported == otherModel.jetpackSearchSupported
&& useThemeStyles == otherModel.useThemeStyles
&& useThirdPartyBlocks == otherModel.useThirdPartyBlocks
&& maxLinks == otherModel.maxLinks
&& equals(defaultPostFormat, otherModel.defaultPostFormat)
&& holdForModeration != null
Expand Down Expand Up @@ -309,6 +315,7 @@
jetpackSearchSupported = other.jetpackSearchSupported;
jetpackSearchEnabled = other.jetpackSearchEnabled;
useThemeStyles = other.useThemeStyles;
useThirdPartyBlocks = other.useThirdPartyBlocks;
if (other.holdForModeration != null) {
holdForModeration = new ArrayList<>(other.holdForModeration);
}
Expand Down Expand Up @@ -374,6 +381,7 @@
jetpackSearchSupported = getBooleanFromCursor(cursor, JETPACK_SEARCH_SUPPORTED_COLUMN_NAME);
jetpackSearchEnabled = getBooleanFromCursor(cursor, JETPACK_SEARCH_ENABLED_COLUMN_NAME);
useThemeStyles = getBooleanFromCursor(cursor, USE_THEME_STYLES_COLUMN_NAME);
useThirdPartyBlocks = getBooleanFromCursor(cursor, USE_THIRD_PARTY_BLOCKS_COLUMN_NAME);

String moderationKeys = getStringFromCursor(cursor, MODERATION_KEYS_COLUMN_NAME);
String denylistKeys = getStringFromCursor(cursor, DENYLIST_KEYS_COLUMN_NAME);
Expand Down Expand Up @@ -467,6 +475,7 @@
values.put(JETPACK_SEARCH_SUPPORTED_COLUMN_NAME, jetpackSearchSupported);
values.put(JETPACK_SEARCH_ENABLED_COLUMN_NAME, jetpackSearchEnabled);
values.put(USE_THEME_STYLES_COLUMN_NAME, useThemeStyles);
values.put(USE_THIRD_PARTY_BLOCKS_COLUMN_NAME, useThirdPartyBlocks);

StringBuilder moderationKeys = new StringBuilder();
if (holdForModeration != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
import org.wordpress.android.ui.posts.AddCategoryFragment;
import org.wordpress.android.ui.posts.EditPostActivity;
import org.wordpress.android.ui.posts.GutenbergKitActivity;
import org.wordpress.android.ui.posts.editor.GutenbergKitEditorFragment;
import org.wordpress.android.ui.posts.EditPostPublishSettingsFragment;
import org.wordpress.android.ui.posts.EditPostSettingsFragment;
import org.wordpress.android.ui.posts.HistoryListFragment;
Expand Down Expand Up @@ -257,6 +258,8 @@ public interface AppComponent {

void inject(GutenbergKitActivity object);

void inject(GutenbergKitEditorFragment object);

void inject(EditPostSettingsFragment object);

void inject(PostSettingsListDialogFragment object);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import org.wordpress.android.datasets.SiteSettingsProvider
import org.wordpress.android.datasets.SiteSettingsProviderImpl
import org.wordpress.android.ui.posts.EditorServiceProvider
import org.wordpress.android.ui.posts.EditorServiceProviderImpl
import org.wordpress.android.ui.posts.IPostFreshnessChecker
import org.wordpress.android.ui.posts.PostFreshnessCheckerImpl
import javax.inject.Singleton
Expand All @@ -13,5 +17,18 @@ import javax.inject.Singleton
class PostModule {
@Singleton
@Provides
fun providePostFreshnessChecker(): IPostFreshnessChecker = PostFreshnessCheckerImpl()
fun providePostFreshnessChecker(): IPostFreshnessChecker =
PostFreshnessCheckerImpl()

@Singleton
@Provides
fun provideSiteSettingsProvider(
impl: SiteSettingsProviderImpl
): SiteSettingsProvider = impl

@Singleton
@Provides
fun provideEditorServiceProvider(
impl: EditorServiceProviderImpl
): EditorServiceProvider = impl
}
Loading
Loading