Skip to content

Custom Posts: Show published pages with hierarchy#25353

Open
crazytonyli wants to merge 3 commits intotrunkfrom
task/page-hierarchy
Open

Custom Posts: Show published pages with hierarchy#25353
crazytonyli wants to merge 3 commits intotrunkfrom
task/page-hierarchy

Conversation

@crazytonyli
Copy link
Contributor

Description

In the existing Pages screen, all pages are fetched and reorganized into a tree. This PR implements the same on the custom post list.

Testing instructions

Compare the existing Pages screen with the one backed by the wordpress-rs library. They should show the same list of pages.

@crazytonyli crazytonyli added this to the 26.8 milestone Mar 9, 2026
@crazytonyli crazytonyli requested a review from kean March 9, 2026 02:09
@dangermattic
Copy link
Collaborator

1 Warning
⚠️ View files have been modified, but no screenshot or video is included in the pull request. Consider adding some for clarity.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Mar 9, 2026

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 Number31391
VersionPR #25353
Bundle IDorg.wordpress.alpha
Commitf79ffdc
Installation URL429f5r081o8io
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Mar 9, 2026

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 Number31391
VersionPR #25353
Bundle IDcom.jetpack.alpha
Commitf79ffdc
Installation URL2a83ss7i96dao
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Mar 9, 2026

🤖 Build Failure Analysis

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

@sonarqubecloud
Copy link

Copy link
Contributor

@kean kean left a comment

Choose a reason for hiding this comment

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

I've tested the changes on one of my sites and was not able to get the new screens to show the hierarchy. In addition, some of the pages appear to be missing.

Screenshot 2026-03-10 at 9 03 41 AM Screenshot 2026-03-10 at 9 04 02 AM

}
} else {
ForEach(Array(items.enumerated()), id: \.element.id) { index, item in
let showSubdirectoryIcon: Bool = {
Copy link
Contributor

Choose a reason for hiding this comment

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

(nit) I'd suggest extracting showSubdirectoryIcon and also extracting the two branches for flat/hierarchal data.

/// built once from the complete dataset.
private func fetchAllPages() async {
isBatchSyncing = true
defer { isBatchSyncing = false }
Copy link
Contributor

Choose a reason for hiding this comment

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

The web version bails if there are too many pages. If a site has more than 100 pages, a hierarchal view would be unusable as it would require too much scrolling, so there is no point attempting to show the hierarchy as it would only make the user experience worse. For a site that has a large number of pages, this would also become a performance issue. wdyt about following how the web approaches it?

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