-
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
Post Editor: Rely on the editor store for the template mode state #56716
Conversation
Size Change: +134 B (0%) Total Size: 1.72 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.
✅ Default rendering mode in post editor is post-only
✅ Switching templates works for me in post editor
✅ Toggling template editing on and off works as expected
Nice!
I just left a couple of tiny questions...
|
||
export default function WelcomeGuideMenuItem() { | ||
const isTemplateMode = useSelect( | ||
( select ) => select( editPostStore ).isEditingTemplate(), | ||
( select ) => select( editorStore ).getRenderingMode() !== 'post-only', |
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.
Just checking, does this check match the previous isEditingTemplate()
? I noticed it will included template-locked - where the post is editable but the template locked.
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.
In the post editor, there were only two modes (not like the site editor), so yeah, it will have the same effect for now.
0d82a19
to
6393850
Compare
Any approvals here :) |
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.
🚢
Flaky tests detected in 6393850. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7097383703
|
Related #52632
Follow-up to #56671
What?
This PR updates the post editor, to avoid relying on its own store for the "template mode" state, instead it uses the "editor" package rendering modes directly similarly to the site editor.
Why?
This PR is a preparation work before unifying the UI to switch modes... between post and site editors. The UI component will be in the editor store and it will directly update its state.
Testing Instructions
1- Check the post editor and its "template mode" (edit template link from the "template" panel on the settings sidebar)