Skip to content

Show Insights and Subscribers stats tabs for all users#22722

Merged
adalpari merged 2 commits intotrunkfrom
feature/show-insights-and-subscribers-stats
Mar 20, 2026
Merged

Show Insights and Subscribers stats tabs for all users#22722
adalpari merged 2 commits intotrunkfrom
feature/show-insights-and-subscribers-stats

Conversation

@adalpari
Copy link
Copy Markdown
Contributor

@adalpari adalpari commented Mar 20, 2026

Description

The Insights and Subscribers stats tabs were gated behind BuildConfig.DEBUG, making them only visible in debug builds. This change removes that gate so all three tabs (Traffic, Insights, Subscribers) are always shown in the new stats screen for all users.

Changes:

  • Remove BuildConfig.DEBUG check in NewStatsActivity.kt
  • Always show all StatsTab entries instead of restricting to StatsTab.TRAFFIC in non-debug builds

Testing instructions

  1. Install a release build of the app
  2. Navigate to the new Stats screen
  • Verify all three tabs (Traffic, Insights, Subscribers) are visible
  • Verify each tab loads its content correctly

🤖 Generated with Claude Code

Show all three stats tabs (Traffic, Insights, Subscribers) for
everyone by removing the BuildConfig.DEBUG gate. The NEW_STATS
feature flag now defaults to true and controls access to the new
stats screen itself via ListItemActionHandler, not the tab
visibility.

- Add defaultEnabled parameter to ExperimentalFeatures.Feature enum
- Set NEW_STATS defaultEnabled to true
- Propagate default through AppPrefs/AppPrefsWrapper
- Always show all StatsTab entries in NewStatsScreen

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dangermattic
Copy link
Copy Markdown
Collaborator

dangermattic commented Mar 20, 2026

1 Warning
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

Keep only the NewStatsActivity change that always shows all tabs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

@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
Versionpr22722-337a1a5
Build Number1488
Application IDorg.wordpress.android.prealpha
Commit337a1a5
Installation URL2kbj3nvthut58
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
Versionpr22722-337a1a5
Build Number1488
Application IDcom.jetpack.android.prealpha
Commit337a1a5
Installation URL1nefrgpe3pt9o
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 20, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 37.34%. Comparing base (f05dc6b) to head (337a1a5).
⚠️ Report is 1 commits behind head on trunk.

Files with missing lines Patch % Lines
.../wordpress/android/ui/newstats/NewStatsActivity.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            trunk   #22722   +/-   ##
=======================================
  Coverage   37.34%   37.34%           
=======================================
  Files        2316     2316           
  Lines      123422   123421    -1     
  Branches    16723    16722    -1     
=======================================
  Hits        46093    46093           
+ Misses      73627    73626    -1     
  Partials     3702     3702           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@adalpari
Copy link
Copy Markdown
Contributor Author

@claude

@claude
Copy link
Copy Markdown
Contributor

claude bot commented Mar 20, 2026

Claude finished @adalpari's task in 54s —— View job


Code Review

  • Gather context and read changed files
  • Analyze code changes
  • Provide review feedback

The actual change in this PR is minimal and clean — a 4-line diff in NewStatsActivity.kt:

// Before
val showTabs = BuildConfig.DEBUG
val tabs = if (showTabs) StatsTab.entries else listOf(StatsTab.TRAFFIC)

// After
val tabs = StatsTab.entries

Overall this is a good, focused change. A few observations:

PR Description vs. Actual Changes

The PR description mentions several changes that are no longer present (adding defaultEnabled to ExperimentalFeatures.Feature, propagating through AppPrefs/AppPrefsWrapper). These were reverted in commit 337a1a5. The description should be updated to reflect the actual scope — only NewStatsActivity.kt is changed. This is worth fixing before merging to avoid confusion for future readers.

Readiness of Insights/Subscribers Tabs

The previous BuildConfig.DEBUG gate suggests these tabs were under active development. Are both tabs considered production-ready? A few things worth confirming:

  • Do they handle all error states (network errors, empty data, auth errors) the same way the Traffic tab does?
  • Do both tabs work correctly for all site types/plan levels, or is there any content that should be gated by plan?

Looking at InsightsTabContent and SubscribersTabContent, the Insights tab has full no-connection handling and pull-to-refresh, which is a good sign. It would be worth confirming the Subscribers tab is similarly robust.

Test Coverage

Codecov flags 0% patch coverage on the changed line. While a one-liner like val tabs = StatsTab.entries is straightforward, a simple test asserting that NewStatsScreen renders all three tabs (or that StatsTab.entries.size == 3) would provide a regression guard if tabs are ever conditionally filtered again in the future.

No other concerns — the change itself is correct, the dead code (showTabs variable and BuildConfig import) is properly removed, and the logic simplification makes the intent clearer.

@adalpari adalpari marked this pull request as ready for review March 20, 2026 12:46
@adalpari adalpari requested a review from nbradbury March 20, 2026 12:47
@adalpari adalpari enabled auto-merge (squash) March 20, 2026 12:47
@nbradbury
Copy link
Copy Markdown
Contributor

nbradbury commented Mar 20, 2026

@adalpari The changes look good, but as Claude noted, the PR description appears to be outdated. I'm happy to approve this once that's corrected.

@adalpari
Copy link
Copy Markdown
Contributor Author

@adalpari The changes look good, but as Claude noted, the PR description appears to be outdated. I'm happy to approve this once that's corrected.

Good call. Done!

Copy link
Copy Markdown
Contributor

@nbradbury nbradbury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@adalpari adalpari merged commit cb9a3e7 into trunk Mar 20, 2026
28 checks passed
@adalpari adalpari deleted the feature/show-insights-and-subscribers-stats branch March 20, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants