Skip to content

Add new post list powered by wordpress-rs#22585

Closed
nbradbury wants to merge 29 commits intotrunkfrom
feature/rs-post-list
Closed

Add new post list powered by wordpress-rs#22585
nbradbury wants to merge 29 commits intotrunkfrom
feature/rs-post-list

Conversation

@nbradbury
Copy link
Contributor

@nbradbury nbradbury commented Feb 11, 2026

Description

Adds a new Compose-based post list screen backed by the wordpress-rs REST API. The feature is gated behind an experimental feature flag (posts_rs_list) and requires the site to have an Application Password configured.

Key changes:

  • New PostRsListActivity with tabbed post list (Published, Drafts, Scheduled, Trashed)
  • PostRsListViewModel with pagination, pull-to-refresh, and FluxC OnPostUploaded listener for auto-refresh
  • PostRsRestClient fetching posts via wordpress-rs WpApiClient
  • Compose UI screens in postsrs/screens/ package with Material 3 components
  • Experimental feature flag in ExperimentalFeatures

Limitations

There is a lot of functionality left to implement, notably search, author names, and the dot-dot-dot menu. These will come later, as will tests.

Also note that since the post editor relies on FluxC, with the new post list you can only edit posts that have already been downloaded by FluxC. So before enabling the experimental feature flag, I recommend refreshing the "old" post list to ensure you have the latest posts.

Testing instructions

Enable the experimental feature:

  1. Go to Me > App Settings > Experimental Features
  2. Enable "New Post List"
  • Verify the toggle appears and can be enabled

View the new post list:

  1. Select a site that has an Application Password configured
  2. Navigate to My Site > Posts
  • Verify the new Compose post list opens (not the old one)
  • Verify Published, Drafts, Scheduled, and Trashed tabs are shown
  • Verify posts load in each tab
  • Verify pull-to-refresh works
  • Verify scrolling to the bottom loads more posts

Create a new post:

  1. Tap the FAB (+) button
  2. Create and publish a draft post
  3. Return to the post list
  • Verify the new draft appears in the Drafts tab after upload completes

Fallback to old list:

  1. Disable the "New Post List" experimental feature
  2. Navigate to My Site > Posts
  • Verify the old post list opens
posts-rs.mp4

nbradbury and others added 15 commits February 10, 2026 14:50
Introduces a new post list feature behind the POSTS_RS_LIST
experimental feature flag. When enabled on a site with an
application password, tapping Posts in My Site opens the new
Compose-based list instead of the existing FluxC-based one.

The implementation follows the nav menus architecture:
- PostRsRestClient fetches posts via wordpress-rs uniffi bindings
- PostRsListViewModel manages per-tab StateFlows with pagination
- Compose screens with PrimaryTabRow, PullToRefreshBox, LazyColumn
- Tabs: Published, Drafts, Scheduled, Trashed
- Tapping a post opens the existing editor via PostStore lookup

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use a single consistent empty message across all tabs and add a
"Create a post" button below it using existing translated strings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The WP REST API returns dates without timezone info. Normalize
them by appending +0000 before parsing so dateUTCFromIso8601
handles them correctly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove unnecessary mainDispatcher, flatten nested withContext calls,
inline single-use loadPosts wrapper, remove duplicate onTabSelected
call in onCreate, and drop redundant site null check in onPostClicked.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move the experimental feature check from MySiteFragment and
MenuActivity into ActivityLauncher.viewCurrentBlogPosts, removing
duplicated logic and ExperimentalFeatures injection from both classes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove duplicate ExperimentalFeatures import in ActivityLauncher and
rename posts_rs package to postsrs to satisfy detekt PackageNaming rule.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move PostRsListContent and TabContent composables into a new
PostRsListScreen.kt in the screens package, keeping the activity
focused on wiring and navigation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Listen for FluxC OnPostUploaded events via the Dispatcher so
the current tab refreshes after a new post is uploaded.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dangermattic
Copy link
Collaborator

dangermattic commented Feb 11, 2026

3 Warnings
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
⚠️ Class PostRsListViewModel is missing tests, but unit-tests-exemption label was set to ignore this.
⚠️ Class PostRsRestClient is missing tests, but unit-tests-exemption label was set to ignore this.
1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Feb 11, 2026

Project manifest changes for WordPress

The following changes in the WordPress's merged AndroidManifest.xml file were detected (build variant: wordpressVanillaRelease):

--- ./build/reports/diff_manifest/WordPress/wordpressVanillaRelease/base_manifest.txt	2026-02-12 14:46:25.109312689 +0000
+++ ./build/reports/diff_manifest/WordPress/wordpressVanillaRelease/head_manifest.txt	2026-02-12 14:46:27.949311028 +0000
@@ -926,6 +926,11 @@
             android:name="org.wordpress.android.ui.navmenus.NavMenusActivity"
             android:label="@string/menus"
             android:launchMode="singleTop"
+            android:theme="@style/WordPress.NoActionBar" />
+        <activity
+            android:name="org.wordpress.android.ui.postsrs.PostRsListActivity"
+            android:label="@string/my_site_btn_blog_posts"
+            android:launchMode="singleTop"
             android:theme="@style/WordPress.NoActionBar" /> <!-- Plugins -->
         <activity
             android:name="org.wordpress.android.ui.plugins.PluginDetailActivity"

