Skip to content

Add Site Editor homepage row to the new pages list#23027

Open
nbradbury wants to merge 5 commits into
trunkfrom
new-pages-virtual-homepage
Open

Add Site Editor homepage row to the new pages list#23027
nbradbury wants to merge 5 commits into
trunkfrom
new-pages-virtual-homepage

Conversation

@nbradbury

@nbradbury nbradbury commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Description

The legacy pages list shows a special "Homepage" row for block-based themes that opens the Site Editor web view instead of the block editor, gated by siteEditorMVPFeatureConfig.isEnabled() && isBlockBasedTheme. The new (RS) pages list (org.wordpress.android.ui.pagesrs) only rendered virtual HOMEPAGE/POSTS_PAGE rows for assigned static pages and had no equivalent.

Testing instructions

Edit homepage opens the Site Editor:

  1. Enable the new pages list and the site_editor_mvp flag.
  2. Select a site whose homepage uses a block-based theme.
  3. Open My Site → Pages → Published.
  • A "Homepage" row appears at the top with the "…will open in the web editor" subtitle.
  1. Tap the row.
  • The Site Editor opens in a web view (site-editor.php?canvas=edit); WP.com sites use global WPCOM credentials.
homepage

The legacy pages list shows a block-theme homepage row that opens the
Site Editor web view, gated by SiteEditorMVP + isBlockBasedTheme. The
new RS pages list lacked it. This adds a third Virtual.Kind (SITE_EDITOR)
behind the same gate, opening the Site Editor on tap.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dangermattic

dangermattic commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator
1 Warning
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

nbradbury and others added 4 commits June 22, 2026 13:30
The block-theme state is only used to show the SITE_EDITOR row, so there's
no reason to dispatch a FetchEditorTheme request on every pages-list visit
for users who don't have the flag enabled.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Detect the row by its sentinel id instead of a tab-state lookup, so the
  tap works regardless of list state and is unit-testable.
- Guard against a rapid double-tap launching two web views.
- Track PAGES_EDIT_HOMEPAGE_ITEM_PRESSED on open, matching the legacy list.
- Add ViewModel tests for the emitted event and analytics.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Collapse onEditorThemeChanged guards to stay within the return-count limit.
- Compute empty actions for the SITE_EDITOR row instead of an early return.
- Extract the row's text resolution into a helper to keep PageContentItem
  under the cyclomatic-complexity threshold.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@wpmobilebot

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
Versionpr23027-adf89f9
Build Number1497
Application IDcom.jetpack.android.prealpha
Commitadf89f9
Installation URL3i8ma0bbat9v8
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

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
Versionpr23027-adf89f9
Build Number1497
Application IDorg.wordpress.android.prealpha
Commitadf89f9
Installation URL4aqj1vvqmso58
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 34.14634% with 54 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.45%. Comparing base (c51dd34) to head (adf89f9).

Files with missing lines Patch % Lines
...rdpress/android/ui/pagesrs/PagesRsListViewModel.kt 31.70% 25 Missing and 3 partials ⚠️
.../wordpress/android/ui/pagesrs/screens/PageRsRow.kt 0.00% 26 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            trunk   #23027   +/-   ##
=======================================
  Coverage   37.44%   37.45%           
=======================================
  Files        2325     2325           
  Lines      125520   125586   +66     
  Branches    17227    17244   +17     
=======================================
+ Hits        47007    47034   +27     
- Misses      74693    74729   +36     
- Partials     3820     3823    +3     

☔ 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 marked this pull request as ready for review June 22, 2026 18:12
@nbradbury nbradbury requested a review from adalpari June 22, 2026 18:12
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