feat(android): gate block inserter media strip behind config flag#518
Merged
Conversation
Adds `EditorConfiguration.enableInserterMediaStrip` (defaulting to false) and threads it into `BlockPickerDialog` so the Photos + Camera strip is hidden until consumers opt in. The strip's tap callbacks are still inert pending the media hand-off to the JS editor, so hiding it by default keeps the no-op buttons out of sight for production consumers while leaving the surface available for testing. The demo app's SitePreparation screen gains a matching toggle, wired through `SitePreparationViewModel` and applied via the builder when constructing the editor configuration.
XCFramework BuildThis PR's XCFramework is available for testing. Add the following to your .package(url: "https://github.com/wordpress-mobile/GutenbergKit", branch: "pr-build/518")Built from e1fc8c9 |
adalpari
approved these changes
May 19, 2026
Contributor
adalpari
left a comment
There was a problem hiding this comment.
LGTM and works as expected!
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.
What?
Adds
EditorConfiguration.enableInserterMediaStrip(defaulting tofalse) and threads it intoBlockPickerDialog. When the flag is off — the new default — the Photos + Camera media strip is omitted from the native block inserter sheet, so the sheet renders the drag handle / header / category tabs / search / block grid without the strip in between.Why?
The media strip landed in #509 with intentionally inert tap callbacks: the picked URI / camera capture still needs to round-trip through
WebViewAssetLoaderbefore the JS editor canfetch()it. Until that hand-off lands, the no-op buttons shouldn't be visible to production consumers. Gating the strip behind a config flag (off by default) keeps the surface available for testing while hiding it from anyone who opts in to the native inserter today.Landing the remaining photo picker functionality will take some time, and isn't on the critical path to shipping the editor. It can land in a future release once it's had more time to bake.
How?
EditorConfiguration: newenableInserterMediaStrip: Boolean = falsefield with matchingBuilder.setEnableInserterMediaStrip(...),toBuilder()round-trip, equals/hashCode coverage.BlockPickerDialog: takes ashowMediaStrip: Booleanconstructor arg and threads it throughBlockPickerSheet→SheetContent, where theMediaStrip()call is wrapped inif (showMediaStrip).GutenbergView.presentBlockInserter: passesconfiguration.enableInserterMediaStripinto the dialog.SitePreparationActivity's feature card (disabled unless "Enable Native Inserter" is on) and wires it throughSitePreparationViewModel.buildConfiguration.EditorConfigurationBuilderTestwith default, setter,toBuilderround-trip, equality, and full-config assertions for the new field.The flag intentionally stays Kotlin-side — the MediaStrip is a native Compose composable, so there's no need to propagate it through
GBKitGlobalto the JS editor.Testing Instructions
make test-android.Accessibility Testing Instructions
No new UI surfaces. When the strip is hidden, TalkBack focus moves from the header's Close button straight to the first category tab; when it is shown, focus order is unchanged from the existing implementation.