-
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
Update unsaved navigation block flow #35976
Conversation
Size Change: +107 B (0%) Total Size: 1.07 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.
This is working well! Tested both with patterns in Site Editor and with existing Navigation blocks in Post Editor.
The Post Editor is showing a PHP message:
Notice: Trying to get property 'post_status' of non-object in /var/www/html/wp-content/plugins/gutenberg/build/block-library/blocks/navigation-submenu.php on line 134
Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/gutenberg/build/block-library/blocks/navigation-submenu.php:134) in /var/www/html/wp-admin/admin-header.php on line 9
but that's also happening on trunk, so not caused by these changes.
> | ||
{ __( | ||
'The navigation block has been updated to store data in a similar way to a reusable block. Please use the upgrade option to save your navigation block data and continue editing your block.' | ||
{ __( 'Save this block to continue editing.' ) } |
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.
This message is great for purposes of nav placeholders in patterns, but can be a bit confusing for existing navigation blocks (why do I suddenly need to save this block again?). I suppose we're not able to distinguish between the two? Not a blocker for this PR, but something to iterate on maybe.
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.
Yeah, I'm not sure what the best option is here. Let's continue improving it. It might be that this message isn't even a thing in the next iterations.
Took it for a quick spin, and seeing this: It's good to see patterns working as they are, and compared to trunk this is a good step forward. UX wise it needs further refinement. The big message being output when selecting a navigation block could be better, but mostly it shifts the layout which is a general problem that we've been looking at fixing, and is also problematic for the current two step placeholder. In general I'm unsure whether we need absolutely have to save every navigation ever made, and I'd like to explore what it could look like if we were a bit more lenient allowing you to save a menu as reusable after the fact. But for the purposes of enhancing what's already merged, and seeking out the boundaries of that approach, this seems like a natural next step. Let's keep the initial issue open though, as we keep looking for solutions 👍 👍 |
Thanks for the feedback, lets merge this and then continue discussing further improvements. |
Description
Improves the problem described in #35947.
#35746 included a prompt for the user to 'Upgrade' a navigation block that uses 'uncontrolled' inner blocks (inner blocks that are not saved to the wp_navigation post type). Unfortunately this prompt was visible in pattern previews.
This PR streamlines the prompt and makes it only show on block selection so that it doesn't appear in the preview of patterns.
I don't intend this to be a perfect fix, but it should at least be an immediate improvement to the way patterns that include the navigation block appear.
How has this been tested?
Screenshots
Before
After
Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist:
*.native.js
files for terms that need renaming or removal).