-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Style Book: allow activation when the canvas mode is "view" #62212
Conversation
…', or the editor view is not currently editable) when rendering the editor canvas container slot is a regression. Removing.
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. |
@@ -160,7 +160,7 @@ export default function EditorInterface( { | |||
|
|||
<EditorContentSlotFill.Slot> | |||
{ ( [ editorCanvasView ] ) => | |||
! isPreviewMode && editorCanvasView ? ( | |||
editorCanvasView ? ( |
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 only "views" are revisions and style book.
Style book is the only "view" that can be activated in edit and view mode.
This PR reverts the functionality to how it was before. This condition could be tightened up in this PR to check whether the style book is open too, but I don't believe it's necessary.
@youknowriad gave some great advice over in https://github.com/WordPress/gutenberg/pull/62146/files#r1621762342 about how the whole view system could be refactored. I haven't digested it all yet, but maybe things could be improved iteratively and we just fix the regression here as it is.
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.
That change is fine by me 👍
Size Change: -1 B (0%) Total Size: 1.74 MB
ℹ️ View Unchanged
|
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.
Thanks for the quick fix! Now working as expected.
P.S. Should we backport this PR to Gutenberg RC or WP Beta?
…', or the editor view is not currently editable) when rendering the editor canvas container slot is a regression. Removing. (WordPress#62212) Co-authored-by: ramonjd <[email protected]> Co-authored-by: t-hamano <[email protected]> Co-authored-by: youknowriad <[email protected]>
…', or the editor view is not currently editable) when rendering the editor canvas container slot is a regression. Removing. (#62212) Co-authored-by: ramonjd <[email protected]> Co-authored-by: t-hamano <[email protected]> Co-authored-by: youknowriad <[email protected]>
…', or the editor view is not currently editable) when rendering the editor canvas container slot is a regression. Removing. (#62212) Co-authored-by: ramonjd <[email protected]> Co-authored-by: t-hamano <[email protected]> Co-authored-by: youknowriad <[email protected]>
…', or the editor view is not currently editable) when rendering the editor canvas container slot is a regression. Removing. (WordPress#62212) Co-authored-by: ramonjd <[email protected]> Co-authored-by: t-hamano <[email protected]> Co-authored-by: youknowriad <[email protected]>
This was cherry-picked to the wp/6.6 branch. |
Fixes #62204
What?
Remove the
! isPreviewMode
check before rendering contents of theeditorCanvasView
slot.The effect is that the style book can be opened from the global styles side bar in preview mode when switching style variations.
Why?
Before #62146, there was no check for preview mode when rendering the editor canvas container slot.
What is preview mode?
It's another way of saying
canvasMode === 'view'
, which is a another way of saying that the editor view is not currently editable.Thanks to @t-hamano for catching it.
Testing Instructions
2024-06-03.12.16.11.mp4