WordPress-iOS icon indicating copy to clipboard operation
WordPress-iOS copied to clipboard

Extract DataViewPaginatedResponse

Open kean opened this issue 5 months ago • 5 comments

This PR is a prerequisite for reimplementing "Jetpack Activity Logs" using "DataViews".

Summary

  • Extracted DataViewPaginatedResponse for managing paginated data loading
  • Implemented DataViewPaginatedForEach SwiftUI component for displaying paginated lists
  • Refactored subscribers feature to use the new types
  • Added test coverage for the pagination functionality
  • Fix an issue with deleteItem not updating count (should decrement by one)
  • Rename LoadMoreFooterView to make it clear it's part of the "DataView" infrastructure

Test Plan

  • Verify subscribers list loads and paginates correctly
  • Test error states and retry functionality in subscribers
  • Confirm footer loading/error states display properly
  • Run existing subscribers tests to ensure no regressions

https://github.com/user-attachments/assets/5af21bdb-893c-4790-a93d-26f1baece6c1

Note: nearly all code was generated with Claude Code (after many-many prompts)

kean avatar Jun 16 '25 20:06 kean

2 Warnings
:warning: This PR is larger than 500 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
:warning: This PR is assigned to the milestone 26.0. The due date for this milestone has already passed.
Please assign it to a milestone with a later deadline or check whether the release for this milestone has already been finished.

Generated by :no_entry_sign: Danger

dangermattic avatar Jun 16 '25 20:06 dangermattic

App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number27883
VersionPR #24592
Bundle IDcom.jetpack.alpha
Commitf99f95c9151e7d5dd16b59bab48858cab4a8a6f6
Installation URL35vrmjvi9m3ng
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

wpmobilebot avatar Jun 16 '25 20:06 wpmobilebot

App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number27883
VersionPR #24592
Bundle IDorg.wordpress.alpha
Commitf99f95c9151e7d5dd16b59bab48858cab4a8a6f6
Installation URL7frij6e7ks93g
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

wpmobilebot avatar Jun 16 '25 20:06 wpmobilebot

Something is wrong with this PR. It keeps marking my replies as "Pending".

I addressed the feedback, and here was the reply about the filters UI/UX:

It might be the only reasonable option, and it matches the behavior on the web.

The primary use-case would be the following:

  • You open "Subscribers"
  • You want to see only your paid subscribers, so you select the filter
  • We re-fetch the data
  • It's less likely that you would scroll first and only then start filtering.

I'm open to suggestions how to improve this. I initially considered creating an in-memory store similar to the one for plugins, but I decided it wasn't needed as the current UI/UX with just an in-memory cache of the current request with a combination of fast response work really well. We should be able to use it for the majority of features.

kean avatar Jun 18 '25 16:06 kean