CMM-2197: Make Posts & Pages items in new stats clickable - #23171
CMM-2197: Make Posts & Pages items in new stats clickable#23171nbradbury wants to merge 8 commits into
Conversation
Carries url/postType through from the wordpress-rs top-posts response and opens the existing StatsDetailActivity when a post row is tapped on the card or the Show All screen, matching old stats behavior (including the STATS_POSTS_AND_PAGES_ITEM_TAPPED analytics event).
Generated by 🚫 Danger |
|
|
|
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk #23171 +/- ##
==========================================
- Coverage 37.84% 37.84% -0.01%
==========================================
Files 2345 2345
Lines 127530 127573 +43
Branches 17716 17720 +4
==========================================
+ Hits 48258 48274 +16
- Misses 75313 75340 +27
Partials 3959 3959 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…tats-clickable-posts
…tats-clickable-posts
Collapses the duplicated post-tap navigation in NewStatsActivity and MostViewedDetailActivity into one ActivityNavigator method, and moves the legacy statsDetailItemType mapping out of the new-stats UI-state layer to the navigation boundary.
…tats-clickable-posts
ActivityNavigator has a @singleton @Inject constructor, so Hilt constructs it directly. The unscoped @provides also shadowed the class-level @singleton, handing out a new instance per injection site.
…tats-clickable-posts
🤖 Build Failure AnalysisThis build has failures. Claude has analyzed them - check the build annotations for details. |
oguzkocer
left a comment
There was a problem hiding this comment.
Worked as expected. I left a couple notes, but nothing blocking the merge. ![]()
| * No-ops when no site is selected. | ||
| */ | ||
| fun openPostDetailStats(context: Context, postId: Long, postType: String?, postTitle: String, postUrl: String?) { | ||
| val site = selectedSiteRepository.getSelectedSite() ?: return |
There was a problem hiding this comment.
I don't feel strongly about this, but it looks like we are showing a toast when a site is missing in many other cases, so maybe worth adding here as well?
There was a problem hiding this comment.
Good call - I'll add this.
| */ | ||
| fun openPostDetailStats(context: Context, postId: Long, postType: String?, postTitle: String, postUrl: String?) { | ||
| val site = selectedSiteRepository.getSelectedSite() ?: return | ||
| AnalyticsTracker.track(AnalyticsTracker.Stat.STATS_POSTS_AND_PAGES_ITEM_TAPPED) |
There was a problem hiding this comment.
It looks like we were doing this slightly differently with trackGranular here. Not sure if that's available to us, but thought I'd mention.
There was a problem hiding this comment.
Unfortunately, the new stats periods (Today / Last 7 Days / Last 30 Days / 6–12 Months / custom) don’t map cleanly onto the old StatsGranularity taxonomy, so the trackGranular property would mislabel events.
Addresses review feedback: matches the openMediaInNewStack pattern instead of silently ignoring the tap.


Description
Fixes CMM-2197
In the new stats, items in the Posts & Pages card aren't tappable, unlike old stats. This PR adds the previous behavior to the new stats.
Note that we use the old per-post stats screen here. We'll want to add a new screen for this which matches the new UI, but at the moment there's no per-post stats endpoint in
wordpress-rsso we stick with the old screen. This isn't ideal, but it's better than not having the feature at all.Testing instructions
Note: This is currently failing CI but not due to changes in this PR. I'll rerun checks once that gets resolved.