Go to https://buildkite.com/automattic/wordpress-android/builds/24974/canvas?sid=019c524a-78d7-49b0-9b7f-1bc35dd92a28, click on the Artifacts tab and audit the files.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Feb 11, 2026

Project manifest changes for WordPress

The following changes in the WordPress's merged AndroidManifest.xml file were detected (build variant: jetpackVanillaRelease):

--- ./build/reports/diff_manifest/WordPress/jetpackVanillaRelease/base_manifest.txt	2026-02-12 14:46:12.996818181 +0000
+++ ./build/reports/diff_manifest/WordPress/jetpackVanillaRelease/head_manifest.txt	2026-02-12 14:46:16.366847100 +0000
@@ -953,6 +953,11 @@
             android:name="org.wordpress.android.ui.navmenus.NavMenusActivity"
             android:label="@string/menus"
             android:launchMode="singleTop"
+            android:theme="@style/WordPress.NoActionBar" />
+        <activity
+            android:name="org.wordpress.android.ui.postsrs.PostRsListActivity"
+            android:label="@string/my_site_btn_blog_posts"
+            android:launchMode="singleTop"
             android:theme="@style/WordPress.NoActionBar" /> <!-- Plugins -->
         <activity
             android:name="org.wordpress.android.ui.plugins.PluginDetailActivity"

Go to https://buildkite.com/automattic/wordpress-android/builds/24974/canvas?sid=019c524a-78da-4836-8c01-7d4c6444d25b, click on the Artifacts tab and audit the files.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Feb 11, 2026

App Icon📲 You can test the changes from this Pull Request in WordPress Android by scanning the QR code below to install the corresponding build.

App NameWordPress Android
FlavorJalapeno
Build TypeDebug
Versionpr22585-700d9b5
Build Number1484
Application IDorg.wordpress.android.prealpha
Commit700d9b5
Installation URL0pjiqii2rl0cg
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Feb 11, 2026

App Icon📲 You can test the changes from this Pull Request in Jetpack Android by scanning the QR code below to install the corresponding build.

App NameJetpack Android
FlavorJalapeno
Build TypeDebug
Versionpr22585-700d9b5
Build Number1484
Application IDcom.jetpack.android.prealpha
Commit700d9b5
Installation URL0s78e7dofau5g
Note: Google Login is not supported on these builds.

@codecov
Copy link

codecov bot commented Feb 11, 2026

Codecov Report

❌ Patch coverage is 0.74074% with 536 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.99%. Comparing base (62feda7) to head (700d9b5).
⚠️ Report is 2 commits behind head on trunk.

Files with missing lines Patch % Lines
.../android/ui/postsrs/screens/PostRsTabListScreen.kt 0.00% 138 Missing ⚠️
...ordpress/android/ui/postsrs/PostRsListViewModel.kt 0.00% 111 Missing ⚠️
...ess/android/ui/postsrs/screens/PostRsListScreen.kt 0.00% 68 Missing ⚠️
...dpress/android/ui/postsrs/data/PostRsRestClient.kt 0.00% 60 Missing ⚠️
...press/android/ui/postsrs/screens/PostRsListItem.kt 0.00% 56 Missing ⚠️
.../wordpress/android/ui/postsrs/PostRsListUiState.kt 0.00% 52 Missing and 1 partial ⚠️
.../org/wordpress/android/ui/postsrs/PostRsListTab.kt 0.00% 24 Missing ⚠️
...ress/android/ui/postsrs/screens/ScrollObservers.kt 0.00% 13 Missing ⚠️
...wordpress/android/ui/postsrs/models/PostRsModel.kt 0.00% 7 Missing ⚠️
...ava/org/wordpress/android/ui/ActivityLauncher.java 0.00% 5 Missing ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##            trunk   #22585      +/-   ##
==========================================
- Coverage   38.17%   37.99%   -0.18%     
==========================================
  Files        2238     2247       +9     
  Lines      111808   112348     +540     
  Branches    15591    15642      +51     
==========================================
+ Hits        42680    42684       +4     
- Misses      65588    66123     +535     
- Partials     3540     3541       +1     

☔ 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.

@claude

This comment was marked as outdated.

nbradbury and others added 6 commits February 11, 2026 10:12
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pass PostStatus enum through PostRsModel instead of converting
to/from strings, eliminating the fragile string matching in
mapStatusLabel.

Remove the redundant LaunchedEffect that called onTabSelected on
every tab recomposition. The initial tab now loads in the
ViewModel init block instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nbradbury
Copy link
Contributor Author

@claude

@claude

This comment was marked as outdated.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nbradbury
Copy link
Contributor Author

The UI event collection doesn't respect Activity lifecycle states

Resolved here: 4493382

nbradbury and others added 6 commits February 12, 2026 08:11
Resolve merge conflicts in ExperimentalFeatures.kt and strings.xml,
keeping the POSTS_RS_LIST flag while removing NAV_MENUS since the
nav menus feature no longer needs gating.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Switch from listWithEditContext to listWithViewContext so users
without edit_posts capability can use the post list feature. The
rendered fields are already HTML-stripped downstream.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sonarqubecloud
Copy link

@nbradbury
Copy link
Contributor Author

Closing this. I misunderstood that the wp-rs post list offers post caching for self-hosted sites, but not wp.com, so this will be redone using caching for just self-hosted.

@nbradbury nbradbury closed this Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants