Skip to content

Add per-site GutenbergKit opt-in and announcement bottom sheet#22813

Draft
jkmassel wants to merge 1 commit intotrunkfrom
jkmassel/gutenbergkit-opt-in
Draft

Add per-site GutenbergKit opt-in and announcement bottom sheet#22813
jkmassel wants to merge 1 commit intotrunkfrom
jkmassel/gutenbergkit-opt-in

Conversation

@jkmassel
Copy link
Copy Markdown
Contributor

Summary

  • Adds a one-time announcement bottom sheet that surfaces the upcoming GutenbergKit editor on app start, with Try it now / Maybe later and an inline Learn more link.
  • Adds a per-site Use new block editor toggle in Site Settings so users can opt in or out at any time.
  • Persists per-site opt-in state and a one-shot "announcement shown" flag in AppPrefs.
  • Routes opted-in sites into GutenbergKit from EditorLauncher.
  • Gated on the remote feature flag (isGutenbergKitRemoteFeatureEnabled) and suppressed for sites where the block editor isn't the default (via SiteUtils.isBlockEditorDefaultForNewPost).

Changes

  • GutenbergKitAnnouncementBottomSheetFragment + gutenberg_kit_announcement_bottom_sheet.xml: New bottom sheet. Consumes top window insets so Material's BottomSheetDialog doesn't double-pad under the status bar. Inline "Learn more" ClickableSpan opens a web page via WPWebViewActivity.
  • WPMainActivityViewModel: New checkAndShowGutenbergKitAnnouncement(site) — gated on remote flag, one-shot pref, non-null site, and SiteUtils.isBlockEditorDefaultForNewPost(site).
  • WPMainActivity: Observes the announcement event and shows the fragment.
  • GutenbergKitFeatureChecker: FeatureState now carries isEnabledForSite; getFeatureState / isGutenbergKitEnabled accept an optional SiteModel. @JvmOverloads added for Java interop. New isGutenbergKitRemoteFeatureEnabled() for opt-in surfaces.
  • SiteSettingsFragment: New preference wired to AppPrefsWrapper.isGutenbergKitEnabledForSite / setGutenbergKitEnabledForSite. Visibility gated by the remote flag.
  • AppPrefs / AppPrefsWrapper: Adds GUTENBERG_KIT_ANNOUNCEMENT_SHOWN and the per-site opt-in key.
  • EditorLauncher: Passes the current site into the feature check so the per-site opt-in is honored.

Test plan

  • Fresh install with remote flag on: launch app → announcement sheet appears once; tap Try it now → editor opens in GutenbergKit; sheet does not re-appear on next launch.
  • Maybe later dismisses without opting in; sheet does not re-appear.
  • Site Settings: toggling Use new block editor opts the current site in/out; survives app restart.
  • Site with block editor disabled (mobileEditor == "aztec"): announcement sheet does not appear.
  • Remote flag off: neither the announcement nor the Site Settings toggle appear.
  • Learn more inline link opens the web page.
  • Unit tests: WPMainActivityViewModelTest, GutenbergKitFeatureCheckerTest pass.

Surfaces the new GutenbergKit editor to users ahead of its default
rollout. Adds a one-time announcement bottom sheet on app start and a
per-site toggle in Site Settings to opt in or out. Gated on the remote
feature flag and skipped for sites where the block editor is disabled.
@dangermattic
Copy link
Copy Markdown
Collaborator

1 Warning
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Copy Markdown
Contributor

App Icon📲 You can test the changes from this Pull Request in WordPress Android by scanning the QR code below to install the corresponding build.

App NameWordPress Android
Build TypeDebug
Versionpr22813-f580ae7
Build Number1488
Application IDorg.wordpress.android.prealpha
Commitf580ae7
Installation URL0jn1hfng0s3kg
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Copy Markdown
Contributor

App Icon📲 You can test the changes from this Pull Request in Jetpack Android by scanning the QR code below to install the corresponding build.

App NameJetpack Android
Build TypeDebug
Versionpr22813-f580ae7
Build Number1488
Application IDcom.jetpack.android.prealpha
Commitf580ae7
Installation URL7fv05f7c1d25g
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Copy Markdown
Contributor

🤖 Build Failure Analysis

This build has failures. Claude has analyzed them - check the build annotations for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants