Skip to content

Conversation

nbradbury
Copy link
Contributor

Closes CMM-676

Prior to this PR, when the list of items in a DataView was empty we would always show the empty view text for the Subscribers feature. This meant that when viewing application passwords, the user would be told "There are no subscribers" if the password list was empty.

Luckily, the password list should never be empty, but this still needed to be addressed. So this PR resolves this by using a default generic empty view which can be overriden.

Here's the default empty view:

apppass-default

And here's the empty view overriden for Subscribers:

subscribers

@dangermattic
Copy link
Collaborator

dangermattic commented Aug 12, 2025

2 Warnings
⚠️ strings.xml files should only be updated on release branches, when the translations are downloaded by our automation.
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Aug 12, 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
Versionpr22118-9ca05d1
Commit9ca05d1
Direct Downloadwordpress-prototype-build-pr22118-9ca05d1.apk
Note: Google Login is not supported on these builds.

@nbradbury nbradbury requested a review from Copilot August 12, 2025 10:56
@nbradbury nbradbury added the Subscribers View and manage newsletter subscribers label Aug 12, 2025
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 introduces customizable empty views for the DataView component to replace the hardcoded Subscribers empty view that was incorrectly shown for all DataView implementations. The changes allow each DataView implementation to specify its own empty state message and image while providing a sensible default.

  • Added a customizable DataViewEmptyView class with default generic empty state text and image
  • Updated SubscribersViewModel to override the empty view with subscriber-specific content
  • Modified DataView screen components to accept and use the custom empty view parameter

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
strings.xml Adds default empty message string resource for DataView
DataViewViewModel.kt Introduces DataViewEmptyView class with default empty state configuration
SubscribersViewModel.kt Overrides empty view with subscriber-specific message and image
DataViewScreen.kt Updates composable to accept and use custom empty view parameter
SubscribersActivity.kt Passes the view model's empty view to the DataView screen
ApplicationPasswordsListActivity.kt Passes the view model's empty view to the DataView screen

Copy link

@wpmobilebot
Copy link
Contributor

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
Versionpr22118-9ca05d1
Commit9ca05d1
Direct Downloadjetpack-prototype-build-pr22118-9ca05d1.apk
Note: Google Login is not supported on these builds.

Copy link

codecov bot commented Aug 12, 2025

Codecov Report

❌ Patch coverage is 0% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 39.43%. Comparing base (fa1fa2a) to head (9ca05d1).
⚠️ Report is 1 commits behind head on trunk.

Files with missing lines Patch % Lines
...rg/wordpress/android/ui/dataview/DataViewScreen.kt 0.00% 9 Missing ⚠️
...ess/android/ui/subscribers/SubscribersViewModel.kt 0.00% 3 Missing ⚠️
...wordpress/android/ui/dataview/DataViewViewModel.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            trunk   #22118   +/-   ##
=======================================
  Coverage   39.43%   39.43%           
=======================================
  Files        2149     2149           
  Lines      101872   101872           
  Branches    15604    15604           
=======================================
  Hits        40177    40177           
  Misses      58126    58126           
  Partials     3569     3569           

☔ 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 adalpari August 12, 2025 11:44
@nbradbury nbradbury marked this pull request as ready for review August 12, 2025 11:44
Copy link
Contributor

@adalpari adalpari left a comment

Choose a reason for hiding this comment

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

This was a great catch! LGTM!

@nbradbury nbradbury merged commit a9f7a6c into trunk Aug 12, 2025
27 checks passed
@nbradbury nbradbury deleted the issue/CMM-676-dataview-custom-empty branch August 12, 2025 17:03
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants