diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 2a83666d3e58..15809f93b0cc 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -1,6 +1,7 @@ 27.3 ----- * [*] Stats: Improve performance when opening the Stats screen [#25938] +* [*] Stats: Open the latest post when tapping the Latest Post Summary card in the Insights tab [#25896] 27.2 ----- diff --git a/WordPress/Classes/ViewRelated/Stats/Insights/StatsLatestPostSummaryInsightsCell.swift b/WordPress/Classes/ViewRelated/Stats/Insights/StatsLatestPostSummaryInsightsCell.swift index cf155ddadb91..a755c81dbec7 100644 --- a/WordPress/Classes/ViewRelated/Stats/Insights/StatsLatestPostSummaryInsightsCell.swift +++ b/WordPress/Classes/ViewRelated/Stats/Insights/StatsLatestPostSummaryInsightsCell.swift @@ -193,6 +193,7 @@ class StatsLatestPostSummaryInsightsCell: StatsBaseCell, LatestPostSummaryConfig func configure(withInsightData lastPostInsight: StatsLastPostInsight?, andDelegate delegate: SiteStatsInsightsDelegate?) { siteStatsInsightsDelegate = delegate statSection = .insightsLatestPostSummary + selectionStyle = lastPostInsight == nil ? .none : .default guard let lastPostInsight else { toggleNoData(show: true) diff --git a/WordPress/Classes/ViewRelated/Stats/SiteStatsTableViewCells.swift b/WordPress/Classes/ViewRelated/Stats/SiteStatsTableViewCells.swift index 637a95b33faf..8edc72f99473 100644 --- a/WordPress/Classes/ViewRelated/Stats/SiteStatsTableViewCells.swift +++ b/WordPress/Classes/ViewRelated/Stats/SiteStatsTableViewCells.swift @@ -217,7 +217,17 @@ struct LatestPostSummaryRow: StatsHashableImmuTableRow { let summaryData: StatsLastPostInsight? let chartData: StatsPostDetails? weak var siteStatsInsightsDelegate: SiteStatsInsightsDelegate? - let action: ImmuTableAction? = nil + var action: ImmuTableAction? { + guard let url = summaryData?.url else { + return nil + } + + let delegate = siteStatsInsightsDelegate + return { [weak delegate] _ in + WPAppAnalytics.track(.statsItemTappedLatestPostSummaryPost) + delegate?.displayWebViewWithURL?(url) + } + } let statSection: StatSection? func configureCell(_ cell: UITableViewCell) {