-
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
Editor: Improve conditions for displaying new page assembler #68852
Conversation
return; | ||
} | ||
|
||
const isFreshPage = ! isEditedPostDirty() && isEditedPostEmpty(); |
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 effect should react to this state. Check if the page is freshly created when the component is rendered.
Size Change: -3 B (0%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
setIsInserterOpened( { | ||
tab: 'patterns', | ||
category: 'core/starter-content', | ||
} ); | ||
} | ||
}, [ postId, shouldEnable, setIsInserterOpened ] ); | ||
}, [ | ||
postId, |
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 postId
ensures the effect re-runs when the user switches pages in the Site Editor or creates a new page via Command Palette.
Flaky tests detected in c898a6a. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12931643327
|
I think this feature should have a really good e2e. It's one of those when regression can annoy the user. |
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. |
@WordPress/gutenberg-core, this is ready for the review. |
I tested the two cases in the instructions and it works as described. |
Thank you, @carolinan! Do you mind approving the PR? |
What?
Part of #68736.
Solves the following cases when the new page "assembler" shouldn't be displayed (again):
Originally fixed via #54245, but accidentally regressed in #60745. Page creation doesn't use the
auto-draft
status in the Site Editor, so theisCleanNewPost
selector was no longer applicable.Testing Instructions
Instruction one
Instruction two
Testing Instructions for Keyboard
Same.
Screenshots or screencast