Skip to content

RS Post Settings: Read only settings screen#22660

Merged
nbradbury merged 20 commits intotrunkfrom
feature/rs-postsettings-readonly
Mar 6, 2026
Merged

RS Post Settings: Read only settings screen#22660
nbradbury merged 20 commits intotrunkfrom
feature/rs-postsettings-readonly

Conversation

@nbradbury
Copy link
Contributor

@nbradbury nbradbury commented Mar 5, 2026

Summary

  • Add a read-only, edge-to-edge Post Settings screen accessible from the RS post list menu
  • Display post metadata: status, date, password, author, categories, tags, featured image, sticky, format, slug, and excerpt
  • Async fields (author, categories, tags, featured image) show inline progress spinners while loading and error states on failure

Note: The UI when there is no featured image is temporary. It will eventually be replaced by a button for setting the featured image.

Test plan

  • Enable RS Post List experimental feature
  • Open a published post's menu and tap "Settings"
  • Verify all fields display correctly with brief loading spinners for async fields (tags, categories, author name)
  • Verify featured image renders full-width with rounded corners
  • Verify empty featured image and excerpt show dimmed "None" text
Screen_recording_20260306_073647.mp4

@dangermattic
Copy link
Collaborator

dangermattic commented Mar 5, 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 PostRsSettingsViewModel is missing tests, but unit-tests-exemption label was set to ignore this.
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Mar 5, 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-03-06 17:27:07.029250180 +0000
+++ ./build/reports/diff_manifest/WordPress/wordpressVanillaRelease/head_manifest.txt	2026-03-06 17:27:12.389252378 +0000
@@ -413,6 +413,10 @@
             android:label=""
             android:theme="@style/WordPress.NoActionBar" />
         <activity
+            android:name="org.wordpress.android.ui.postsrs.PostRsSettingsActivity"
+            android:label=""
+            android:theme="@style/WordPress.NoActionBar" />
+        <activity
             android:name="org.wordpress.android.ui.pages.PagesActivity"
             android:label="@string/my_site_btn_site_pages"
             android:launchMode="singleTop"

Go to https://buildkite.com/automattic/wordpress-android/builds/25350/canvas?sid=019cc426-11a1-4530-9bdc-57aa09b21a95, click on the Artifacts tab and audit the files.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Mar 5, 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-03-06 17:26:57.204578270 +0000
+++ ./build/reports/diff_manifest/WordPress/jetpackVanillaRelease/head_manifest.txt	2026-03-06 17:26:59.634586648 +0000
@@ -607,6 +607,10 @@
             android:label=""
             android:theme="@style/WordPress.NoActionBar" />
         <activity
+            android:name="org.wordpress.android.ui.postsrs.PostRsSettingsActivity"
+            android:label=""
+            android:theme="@style/WordPress.NoActionBar" />
+        <activity
             android:name="org.wordpress.android.ui.pages.PagesActivity"
             android:label="@string/my_site_btn_site_pages"
             android:launchMode="singleTop"

Go to https://buildkite.com/automattic/wordpress-android/builds/25350/canvas?sid=019cc426-11a2-479b-92ce-ea7ca7c1e5d6, click on the Artifacts tab and audit the files.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Mar 5, 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
Versionpr22660-78119e5
Build Number1486
Application IDcom.jetpack.android.prealpha
Commit78119e5
Installation URL7dq53nibcahbg
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Mar 5, 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
Versionpr22660-78119e5
Build Number1486
Application IDorg.wordpress.android.prealpha
Commit78119e5
Installation URL4ihpknj2eeipo
Note: Google Login is not supported on these builds.

