PostPickerModal: Try a generalised post picker modal in the site editor #73710
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
Closes #71128
π§ π§ π§ Note: this is vibe-coded proof of concept β not ready for review π§ π§ π§
Add a PostPickerModal to the
editorpackage, and make it available for use within theparentfield (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
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
parentfield's popover. But it could stand on its own.How?
editorpackageopenPostPickerfunction that gets injected into block editor settings (using apostPickerKey)editorpackage, but does have access to the block editor settings, can call this to open a post picker modalopenPostPickerfunction can be called withpostType,excludePostId, and anonSelectcallback (and a title prop), but this could conceivably include any of the customisation we might need for the query within the modalTesting Instructions
parentfieldparentfieldScreenshots or screencast
2025-12-03.17.06.35.mp4