-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Command Palette: Make navigation commands available on all screens #71335
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: Make navigation commands available on all screens #71335
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've moved the command functions to core commands package but |
|
Thanks! |
|
Updated ✅ |
|
@yashjawale Thanks for the update! The changes look good, but this PR is slightly related to #71476 and will likely cause conflicts. Let's move forward with this PR while taking into account the situation in 71476. |
packages/core-commands/src/site-editor-global-styles-commands.js
Outdated
Show resolved
Hide resolved
packages/core-commands/src/site-editor-global-styles-commands.js
Outdated
Show resolved
Hide resolved
Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com>
Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com>
| label: __( 'Pages' ), | ||
| label: __( 'Go to: Pages' ), |
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.
Unfortunately, it appears that the label overlaps with a command registered via the Menu API. Ideally, it should be moved to site-editor.php?p=%2Fpage in the site editor, but we may have no choice but to delete this command and move it to edit.php?post_type=page.
cc @youknowriad
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.
I think it's ok to remove the command for now.
The alternative is to override the other command (unregister it and register this one instead when we're in the site editor)
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.
The alternative is to override the other command (unregister it and register this one instead when we're in the site editor)
@yashjawale Would you like to try this approach?
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.
Yes I'll give that a try
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.
For me unregistering didn't seem to work, it was getting registered again...
Instead I've tried to filter commands in admin-navigation-commands.js itself which worked
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.
Wow, I realized that we need a lot of code to override. In this PR, how about removing the "Go to: Pages" command from the edit-site and respecting the menu command? Perhaps we can try a better approach in a follow-up PR.
Update: We should be able to address the problem above if #71537 is merged. |
|
Since #71537 is merged should I move custom CSS command back to core commands? |
I think this task can be addressed separately in a follow-up. |
This reverts commit 4612e34.
|
@yashjawale Can you delete this and this too? After that, we should be able to ship this PR. |
|
Removed the override logic |
t-hamano
left a comment
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.
LGTM! Thank you for your work on this PR until the end.
…71335) * initial draft: move navigation commands to core commands * Editor: Update command palette test for custom CSS navigation * fix: move custom css commands back to edit-site * fix: update custom CSS command label Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com> * fix: update go to styles command label Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com> * fix: update navigation command labels with colon * fix: move commands from separate file to existing ones * fix: re-add global styles navigation commands to site editor * fix: remove redundant global styles navigation command from site editor * fix: implement pages override command in site editor to resolve Menu API conflict * fix: filter Pages command in site editor navigation * Revert "fix: filter Pages command in site editor navigation" This reverts commit 4612e34. * revert: remove pages command override --------- Co-authored-by: yashjawale <yashjawale@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
…ordPress#71335) * initial draft: move navigation commands to core commands * Editor: Update command palette test for custom CSS navigation * fix: move custom css commands back to edit-site * fix: update custom CSS command label Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com> * fix: update go to styles command label Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com> * fix: update navigation command labels with colon * fix: move commands from separate file to existing ones * fix: re-add global styles navigation commands to site editor * fix: remove redundant global styles navigation command from site editor * fix: implement pages override command in site editor to resolve Menu API conflict * fix: filter Pages command in site editor navigation * Revert "fix: filter Pages command in site editor navigation" This reverts commit 4612e34. * revert: remove pages command override --------- Co-authored-by: yashjawale <yashjawale@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: youknowriad <youknowriad@git.wordpress.org>

What?
Closes #71318
This PR moves navigation commands out of
@wordpress/edit-siteto the@wordpress/core-commandspackage.The move makes the command available outside of site editor
Why?
There are some specific commands for the site editor. Some commands should be available outside the editor as well, since they are essentially navigations that involve changing the URL.
Part of efforts to make command palette available across the dashboard
How?
The relevant code related to navigation commands are moved to
@wordpress/core-commandspackageAlso the labels of commands are updated with
Go to _prefix, except for Style revisions, View siteTesting Instructions
Cmd/Ctrl+K& search for the above commandsScreenshots or screencast