nbradbury and others added 9 commits March 6, 2026 05:27
Replace raw numeric IDs with actual category/tag names by fetching
term data via the wordpress-rs terms API. Adds cached resolution
methods to PostRsRestClient following the same pattern used for
author names and featured images.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove unused UiState fields (status, format, authorId), consolidate
duplicate resolve methods into a single resolveTermNames helper,
collapse fetchCategoryNames/fetchTagNames wrappers into a single
public fetchTermNames method, and remove unused fillMaxWidth import.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Authors lack edit permissions on terms, causing a 403 error and
leaving categories/tags stuck on "Loading". Switch from
listWithEditContext to listWithViewContext since we only need
the term id and name.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace raw string/list fields with FieldState sealed interface for
author, categories, tags, and featured image. Shows a small spinner
while resolving and an error message on failure instead of silently
getting stuck.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The section header already provides the "Featured image" title, so
drop the redundant headline from the loaded image row and render the
image full-width with rounded corners.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move dimmed color to supporting text instead of headline so both
featured image and excerpt "None" labels have the same size and color.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add consistent "None" placeholder to categories, tags, author,
slug, and password empty states matching featured image and excerpt.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fixes detekt LongMethod violation by splitting loadPost into smaller
focused methods.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nbradbury nbradbury force-pushed the feature/rs-postsettings-readonly branch from c80ffae to 45fc880 Compare March 6, 2026 10:29
nbradbury and others added 8 commits March 6, 2026 05:36
Use MutableStateFlow.update {} for atomic read-modify-write on
concurrent async field resolution, and replace hardcoded English
post format strings with existing string resources.

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>
Add error recovery with full-screen retry button and tap-to-retry on
individual field errors. Render categories and tags as Material3 chips
using FlowRow. Add shimmer placeholder and 16:9 aspect ratio for
featured image. Make excerpt expandable when text overflows. Add
accessibility announcements on loading states and bottom padding.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Enable edge-to-edge display and move the featured image to the top
of the screen as a full-bleed hero image with a floating back button.
When no featured image is loaded, the screen falls back to the
standard TopAppBar layout.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Always use the hero layout for Post Settings content. When there is
no featured image, show a full-width "Featured image not set."
placeholder at the top instead of the inline section. Remove the
now-unused FeaturedImageField and FeaturedImageRow composables.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove dead code (unused onClick param, FEATURED_IMAGE retry branch),
extract shared AsyncFieldRow composable to deduplicate Empty/Loading/Error
handling, and fix Photon URLs to use screen width for hero images.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add missing divider after author field, add accessibility click
labels to ErrorFieldRow and ExpandableSettingsRow, and show distinct
error message when featured image fails to load.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nbradbury nbradbury marked this pull request as ready for review March 6, 2026 16:05
@nbradbury nbradbury requested a review from adalpari March 6, 2026 16:05
Reuse the shared toLabel() extension in formatStatusLabel() instead
of duplicating the PostStatus-to-string-resource mapping.

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

codecov bot commented Mar 6, 2026

Codecov Report

❌ Patch coverage is 0.39012% with 766 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.01%. Comparing base (f9a59e0) to head (78119e5).
⚠️ Report is 1 commits behind head on trunk.

Files with missing lines Patch % Lines
...android/ui/postsrs/screens/PostRsSettingsScreen.kt 0.00% 473 Missing ⚠️
...ress/android/ui/postsrs/PostRsSettingsViewModel.kt 0.00% 204 Missing ⚠️
...dpress/android/ui/postsrs/data/PostRsRestClient.kt 0.00% 32 Missing ⚠️
...ordpress/android/ui/postsrs/PostRsListViewModel.kt 0.00% 30 Missing ⚠️
...dpress/android/ui/postsrs/PostRsSettingsUiState.kt 0.00% 23 Missing ⚠️
...wordpress/android/ui/main/BaseAppCompatActivity.kt 0.00% 1 Missing ⚠️
...rg/wordpress/android/ui/postsrs/PostRsListEvent.kt 0.00% 1 Missing ⚠️
.../wordpress/android/ui/postsrs/PostRsListUiState.kt 75.00% 1 Missing ⚠️
...press/android/ui/postsrs/screens/PostRsListItem.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            trunk   #22660      +/-   ##
==========================================
- Coverage   38.25%   38.01%   -0.24%     
==========================================
  Files        2265     2268       +3     
  Lines      115992   116726     +734     
  Branches    16101    16184      +83     
==========================================
+ Hits        44368    44371       +3     
- Misses      67987    68718     +731     
  Partials     3637     3637              

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

@adalpari
Copy link
Contributor

adalpari commented Mar 6, 2026

Just noting down that WP.COM sites are showing a different screen than the one shown in the test video. Is that expected?

Screenshot_20260306-175629

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.

Looking good!
Left a note about a different UI not contemplated in the tests, so I'm not sure we are aware of it. Not a blocker.

@nbradbury
Copy link
Contributor Author

Just noting down that WP.COM sites are showing a different screen than the one shown in the test video. Is that expected?

Strange, that's a wp.com site in that video. Your screenshot looks like an earlier version of this PR. Can you pull changes?

@nbradbury
Copy link
Contributor Author

This is how that post should look.
Screenshot_20260306_121311

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

sonarqubecloud bot commented Mar 6, 2026

@adalpari
Copy link
Contributor

adalpari commented Mar 6, 2026

Strange, that's a wp.com site in that video. Your screenshot looks like an earlier version of this PR. Can you pull changes?

You are right. Odd that the "Setting options" was visible but showing the old flow, right? Maybe I was in an outdated commit of the branch?

I can confirm it works as expected

@nbradbury nbradbury merged commit 5004b8a into trunk Mar 6, 2026
24 checks passed
@nbradbury nbradbury deleted the feature/rs-postsettings-readonly branch March 6, 2026 17:53
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.

4 participants