Skip to content

Add mutations & menu actions to the new wp-rs pages list (Phase 4)#22978

Open
nbradbury wants to merge 5 commits into
trunkfrom
pagesrs-phase4-mutations
Open

Add mutations & menu actions to the new wp-rs pages list (Phase 4)#22978
nbradbury wants to merge 5 commits into
trunkfrom
pagesrs-phase4-mutations

Conversation

@nbradbury

@nbradbury nbradbury commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Description

Adds the per-page overflow menu to the experimental wordpress-rs pages list:

  • View
  • Set Parent
  • Set as Homepage / Posts Page
  • Publish Now
  • Move to Draft
  • Duplicate
  • Share
  • Copy URL
  • Promote with Blaze
  • Move to Trash
  • Delete Permanently.

Action visibility follows the page's own status plus the legacy eligibility rules (the homepage can't be trashed or drafted, homepage settings require a static homepage and admin rights, Blaze requires an eligible site and no password).

Testing instructions

Enable the "New Pages List" experimental feature, then open Site → Pages.

Menu actions:

  1. On the Published tab, open a page's overflow menu
  • Verify View / Share / Copy URL work and the virtual Homepage row offers no Trash or Move to Draft
  1. Trash a page, then delete it permanently from the Trashed tab
  • Verify both show a confirmation dialog first and the lists update without a manual refresh
  1. Publish a draft, and move a published page to draft
  • Verify the page moves between tabs and a snackbar appears
  1. Use Set Parent and pick a new parent
  • Verify the hierarchy re-renders and the picker never offers the page itself or its children
  1. Use Set as Homepage / Set as Posts Page (WP.com site with a static homepage)
  • Verify the virtual rows at the top of the Published tab update
  1. Tap a trashed page
  • Verify it offers to move the page to drafts and opens the editor on confirm
  1. Use Duplicate
  • Verify the editor opens with a copy of the page as a new draft

Adds the per-page overflow menu to the wordpress-rs pages list with the
full legacy action set: View, Set Parent, Set as Homepage / Posts Page,
Publish Now, Move to Draft, Duplicate, Share, Copy URL, Promote with
Blaze, Move to Trash, and Delete Permanently. Destructive actions are
gated behind a PageRsListConfirmation dialog, Set Parent uses a new
bottom-sheet picker, and tapping a trashed page now offers to move it
back to drafts. Action visibility follows the page's own status and the
legacy eligibility rules (homepage protection, Blaze and static-homepage
gating).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@dangermattic

dangermattic commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator
2 Warnings
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

@nbradbury nbradbury changed the title Add mutations & menu actions to the modern pages list (Phase 4) Add mutations & menu actions to the new wp-rs pages list (Phase 4) Jun 12, 2026
@wpmobilebot

wpmobilebot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

🤖 Build Failure Analysis

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

nbradbury and others added 3 commits June 12, 2026 10:01
Set as Homepage / Set as Posts Page now go through the wordpress-rs
/wp/v2/settings endpoint via a new PageRsHomepageSettings bridge,
removing the FluxC SiteOptionsStore dependency and making the actions
work on self-hosted application-password sites (so the menu gating is
widened beyond WP.com). The bridge keeps SiteOptionsStore's semantics:
it reads the live settings to reject sites without a static homepage
and to clear the counterpart slot when reassigning the same page, then
syncs the shared SiteModel and dispatches an update so the rest of the
app stays consistent.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Hide Set as Homepage / Posts Page on WP.com sites without a static
  page on front, matching the legacy list (self-hosted sites still
  defer to the server since those fields aren't synced)
- Collect parent-picker descendants across pages of every status so a
  published descendant reached through a draft intermediate can't be
  chosen as a parent (which would create a cycle)
- Track move-to-draft on confirm rather than dialog-open, and
  set-parent only after the mutation succeeds
- Drop the requireNotNull(site) lazy page service; executePageMutation
  now guards the site itself and hands the service to the operation
- Document the parent picker's loaded-pages-only limitation

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Publishing a duplicated page (or saving editor changes) uploads
through FluxC's UploadService in the background after the editor
closes, which the wordpress-rs collections never see — the new page
didn't appear until a manual refresh. Subscribe to OnPostUploaded and
refresh the tabs when a page of the selected site uploads
successfully, matching the legacy list's PostListEventListener.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@wpmobilebot

wpmobilebot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

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
Build TypeDebug
Versionpr22978-65fa435
Build Number1493
Application IDorg.wordpress.android.prealpha
Commit65fa435
Installation URL6nj8h6v44i3m8
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

wpmobilebot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

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
Build TypeDebug
Versionpr22978-65fa435
Build Number1493
Application IDcom.jetpack.android.prealpha
Commit65fa435
Installation URL6galegjebg0jg
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 27.39726% with 371 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.18%. Comparing base (a88923a) to head (65fa435).

Files with missing lines Patch % Lines
...rdpress/android/ui/pagesrs/PagesRsListViewModel.kt 28.09% 161 Missing and 13 partials ⚠️
...ss/android/ui/pagesrs/screens/PagesRsListScreen.kt 0.00% 53 Missing ⚠️
...roid/ui/pagesrs/screens/PageRsParentPickerSheet.kt 0.00% 48 Missing ⚠️
.../wordpress/android/ui/pagesrs/screens/PageRsRow.kt 0.00% 43 Missing ⚠️
...press/android/ui/pagesrs/PageRsHomepageSettings.kt 29.26% 29 Missing ⚠️
.../wordpress/android/ui/pagesrs/PageRsListUiState.kt 65.78% 13 Missing ⚠️
...rg/wordpress/android/ui/pagesrs/PageRsListEvent.kt 0.00% 8 Missing ⚠️
.../android/ui/pagesrs/screens/PageRsTabListScreen.kt 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            trunk   #22978      +/-   ##
==========================================
- Coverage   37.22%   37.18%   -0.04%     
==========================================
  Files        2330     2333       +3     
  Lines      125667   126173     +506     
  Branches    17115    17194      +79     
==========================================
+ Hits        46777    46922     +145     
- Misses      75104    75452     +348     
- Partials     3786     3799      +13     

☔ View full report in Codecov by Harness.
📢 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 June 12, 2026 20:00
@nbradbury nbradbury marked this pull request as ready for review June 12, 2026 20:00
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