-
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
Editor: Unify the editor commands between post and site editors #59005
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. |
Size Change: -496 B (0%) Total Size: 1.71 MB
ℹ️ View Unchanged
|
Hey @youknowriad 👋 , the problem seems related to importing the package diff --git forkSrcPrefix/packages/editor/src/components/commands/index.native.js forkDstPrefix/packages/editor/src/components/commands/index.native.js
new file mode 100644
index 0000000000000000000000000000000000000000..23e48951a0329b7adf89c62e428997c2caefda47
--- /dev/null
+++ forkDstPrefix/packages/editor/src/components/commands/index.native.js
@@ -0,0 +1,2 @@
+// Commands are disabled in the mobile native version.
+export default function useCommands() {} Let me know if you want to apply the workaround or if you rather that I push the change. Thanks 🙇 ! |
I'm guessing mobile doesn't care about "commands" at the moment. So please feel free to push that. Thank you |
Exactly, we don't provide that feature so we can disable it. Sure, I've just pushed the change: bc60e67 |
Flaky tests detected in 2a3cee5. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7916575794
|
b8910e4
to
d6c82ac
Compare
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.
A few things:
- There is a commit with a conflict.
- I wonder if this is not the right PR to decouple the top toolbar pref from DFM too?
- While the unification of code view works great experiencing it is not great:
- go to post editor
- switch to code view
- exit post editor
- go to site editor
- click the frame
- notice you end up in code view
- this feels unexpected: to start with a preview (in any of the sidebar routes) and end up with code view
- maybe worth a 👍🏻 from @WordPress/gutenberg-design ?
packages/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js
Show resolved
Hide resolved
This was solved
No, the PR is already too big
This exists in trunk too so let's not block this PR because of that. |
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.
Approving this as the only real blocker was the committed conflict everything else can be a follow up.
Related #52632
What?
This continues the unification work between post and site editors. This time, instead of duplicating the similar editing commands between editPost and editSite, we're moving them to a common useCommands hook that is automatically added to each EditorProvider.
A couple of related items had to be done:
Testing Instructions
1- Ensure that switching modes (visual/code) works in both site and post editors.
2- Ensure that toggling distraction mode works in both editors.
3- Try the commands that were moved to the editor package.