Skip to content

feat(android): add enableNativeBlockInserter feature flag#464

Draft
jkmassel wants to merge 2 commits intojkmassel/block-picker-modelsfrom
jkmassel/block-picker-flag
Draft

feat(android): add enableNativeBlockInserter feature flag#464
jkmassel wants to merge 2 commits intojkmassel/block-picker-modelsfrom
jkmassel/block-picker-flag

Conversation

@jkmassel
Copy link
Copy Markdown
Contributor

@jkmassel jkmassel commented Apr 22, 2026

Summary

Second of three stacked PRs for the native block inserter. Adds EditorConfiguration.setEnableNativeBlockInserter(Boolean) and propagates the flag to GBKitGlobal so the web editor can decide whether to delegate inserter UI to the host. Defaults to false, so existing consumers keep the web-based inserter until they opt in.

Demo app wires the existing "Enable Native Inserter" toggle to the new setter, replacing the // TODO placeholder.

No UI is rendered by turning the flag on alone — it suppresses the web inserter and dispatches showBlockInserter to the native bridge (dispatch wiring added in #463). The native handler lands in #461.

Test plan

  • ./gradlew :Gutenberg:compileDebugKotlin :app:compileDebugKotlin :Gutenberg:test detekt — BUILD SUCCESSFUL

Related

Second of three stacked PRs:

@github-actions github-actions Bot added the [Type] Enhancement A suggestion for improvement. label Apr 22, 2026
@jkmassel jkmassel marked this pull request as draft April 22, 2026 23:13
New `EditorConfiguration.setEnableNativeBlockInserter(Boolean)` builder
setter + propagation through `GBKitGlobal` to the JS global. Defaults
to false, so existing consumers keep the web-based inserter until they
opt in.

Demo app wires the existing "Enable Native Inserter" toggle to the new
setter, replacing the `// TODO` placeholder.

No UI is rendered by turning the flag on alone — it suppresses the web
inserter and dispatches `showBlockInserter` to the native bridge. The
native handler lands in a follow-up PR.
@jkmassel jkmassel force-pushed the jkmassel/block-picker-models branch from 5b56302 to e0a3843 Compare April 22, 2026 23:38
@jkmassel jkmassel force-pushed the jkmassel/block-picker-flag branch from a11c583 to 32e096e Compare April 22, 2026 23:38
… gaps

Adds EditorConfiguration tests for the new `enableNativeBlockInserter`
flag (defaults, setter, toBuilder round-trip, equals/hashCode inequality,
full-config) and fills pre-existing gaps by asserting hashCode inequality
on every per-field "not equal" test.

Also adds GBKitGlobal propagation tests for enableNativeBlockInserter and
previously-untested pass-through fields (hideTitle, locale with null
fallback, enableNetworkLogging, authHeader, postStatus, siteApiNamespace,
namespaceExcludedPaths). Extends the JSON round-trip test to cover the
new boolean flags.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant