CMM-2201: Enable clicking referrers, link, tags, and categories from new stats - #23175
Draft
nbradbury wants to merge 6 commits into
Draft
CMM-2201: Enable clicking referrers, link, tags, and categories from new stats#23175nbradbury wants to merge 6 commits into
nbradbury wants to merge 6 commits into
Conversation
New stats dropped the referrer group's own URL when mapping the API response, so a standalone referrer row had nothing to open and was inert. Carry the URL through the data source, repository and UI state, and make a row without children open it. A row now either expands or opens a link, never both, matching old stats: a group header only expands, a standalone referrer navigates.
Collaborator
Generated by 🚫 Danger |
Contributor
|
|
Contributor
|
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk #23175 +/- ##
=======================================
Coverage 37.84% 37.84%
=======================================
Files 2345 2345
Lines 127530 127579 +49
Branches 17716 17722 +6
=======================================
+ Hits 48258 48285 +27
- Misses 75313 75335 +22
Partials 3959 3959 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The clicks response carries both a url and child links per entry, and both were being discarded, leaving every clicks row inert. Carry them through the same way referrers now do, so a click row without children opens its link and a grouped one expands. Also fixes BaseStatsCardViewModel dropping children on the way to the card, which would have swallowed click groups, and collapses the two duplicate ClickItemData.toDetailItem mappers into one.
…only-stats-referrers
Drop a redundant detail-VM test (the card test already covers the same mapper), reuse the existing clicks fixture helper instead of building results inline, and cut KDoc that restated the signature. Also removes a comment on MostViewedItemData that went stale when clicks gained a url.
Tags and categories were read-only in new stats: the archive link was discarded when mapping the API response, so the rows did nothing. Carry it through and make a lone tag open its archive page, while a group of several tags keeps expanding rather than navigating — matching old stats. Children inside an expanded group each open their own link. This is the first URL navigation on the Insights tab, so onStatsUrlClick is now threaded into InsightsTabContent and TagsAndCategoriesDetailActivity gains an ActivityNavigator. The open-link icon moves out of the MostViewed namespace to StatsOpenLinkIcon in StatsCardCommon, since two features now share it.
Contributor
🤖 Build Failure AnalysisThis build has failures. Claude has analyzed them - check the build annotations for details. |
…only-stats-referrers
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
Fixes CMM-2201 and CMM-2202
In the old stats, clicking a referrer, link, tag, or category would open its URL in the browser (Chrome Custom Tab). This PR adds that behavior to new stats.
Testing instructions
Referrers card:
Clicks card:
Tags and Categories card:
Note: some sites don't serve
/tag/...archives, so a tag link may land on the site's 404 page while category links resolve. The URL is passed through from the API unchanged, and old stats behaved the same way — it isn't a regression.