Skip to content

Conversation

@andrewserong
Copy link
Contributor

@andrewserong andrewserong commented Dec 3, 2025

What?

Closes #71128

🚧 🚧 🚧 Note: this is vibe-coded proof of concept β€” not ready for review 🚧 🚧 🚧

Add a PostPickerModal to the editor package, and make it available for use within the parent field (used for selecting page parents) and within the site editor.

This PR is really just to explore how it could work at this stage, where it would be injected, how it could be accessed.

To-do

  • Guard behind an experiment
  • Build out the defaults for fields display, etc

Why?

Currently it can be difficult and fiddly to select a page parent, or select a post or page in different interfaces, and the main solution I see in Gutenberg at the moment is the ComboBox, which doesn't play nicely for larger sites.

This PR currently integrates the modal into the parent field's popover. But it could stand on its own.

How?

  • Add the modal to the editor package
  • Expose it to consumers via an openPostPicker function that gets injected into block editor settings (using a postPickerKey)
  • Fields or any area that doesn't have access to the editor package, but does have access to the block editor settings, can call this to open a post picker modal
  • The openPostPicker function can be called with postType, excludePostId, and an onSelect callback (and a title prop), but this could conceivably include any of the customisation we might need for the query within the modal

Testing Instructions

  • Enable the Quick Edit experiment
  • Create and publish a few pages
  • Open up the site editor and navigate to pages
  • Within the table view, click the sidebar button to enable quick edit, and select one of the pages
  • You should be able to access the big page picking modal view the parent field
  • You should be able to search and select pages
  • After selecting, you should be able to clear the selection via the Combobox
  • Go to edit a page within the site editor and use the right hand sidebar to edit the parent field
  • It should also allow you to use the modal

Screenshots or screencast

2025-12-03.17.06.35.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Package] Fields /packages/fields [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a generalised PostPicker component to allow selecting post(s) from a modal

2 participants