Skip to content
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

Fix: Show Meta Boxes at the bottom of the screen regardless of the current rendering mode #66508

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/edit-post/src/components/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,8 @@ function Layout( {
const { isZoomOut } = unlock( select( blockEditorStore ) );
const { getEditorMode, getRenderingMode } = select( editorStore );
const isRenderingPostOnly = getRenderingMode() === 'post-only';
const isRenderingTemplateLocked =
getRenderingMode() === 'template-locked';

return {
mode: getEditorMode(),
Expand All @@ -426,7 +428,7 @@ function Layout( {
isDistractionFree: get( 'core', 'distractionFree' ),
showMetaBoxes:
! DESIGN_POST_TYPES.includes( currentPostType ) &&
isRenderingPostOnly,
( isRenderingPostOnly || isRenderingTemplateLocked ),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you refresh my memory here? Do we have rendering modes besides post-only and template-locked?

If not, then I think we can remove rendering mode checks from this condition.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not a 100% certain but I thought that the "edit template" portion in the post editor technically uses template-only as the rendering mode 🤔

@youknowriad may be able to help clarify this though :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Judging from the comment of the setRenderingMode action, there should be no modes other than post-only and template-locked. The template-only mode has been removed in #57700. I've tried searching Gutenberg in general for getRenderingMode() or setRenderingMode(, but I can't find any other modes.

Therefore, I think this check should be removable, but I will ping @stokesman to double check.

Copy link
Contributor

@stokesman stokesman Oct 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing it looks safe to me. I quickly checked with "edit template" and its rendering mode is "post-only". The condition that matters in that case is the post type being "wp_template" so it will still not show the meta boxes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks all! I just updated the code to remove the check entirely 👍 :)

isWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ),
templateId:
supportsTemplateMode &&
Expand Down
Loading