Skip to content

Replace Stats and Reader likes screens with an adaptive SwiftUI grid - #25907

Merged
crazytonyli merged 4 commits into
trunkfrom
task/cmm-2318-stats-improve-likes-list-on-ipad
Aug 26, 2026
Merged

Replace Stats and Reader likes screens with an adaptive SwiftUI grid#25907
crazytonyli merged 4 commits into
trunkfrom
task/cmm-2318-stats-improve-likes-list-on-ipad

Conversation

@crazytonyli

@crazytonyli crazytonyli commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Fixes https://linear.app/a8c/issue/CMM-2318

This PR introduces a grid view to display the like list The one in Stats is used to display Reader post like list too, so both places are updated.

Grid view is used on wider screens. Plain list is used on smaller screens. They reuse a new SwiftUI implementation underneath.

@dangermattic

dangermattic commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator
1 Warning
⚠️ This PR is larger than 500 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.

Generated by 🚫 Danger

@wpmobilebot

wpmobilebot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor
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 Number33944
VersionPR #25907
Bundle IDorg.wordpress.alpha
Commit0a161ad
Installation URL4o09gj26qfit0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

wpmobilebot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor
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 Number33944
VersionPR #25907
Bundle IDcom.jetpack.alpha
Commit0a161ad
Installation URL7t1iivq644fro
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

The likers list (users who liked a post) rendered as a single full-width table
everywhere, wasting space on iPad's regular width. Replace the Stats and Reader
post-likes screens with one shared SwiftUI implementation that adapts to the
horizontal size class: a single column on compact and an adaptive multi-column
grid on regular.

LikesListViewModel ports the post-likes fetch and pagination engine from
LikesListController (cache-first first load, the +1s "before" cursor, and the
excluded-IDs boundary logic), publishing the likes, total, loading, and error
state. LikesListView renders both layouts from one LazyVGrid; LikeUserRowView is
a visual port of LikeUserTableViewCell. Each row is a Button so VoiceOver and
Switch Control get one labeled control per row, and the avatar scales with
Dynamic Type. A single LikesListHostViewController wrapper replaces the two
near-duplicate host controllers, owning the navigation title, per-feature
analytics, and the user profile sheet. A small PostLikesServing protocol keeps
the view model unit-testable.

Notifications is out of scope and keeps the existing LikesListController path.
@crazytonyli
crazytonyli force-pushed the task/cmm-2318-stats-improve-likes-list-on-ipad branch from 260bc46 to cfc6310 Compare August 19, 2026 06:28
@crazytonyli
crazytonyli marked this pull request as ready for review August 19, 2026 06:36
@wpmobilebot

wpmobilebot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

🤖 Build Failure Analysis

This build has failures. Claude has analyzed them - check the build annotations for details.

@crazytonyli
crazytonyli requested a review from jkmassel August 20, 2026 07:37
@crazytonyli crazytonyli added this to the 27.3 milestone Aug 20, 2026
}()

self.isLoadingPage = false
self.error = ErrorViewModel(title: self.errorTitle, subtitle: subtitle)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When the list is already showing names and a load then fails, all the names disappear and you're stuck on an error screen with no way to retry — you have to back out and reopen. It should keep the names it already loaded.

How to see it:

  1. Open the likes on a post with more than 90 likes.
  2. Scroll to the bottom so it starts loading more.
  3. As it starts loading, drop your connection (turn off wifi).
  4. The load fails and every name you were just looking at vanishes behind the error.

The old screen kept the names on screen here. When there's no connection from the start, the code already keeps the cached names (the check just above this) — the fix is to do the same when a load fails. The error could show up as a banner at the top with a retry action on it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch! Addressed in f3483da

A failed or offline refresh used to replace the whole likes list with a
full-screen error, discarding names that were already showing and leaving
no way to retry. The view now reserves the full-screen error (with a new
Retry button) for the case where nothing is loaded; otherwise the loaded
likes stay on screen and the failure renders as an inline footer with a
Retry action in place of the loading spinner. The view model clears the
error whenever a fetch starts so a retry returns to the loading state,
and the offline path surfaces the same error state regardless of whether
cached likes exist, since the view decides the presentation.
@crazytonyli
crazytonyli requested a review from jkmassel August 24, 2026 04:00
@crazytonyli
crazytonyli added this pull request to the merge queue Aug 25, 2026
Merged via the queue into trunk with commit 40a6719 Aug 26, 2026
28 checks passed
@crazytonyli
crazytonyli deleted the task/cmm-2318-stats-improve-likes-list-on-ipad branch August 26, 2026 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants