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.34% 37.34% -0.01%
==========================================
Files 2320 2321 +1
Lines 124653 124728 +75
Branches 16941 16962 +21
==========================================
+ Hits 46549 46576 +27
- Misses 74339 74385 +46
- Partials 3765 3767 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
3a28b0b to
b87371c
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.
b87371c to
2bfdd30
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 per-site GutenbergKit opt-in surfaced as a one-time bottom sheet on the My Site screen, with a matching toggle in Site Settings. The remote
gutenberg_kitflag only gates the announcement / Settings toggle visibility — it is deliberately not part of editor routing.Summary
GutenbergKitAnnouncementController— pure logic, unit-tested via an injectedjava.time.Clock.GUTENBERG_KIT_ANNOUNCEMENT_DEFERRED_UNTIL_<url>7 days out instead of locking in an opt-out. Swipe / back / tap-outside is treated as an implicit Maybe later so the sheet doesn't re-prompt on every My Site resume.GutenbergKitFeatureCheckerissiteOverride ?: experimentalFlag && !disableKillSwitch. The remotegutenberg_kitfeature flag is intentionally not in this expression — it only gates announcement / Settings toggle visibility. This lets us roll the announcement to a percentage of users without simultaneously flipping the default editor. When we're ready to make GutenbergKit the default for everyone, the change is a one-line edit (hard-code the fallback totrue).GutenbergKitFeatureChecker.isGutenbergKitEnabled(site)so it always reflects what the editor will actually do; on Aztec-default sites the row is shown disabled with an explanatory summary so users can still discover the option without a silent bundle-flip ofmobileEditor.Changes
GutenbergKitAnnouncementController.kt(new):shouldShowAnnouncement(site),onActivate(site),setOverride(site, enabled),onMaybeLater(site).setOverridealways clears any deferral, so "explicit decision supersedes a pending defer" lives in one place.GutenbergKitFeatureChecker.kt: editor-routing resolution drops the remote flag from the OR; onlysiteOverrideandexperimentalFlagdecide, with the kill switch winning over both. FieldisGutenbergKitFeatureEnabledonFeatureStateis kept for logging / informational purposes only.MySiteViewModel.kt/MySiteFragment.kt: announcement check moved to My SiteonResume(). Posts_onShowGutenbergKitAnnouncement: SingleLiveEvent<Event<SiteModel>>. Fragment observer guards withisStateSavedand an already-attached-instance check before.show().GutenbergKitAnnouncementBottomSheetFragment.kt:@AndroidEntryPoint, Hilt-injected controller, takes aSiteModelvianewInstance(site). Activate / Maybe later / dismiss-without-decision all route through the controller. Insets only consumeType.statusBars()so IME / gesture / bottom-bar insets still propagate. "Learn more" uses a%1$splaceholder so translators can position it anywhere in the body.SiteSettingsFragment.java: newmGutenbergKitPrefrow.refreshGutenbergKitToggleAvailability()is called from bothinitPreferences()andsetPreferencesFromSiteSettings(), so flipping "Use block editor as default for new posts" on the same screen re-enables the GBKit row without leaving Settings. Toggle writes go throughmGutenbergKitAnnouncementController.setOverride(...).AppPrefs.java:GUTENBERG_KIT_OPT_IN_SITES/OPT_OUT_SITES(deletableStringSets) and per-siteGUTENBERG_KIT_ANNOUNCEMENT_DEFERRED_UNTIL_<url>longs. The previous draft'sGUTENBERG_KIT_USER_OPT_INandGUTENBERG_KIT_ANNOUNCEMENT_SHOWNundeletable flags are removed — there's no longer any state that should survive logout.EditorLauncher.kt:logFeatureDisabledReasonandgetFeatureFlagsStringupdated to reflect the new resolution (mentions site override, no longer claims the remote flag enables routing).EditorCapabilityResolver.kt: passessitethrough the GBKit gate so Theme Styles and Third-Party Blocks resolve against the same per-site view the launcher uses.RELEASE-NOTES.txt: entry under 26.8.Test plan
DEFER_DURATION_MILLISlocally (or jumping the device clock).mobileEditor == "aztec"):GutenbergKitAnnouncementControllerTest,GutenbergKitFeatureCheckerTest,EditorCapabilityResolverTest,MySiteViewModelTestpass.