CMM 1237 create cities and region stats card#22592
Merged
Conversation
…ats-top-authors-card # Conflicts: # WordPress/src/main/java/org/wordpress/android/ui/newstats/datasource/StatsDataSourceImpl.kt # gradle/libs.versions.toml
# Conflicts: # WordPress/src/main/java/org/wordpress/android/ui/newstats/datasource/StatsDataSourceImpl.kt # gradle/libs.versions.toml
WordPress/src/main/java/org/wordpress/android/ui/newstats/locations/LocationsViewModel.kt
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/ui/newstats/locations/LocationsViewModel.kt
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/ui/newstats/locations/LocationsDetailActivity.kt
Show resolved
Hide resolved
…te-location-and-region-stats-card # Conflicts: # WordPress/src/main/java/org/wordpress/android/ui/newstats/countries/CountriesViewModel.kt
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk #22592 +/- ##
==========================================
- Coverage 38.18% 38.15% -0.04%
==========================================
Files 2254 2253 -1
Lines 113442 114096 +654
Branches 15802 15890 +88
==========================================
+ Hits 43315 43528 +213
- Misses 66534 66958 +424
- Partials 3593 3610 +17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…te-location-and-region-stats-card # Conflicts: # WordPress/src/main/java/org/wordpress/android/ui/newstats/NewStatsActivity.kt
…-location-and-region-stats-card # Conflicts: # WordPress/src/main/java/org/wordpress/android/ui/newstats/NewStatsActivity.kt # WordPress/src/main/java/org/wordpress/android/ui/newstats/countries/CountriesViewModel.kt # WordPress/src/main/java/org/wordpress/android/ui/newstats/mostviewed/MostViewedViewModel.kt # WordPress/src/test/java/org/wordpress/android/ui/newstats/NewStatsViewModelTest.kt # WordPress/src/test/java/org/wordpress/android/ui/newstats/countries/CountriesViewModelTest.kt
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
@nbradbury I've achieved some of the suggestions from here in: e7a02fb, ed8a978, and daaf68a |
Fix 1 - WebView memory leak (StatsGeoChartWebView.kt:106-108): Added onRelease callback to AndroidView that calls webView.destroy() when the composable leaves composition. Fix 2 - Unvalidated lat/long (LocationsViewModel.kt:552-554): Changed the filter from a null check to toDoubleOrNull() != null, which validates that latitude and longitude are actually numeric before injecting them into JavaScript. Fix 3 - Missing exception handling (LocationsViewModel.kt and AuthorsViewModel.kt): Wrapped all repository fetch calls in try/catch(Exception) blocks that emit error UI states, matching the pattern used in MostViewedViewModel. Fix 4 - Redundant WebView reloads (StatsGeoChartWebView.kt:77, 93-104): Added a lastLoadedHtml state to track the previously loaded HTML. The update lambda now only calls webView.loadData() when the content actually changes.
nbradbury
reviewed
Feb 19, 2026
WordPress/src/main/java/org/wordpress/android/ui/newstats/locations/LocationsCardUiState.kt
Outdated
Show resolved
Hide resolved
nbradbury
reviewed
Feb 19, 2026
WordPress/src/main/java/org/wordpress/android/ui/newstats/locations/LocationsViewModel.kt
Outdated
Show resolved
Hide resolved
nbradbury
approved these changes
Feb 19, 2026
Contributor
nbradbury
left a comment
There was a problem hiding this comment.
I left a couple of comments, but nothing that should hold this PR up ![]()
|
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
This PR adds Regions and Cities tabs to the Locations stats card alongside the existing Countries tab. I
Key changes:
regions/cities
countriespackage tolocationsto better reflect the broader scopeCountriesDetailActivityto support all three location types with correct titles, data, and map renderingTesting instructions
Countries tab:
Regions tab:
Cities tab:
Period switching:
Screen_recording_20260219_114330.mp4