Gate New Stats behind remote feature flag#22996
Draft
adalpari wants to merge 4 commits into
Draft
Conversation
Replace the local NEW_STATS experimental flag with a server-controlled remote feature flag so the New Stats rollout can be managed remotely. Because the remote flag is read-only, the manual opt-in/opt-out toggles are removed and the flag is now the single source of truth. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collaborator
Generated by 🚫 Danger |
Contributor
|
|
Contributor
|
|
Contributor
🤖 Build Failure AnalysisThis build has failures. Claude has analyzed them - check the build annotations for details. |
…rrors The previous commit removed the New Stats opt-in/opt-out strings from the default locale but left them in the translation files, causing 204 ExtraTranslation lint errors. Remove the orphaned translations. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #22996 +/- ##
==========================================
- Coverage 37.46% 37.46% -0.01%
==========================================
Files 2325 2326 +1
Lines 125221 125224 +3
Branches 17160 17162 +2
==========================================
Hits 46913 46913
- Misses 74502 74505 +3
Partials 3806 3806 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Re-add the "Try new stats" toolbar menu and suggestion dialog on the classic Stats screen, and the "Disable new stats" overflow on the new Stats screen. The latter is shown only when the android_new_stats remote flag is off, so users on the rollout cannot switch back. Controls are plain navigation now; the remote flag remains the routing source of truth (no local ExperimentalFeatures flag is reintroduced). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.


Description
The New Stats experience was previously gated by a local experimental
feature flag (
ExperimentalFeatures.Feature.NEW_STATS), toggled both from theexperimental-features settings screen and from in-app "Try new stats" /
"Disable new stats" controls.
This PR replaces that local flag with a new remote feature flag,
android_new_stats, so the rollout can be controlled server-side. The remoteflag is the single source of truth for routing (which Stats screen opens by
default) and defaults to
falsewhen the remote value is unavailable (offline /not yet fetched).
The in-app switch controls are kept so users can move between the classic
and new experiences, with one rule tied to the remote flag: when
android_new_statsis on, the new experience is the rollout default and theuser is locked into it (no "Disable new stats" action). When the flag is
off, both directions are available. The controls are now plain navigation —
they no longer persist any local flag, so the remote flag remains the routing
source of truth.
Changes
NewStatsFeatureConfig(@Feature("android_new_stats", false))and the
NEW_STATSbuildConfigField. The@Featureannotation auto-registersthe default in the KSP-generated
RemoteFeatureConfigDefaults.ListItemActionHandlernow decides new vs. classicStats via
newStatsFeatureConfig.isEnabled()(test updated accordingly).NEW_STATSentry fromExperimentalFeatures(it disappears from the experimental-features settings screen automatically).
(
res/menu/stats_toolbar_menu.xml) and the "new Stats experience" suggestiondialog in
StatsFragmentremain. Selecting them now simply launchesNewStatsActivity(no local flag write).overflow action in
NewStatsActivityis shown only whennewStatsFeatureConfig.isEnabled()isfalse. When the remote flag istruethe action is hidden, so users on the rollout cannot switch back. Selecting it
launches the classic
StatsActivity(no local flag write).AppPrefs/AppPrefsWrapper), baseEnglish strings, and the
STATS_NEW_STATS_ENABLED/STATS_NEW_STATS_DISABLEDanalytics events used by these controls.
Testing instructions
Remote flag off (default):
Remote flag on:
NEW_STATSto"true"inWordPress/build.gradle(or enableandroid_new_statsvia remote config), then rebuild.