Add GutenbergKit opt-in announcement and per-site override#22813
Draft
jkmassel wants to merge 1 commit into
Draft
Add GutenbergKit opt-in announcement and per-site override#22813jkmassel wants to merge 1 commit into
jkmassel wants to merge 1 commit into
Conversation
Collaborator
Generated by 🚫 Danger |
Contributor
|
|
Contributor
|
|
Contributor
🤖 Build Failure AnalysisThis build has failures. Claude has analyzed them - check the build annotations for details. |
71d2a8f to
24faca7
Compare
2130282 to
046f3cd
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk #22813 +/- ##
=======================================
Coverage 37.32% 37.32%
=======================================
Files 2320 2321 +1
Lines 124578 124651 +73
Branches 16926 16947 +21
=======================================
+ Hits 46498 46526 +28
- Misses 74319 74362 +43
- Partials 3761 3763 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
0c000b9 to
dcc7187
Compare
Introduces a one-time announcement bottom sheet, shown on the next WPMainActivity.onResume when the GutenbergKit remote feature is on, the current site already defaults to the block editor, and the announcement has not been shown before. The dialog's primary CTA sets an app-wide opt-in flag (UndeletablePrefKey, persists across logout); "Maybe later" dismisses without flipping it. Site Settings gains a per-site GutenbergKit toggle, gated on the same remote flag. The toggle is a tri-state override stored as two StringSets (opt-in / opt-out / follow global), letting a user pin a specific site on or off independent of the global opt-in. Resolution order in GutenbergKitFeatureChecker: kill switch beats everything; then siteOverride ?? globalOptIn ?? experimental ?? remote-feature decides. Threaded through EditorCapabilityResolver so Theme Styles and Third-Party Blocks visibility / application stays in agreement with whether the editor actually opens for the site.
dcc7187 to
3a28b0b
Compare
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.


Adds a one-time announcement bottom sheet that flips an app-wide GutenbergKit opt-in, plus a per-site tri-state override in Site Settings so a single site can be pinned on or off independently of the global flag.
Summary
GutenbergKitAnnouncementBottomSheetFragmentshown once per user onWPMainActivity.onResume, gated on the remotegutenberg_kitflag, a one-shot pref, a non-null current site, andSiteSettingsProvider.isBlockEditorDefault(site)(so Aztec users aren't pitched an editor they can't act on).GUTENBERG_KIT_USER_OPT_INinUndeletablePrefKeyso it survives logout; Maybe later just dismisses. Inline Learn more opens a support article viaWPWebViewActivity.StringSetprefs (GUTENBERG_KIT_OPT_IN_SITES,GUTENBERG_KIT_OPT_OUT_SITES) so absence cleanly means "follow global."siteOverride ?? globalOptIn, still subject to the existing experimental / remote-feature / kill-switch gates inGutenbergKitFeatureChecker.Changes
GutenbergKitAnnouncementBottomSheetFragment+gutenberg_kit_announcement_bottom_sheet.xml: New bottom sheet. Consumes top window insets so Material'sBottomSheetDialogdoesn't double-pad under the status bar. Inline Learn moreClickableSpanopens a web page viaWPWebViewActivity.WPMainActivityViewModel:checkAndShowGutenbergKitAnnouncement(site)— gated on remote flag,wasGutenbergKitAnnouncementShown, non-null site, andSiteSettingsProvider.isBlockEditorDefault(site). Replaces the deprecatedSiteUtils.isBlockEditorDefaultForNewPost(now@Deprecatedon trunk).WPMainActivity: Observes the announcement event and shows the fragment.GutenbergKitFeatureChecker:FeatureStatenow carriesisUserOptedIn+siteOverride: Boolean?;isGutenbergKitEnabled(site)andgetFeatureState(site)accept an optionalSiteModel.@JvmOverloadsfor Java interop.isGutenbergKitRemoteFeatureEnabled()exposed for opt-in surfaces.SiteSettingsFragment: New per-site toggle wired throughAppPrefs.setGutenbergKitSiteOverride/getGutenbergKitSiteOverride. Displayed checked =siteOverride ?? globalOptIn. Visibility gated by the remote flag.AppPrefs/AppPrefsWrapper: AddsGUTENBERG_KIT_USER_OPT_IN(undeletable),GUTENBERG_KIT_ANNOUNCEMENT_SHOWN(undeletable),GUTENBERG_KIT_OPT_IN_SITESandGUTENBERG_KIT_OPT_OUT_SITES(deletable). Javadoc'd.EditorCapabilityResolver: Passessitethrough the GBKit gate so Theme Styles and Third-Party Blocks resolve against the same per-site view the launcher uses — previously they only saw the global opt-in, so a site-level opt-in could open GBKit without those capabilities applied.EditorLauncher: Already site-aware viagetFeatureState(site); no behaviour change.Test plan
mobileEditor == "aztec"): announcement sheet does not appear.WPMainActivityViewModelTest,GutenbergKitFeatureCheckerTest,EditorCapabilityResolverTestpass.