Styles Canvas: Refactor state and rendering#72635
Conversation
|
Size Change: -388 B (-0.02%) Total Size: 2.27 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in cafd9a4. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/18769761283
|
c22181d to
30d6d6f
Compare
|
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. |
- Modified Revisions, StyleBook, StylesCanvas, and their related components to utilize forwardRef for better ref forwarding. - Adjusted props in StylesCanvasRevisions and StylesCanvasStyleBook to accept refs. - Cleaned up imports and component definitions for consistency.
ramonjd
left a comment
There was a problem hiding this comment.
This is working as described for me.
Thanks for cleaning up the editor canvas string value spaghetti.
There are some ref errors to contend with.
I can push a commit to fix those if you don't mind. Feel free to roll back if you think there's a better way.
|
Thanks for these additional fixes, I appreciate it. |
Co-authored-by: youknowriad <[email protected]> Co-authored-by: ramonjd <[email protected]>
Related to #72317 with the final goal of bringing global styles to the post editor.
What?
Refactors the styles canvas state management and rendering architecture in the Site Editor to simplify the codebase. This is a preparation to moving the stylebook and the style-canvas to the editor package (to be used in edit-post too)
Why?
The previous EditorCanvasContainerView implementation had several issues:
How?
State Management
Component Architecture
Testing Instructions
- Open the stylebook
- Navigate to a different screen (Templates, Pages, Patterns)
- Verify the stylebook overlay closes automatically
- Navigate back to Styles
- Verify you can open stylebook again
- Open a post or page in the editor
- Open the Styles panel from the sidebar
- Toggle the stylebook - verify it works correctly
- Close and reopen multiple times