-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Command Palette: "Add new page" within the site editor creates new page in site editor #65476
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
I added the backport to WP 6.7 since this is a small, but absolutely fantastic value-add. (In my opinion) 😄 |
Size Change: -2.17 kB (-0.12%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
Okay, the command now lives in site editor and the e2e should pass 🤞🏻 Thanks @andrewserong ! |
Thanks Ramon! I'll take this for a spin tomorrow 👍 |
packages/edit-site/src/hooks/commands/use-edit-mode-commands.js
Outdated
Show resolved
Hide resolved
packages/edit-site/src/hooks/commands/use-edit-mode-commands.js
Outdated
Show resolved
Hide resolved
Just pushed a tiny commit to update the package-lock file as the linter was complaining 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is testing beautifully, feels really nice being kept in the site editor to me, and the command still correctly navigates to the page editor when editing a post in the post editor 👍
Site editor flow:
2024-09-20.10.14.27.mp4
LGTM! 🚀
…ge in site editor (#65476) The add page command will now create a new page depending on context: in the post editor it will redirect to `postType=page` in the post editor as it did previously. In the site editor however, it will open a new page without redirecting to the post editor. --------- Co-authored-by: ramonjd <ramonopoly@git.wordpress.org> Co-authored-by: andrewserong <andrewserong@git.wordpress.org> Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
I just cherry-picked this PR to the wp/6.7 branch to get it included in the next release: a784d78 |
Resolves #65473
What?
First pass at forking the add page command depending on context.
Why?
@andrewserong is right - it's a bit disconcerting to be taken away from the site editor when creating a new page.
How?
Forking the command based on the environment (whether
site-editor.php
is in the URL, which seems to be the most common mode of detection)Testing Instructions
In the site editor, open the command center (Cmd/Ctrl + K) and type/select "Add new page"
A new page should be created in the site editor.
Do the same in the post editor, you should stay in the post editor.
Testing Instructions for Keyboard
Screenshots or screencast
Kapture.2024-09-19.at.13.10.14.mp4