CMM 1222 add stats top authors card#22561
Conversation
Generated by 🚫 Danger |
|
|
|
|
…ats-top-authors-card # Conflicts: # WordPress/src/main/java/org/wordpress/android/ui/newstats/datasource/StatsDataSourceImpl.kt # gradle/libs.versions.toml
Project manifest changes for WordPressThe following changes in the --- ./build/reports/diff_manifest/WordPress/wordpressVanillaRelease/base_manifest.txt 2026-02-19 09:32:21.041001751 +0000
+++ ./build/reports/diff_manifest/WordPress/wordpressVanillaRelease/head_manifest.txt 2026-02-19 09:32:30.121029422 +0000
@@ -199,6 +199,10 @@
<activity
android:name="org.wordpress.android.ui.newstats.countries.CountriesDetailActivity"
android:exported="false"
+ android:theme="@style/WordPress.NoActionBar" />
+ <activity
+ android:name="org.wordpress.android.ui.newstats.authors.AuthorsDetailActivity"
+ android:exported="false"
android:theme="@style/WordPress.NoActionBar" /> <!-- Account activities -->
<activity
android:name="org.wordpress.android.ui.main.MeActivity"Go to https://buildkite.com/automattic/wordpress-android/builds/25086/canvas?sid=019c7536-6710-4471-ba62-730c61126272, click on the |
Project manifest changes for WordPressThe following changes in the --- ./build/reports/diff_manifest/WordPress/jetpackVanillaRelease/base_manifest.txt 2026-02-19 09:33:00.221676325 +0000
+++ ./build/reports/diff_manifest/WordPress/jetpackVanillaRelease/head_manifest.txt 2026-02-19 09:33:10.471711811 +0000
@@ -393,6 +393,10 @@
<activity
android:name="org.wordpress.android.ui.newstats.countries.CountriesDetailActivity"
android:exported="false"
+ android:theme="@style/WordPress.NoActionBar" />
+ <activity
+ android:name="org.wordpress.android.ui.newstats.authors.AuthorsDetailActivity"
+ android:exported="false"
android:theme="@style/WordPress.NoActionBar" /> <!-- Account activities -->
<activity
android:name="org.wordpress.android.ui.main.MeActivity"Go to https://buildkite.com/automattic/wordpress-android/builds/25086/canvas?sid=019c7536-6718-4c3f-9d08-0537890bfe9f, click on the |
Project dependencies changeslist! Upgraded Dependencies
rs.wordpress.api:android:trunk-9edcee430afd18d7d440baf497a763f9b1bb83d9, (changed from trunk-f22a59cb660208f8706b7a2dcc1a9324567a92e4)
rs.wordpress.api:kotlin:trunk-9edcee430afd18d7d440baf497a763f9b1bb83d9, (changed from trunk-f22a59cb660208f8706b7a2dcc1a9324567a92e4)tree +--- project :libs:fluxc
-| \--- rs.wordpress.api:android:trunk-f22a59cb660208f8706b7a2dcc1a9324567a92e4
-| +--- com.squareup.okhttp3:okhttp:5.3.2 (*)
-| +--- com.squareup.okhttp3:okhttp-tls:5.3.2
-| | +--- com.squareup.okhttp3:okhttp:5.3.2 (*)
-| | +--- com.squareup.okio:okio:3.16.4 (*)
-| | \--- org.jetbrains.kotlin:kotlin-stdlib:2.2.21 -> 2.3.10 (*)
-| +--- net.java.dev.jna:jna:5.18.1
-| +--- rs.wordpress.api:kotlin:trunk-f22a59cb660208f8706b7a2dcc1a9324567a92e4
-| | +--- com.squareup.okhttp3:okhttp:5.3.2 (*)
-| | +--- com.squareup.okhttp3:okhttp-tls:5.3.2 (*)
-| | +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2 (*)
-| | \--- org.jetbrains.kotlin:kotlin-stdlib:2.1.21 -> 2.3.10 (*)
-| \--- org.jetbrains.kotlin:kotlin-stdlib:2.1.21 -> 2.3.10 (*)
+| \--- rs.wordpress.api:android:trunk-9edcee430afd18d7d440baf497a763f9b1bb83d9
+| +--- com.squareup.okhttp3:okhttp:5.3.2 (*)
+| +--- com.squareup.okhttp3:okhttp-tls:5.3.2
+| | +--- com.squareup.okhttp3:okhttp:5.3.2 (*)
+| | +--- com.squareup.okio:okio:3.16.4 (*)
+| | \--- org.jetbrains.kotlin:kotlin-stdlib:2.2.21 -> 2.3.10 (*)
+| +--- net.java.dev.jna:jna:5.18.1
+| +--- rs.wordpress.api:kotlin:trunk-9edcee430afd18d7d440baf497a763f9b1bb83d9
+| | +--- com.squareup.okhttp3:okhttp:5.3.2 (*)
+| | +--- com.squareup.okhttp3:okhttp-tls:5.3.2 (*)
+| | +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2 (*)
+| | \--- org.jetbrains.kotlin:kotlin-stdlib:2.1.21 -> 2.3.10 (*)
+| \--- org.jetbrains.kotlin:kotlin-stdlib:2.1.21 -> 2.3.10 (*)
-\--- rs.wordpress.api:android:trunk-f22a59cb660208f8706b7a2dcc1a9324567a92e4 (*)
+\--- rs.wordpress.api:android:trunk-9edcee430afd18d7d440baf497a763f9b1bb83d9 (*) |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk #22561 +/- ##
==========================================
- Coverage 38.18% 38.16% -0.03%
==========================================
Files 2248 2254 +6
Lines 112879 113362 +483
Branches 15733 15791 +58
==========================================
+ Hits 43102 43259 +157
- Misses 66197 66516 +319
- Partials 3580 3587 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
# Conflicts: # WordPress/src/main/java/org/wordpress/android/ui/newstats/datasource/StatsDataSourceImpl.kt # gradle/libs.versions.toml
|
Claude finished @adalpari's task in 1m 44s —— View job Code Review Complete ✓I've performed a comprehensive review of the Authors card implementation. Here's my detailed feedback: 🎯 Overall AssessmentThis is a well-structured implementation that successfully follows the existing Countries card pattern. The code demonstrates good architectural practices with proper separation of concerns, comprehensive testing, and reusable components. However, there are several areas that need attention.
|
| Category | Count |
|---|---|
| Critical Security Issues | 1 |
| Medium Severity Bugs | 2 |
| Low Severity Issues | 9 |
| Strengths | 6 |
Recommendation: Address the critical security issue (#1) and the potential memory leak (#2) before merging. Other issues can be addressed in follow-up PRs or tickets.
✨ Additional Notes
- The PR description mentions fixing column headers in MostViewed cards - this is a good cleanup
- The dependency on wordpress-rs PR (mentioned in dangermattic warning) should be resolved before merge
- Consider adding integration tests for the full user flow from card → detail screen
This would be a very edge case, so I don't think that having a max will benefit common cases. I'm finding a proper way to clean it, though. |
StatsRepository.fetchTopAuthors() at line 754 already uses coroutineScope { async {} } to fetch both current and previous periods in parallel. The reviewer likely looked only at the test file mocking setup and assumed sequential execution.
t's observed in NewStatsActivity.kt:249 where it's combined with all other card refresh states to drive the PullToRefreshBox indicator. The true state is visible during the entire fetchTopAuthors() suspend call — it's not an instant flip. |
| wordpress-lint = '2.2.0' | ||
| wordpress-persistent-edittext = '1.0.2' | ||
| wordpress-rs = 'trunk-ceb966c5b7f1af692aa9320b97a0cf2f316bb6c6' | ||
| wordpress-rs = '1151-58d91c951e1967880df2365f43bc6d008d5a79b7' |
There was a problem hiding this comment.
There's a new danger rule to check we are not targeting branches on the RS project anymore. So, the PR cannot be merged until I point this dependency to trunk
|
@adalpari While testing this I noticed multiple requests for
|
|
@adalpari It looks like "Show all" is limited to 10 authors even if there are more. Should it show all authors rather than the top 10? |
There should be only two. Let me check it with the "Show all" issue. Bot look like bugs |
|
@adalpari The "Show all" label appears even if there aren't more authors. Also, Claude is reporting this, but I'm not sure if this is accurate:
|
|
|
❌ The last analysis has failed. |
|
@nbradbury I've fixed what Claude suggested because it was definitely a bug. On the other hand:
So, please, give the PR another go when you have time. Note: Danger is failing to prevent merging the PR containing a dependency to a RS branch instead of trunk |
nbradbury
left a comment
There was a problem hiding this comment.
Looks good! I'll approve this so you can merge it after you update the wordpress-rs hash. ![]()
# Conflicts: # gradle/libs.versions.toml
|









Note: Danger is failing because of this
Description
Add a new "Authors" card to the new stats system (
/ui/newstats/). The card displays a list of top authors with their view counts, avatars, and change indicators compared to the previous period. Tapping "Show All" opens a detail screen with the complete author list.This implementation follows the existing Countries card pattern but uses circular avatars instead of flag icons. Also fixes column headers in MostViewed cards to use "Title" and "Referrer" instead of repeating the card title.
Testing instructions
Authors card displays correctly:
Authors card period changes:
Authors detail screen:
Card menu functionality: