Skip to content

Subscriber detail stats #21982

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 20 commits into
base: trunk
Choose a base branch
from
Draft

Conversation

nbradbury
Copy link
Contributor

@nbradbury nbradbury commented Jun 27, 2025

This PR updates the subscriber feature by fetching and displaying subscriber stats for the detail screen.

To test

  • In a debug build, enable the experimental subscriber feature
  • My Site > Subscribers
  • Tap a subscriber and note the detail includes stats for Emails, Opened, and Clicked

stats

@nbradbury nbradbury added the Subscribers View and manage newsletter subscribers label Jun 27, 2025
@nbradbury nbradbury requested a review from Copilot June 27, 2025 18:33
@dangermattic
Copy link
Collaborator

dangermattic commented Jun 27, 2025

1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

Copilot

This comment was marked as outdated.

@wpmobilebot
Copy link
Contributor

Project dependencies changes

list
! Upgraded Dependencies
rs.wordpress.api:android:trunk-5e2baf62aea0fd14efa95d3a533e846faeb9cc64, (changed from trunk-ba6df4e8adfec6c14d6fa58af3717d2297d431fa)
rs.wordpress.api:kotlin:trunk-5e2baf62aea0fd14efa95d3a533e846faeb9cc64, (changed from trunk-ba6df4e8adfec6c14d6fa58af3717d2297d431fa)
tree
-\--- rs.wordpress.api:android:trunk-ba6df4e8adfec6c14d6fa58af3717d2297d431fa
-     +--- com.squareup.okhttp3:okhttp:4.12.0 (*)
-     +--- com.squareup.okhttp3:okhttp-tls:4.12.0
-     |    +--- com.squareup.okhttp3:okhttp:4.12.0 (*)
-     |    +--- com.squareup.okio:okio:3.6.0 -> 3.9.0 (*)
-     |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.21 -> 1.9.10 (*)
-     +--- net.java.dev.jna:jna:5.17.0
-     +--- rs.wordpress.api:kotlin:trunk-ba6df4e8adfec6c14d6fa58af3717d2297d431fa
-     |    +--- com.squareup.okhttp3:okhttp:4.12.0 (*)
-     |    +--- com.squareup.okhttp3:okhttp-tls:4.12.0 (*)
-     |    +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2 (*)
-     |    \--- org.jetbrains.kotlin:kotlin-stdlib:2.0.21 -> 2.1.21 (*)
-     \--- org.jetbrains.kotlin:kotlin-stdlib:2.0.21 -> 2.1.21 (*)
+\--- rs.wordpress.api:android:trunk-5e2baf62aea0fd14efa95d3a533e846faeb9cc64
+     +--- com.squareup.okhttp3:okhttp:4.12.0 (*)
+     +--- com.squareup.okhttp3:okhttp-tls:4.12.0
+     |    +--- com.squareup.okhttp3:okhttp:4.12.0 (*)
+     |    +--- com.squareup.okio:okio:3.6.0 -> 3.9.0 (*)
+     |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.21 -> 1.9.10 (*)
+     +--- net.java.dev.jna:jna:5.17.0
+     +--- rs.wordpress.api:kotlin:trunk-5e2baf62aea0fd14efa95d3a533e846faeb9cc64
+     |    +--- com.squareup.okhttp3:okhttp:4.12.0 (*)
+     |    +--- com.squareup.okhttp3:okhttp-tls:4.12.0 (*)
+     |    +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2 (*)
+     |    \--- org.jetbrains.kotlin:kotlin-stdlib:2.1.21 (*)
+     \--- org.jetbrains.kotlin:kotlin-stdlib:2.1.21 (*)

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jun 27, 2025

WordPress📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress WordPress
FlavorJalapeno
Build TypeDebug
Versionpr21982-f954dfe
Commitf954dfe
Direct Downloadwordpress-prototype-build-pr21982-f954dfe.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jun 27, 2025

Jetpack📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack Jetpack
FlavorJalapeno
Build TypeDebug
Versionpr21982-f954dfe
Commitf954dfe
Direct Downloadjetpack-prototype-build-pr21982-f954dfe.apk
Note: Google Login is not supported on these builds.

Copy link

codecov bot commented Jun 28, 2025

Codecov Report

Attention: Patch coverage is 0% with 58 lines in your changes missing coverage. Please review.

Project coverage is 39.02%. Comparing base (720ca9d) to head (f954dfe).

Files with missing lines Patch % Lines
...s/android/ui/subscribers/SubscriberDetailScreen.kt 0.00% 50 Missing ⚠️
...ess/android/ui/subscribers/SubscribersViewModel.kt 0.00% 8 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            trunk   #21982   +/-   ##
=======================================
  Coverage   39.02%   39.02%           
=======================================
  Files        2153     2153           
  Lines      101494   101494           
  Branches    15585    15585           
=======================================
  Hits        39613    39613           
  Misses      58384    58384           
  Partials     3497     3497           

☔ 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.

@nbradbury nbradbury requested a review from Copilot June 28, 2025 19:10
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the subscriber detail feature by fetching and displaying subscriber stats along with the subscriber details.

  • Updated dependency version for wordpress-rs in the versions TOML file
  • Implemented subscriber stats fetching in SubscribersViewModel and added a new method in SubscriberDetailViewModel
  • Updated UI components in SubscribersActivity and SubscriberDetailScreen to display stats and support clickable email/URL actions

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
gradle/libs.versions.toml Updated dependency version for wordpress-rs
WordPress/src/main/res/drawable/ic_email_open.xml Added a new vector drawable for representing email opened state
WordPress/src/main/java/org/wordpress/android/ui/subscribers/SubscribersViewModel.kt Added state management and coroutine-driven fetching of subscriber stats
WordPress/src/main/java/org/wordpress/android/ui/subscribers/SubscribersActivity.kt Integrated new click actions for email and url links, passing required state to the detail screen
WordPress/src/main/java/org/wordpress/android/ui/subscribers/SubscriberDetailViewModel.kt Added functionality to fetch subscriber details along with stats
WordPress/src/main/java/org/wordpress/android/ui/subscribers/SubscriberDetailScreen.kt Updated UI components to display real timing stats and to allow clickable interactions for email/URL
Comments suppressed due to low confidence (1)

WordPress/src/main/java/org/wordpress/android/ui/subscribers/SubscriberDetailViewModel.kt:33

  • Initializing wpComApiClient asynchronously in the init block may lead to a race condition if fetchSubscriberWithStats is invoked before the initialization completes. Consider using dependency injection or a synchronous initialization to guarantee that wpComApiClient is ready when needed.
            wpComApiClient = WpComApiClient(

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Subscribers View and manage newsletter subscribers unit-tests-exemption
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants