You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When my navigation block is in a "fallback" state, and then I add a link to it, I see a spinner and I get snackbar notification telling me that a new navigation menu has been created. This is very confusing - I already have a menu don't I??!
What is your proposed solution?
Some options:
Always create a navigation menu CPT when a navigation block is inserted
Create the navigation menu CPT behind the scenes in a silent manner, and disconnect the UI from the database until it has been created.
Add a notification to explain what is happening so that users understand
Create a navigation menu CPT for all sites even if they don't have a navigation block yet
From a UX perspective there isn't much difference between those approaches as all the complexity should be hidden behind the scenes. It should just feel like you're adding to or updating an existing menu. Let me know if I can help with this one at all but sounds like it's a technical decision.
In a discussion with @scruffian this idea came up:
What if we always create a navigation menu post
Instead of having to deal with spinners and weird undo situations (see #46476) we just follow this simple rule. This way the navigation block would be updated so that it: always creates a wp_navigation post:
when there are no classic menus and no block menus, create a wp_navigation post with a page list block in it. Being the only one the block will use it. Create this both when rendering an empty block, or when 1st opening it.
when the theme puts in a template part a navigation block with inner blocks, create a wp-navigation with the inner blocks in it.
In all cases, update the navigation block ref silently and save the template part or post also silently, creating a really seamless experience.
This was completed as a result of #48698 which will now always create a fallback menu for a user unless there are uncontrolled inner blocks present. This means that we should now rarely see the (jarring) state where the block transitions from uncontrolled to controlled.
Activity
draganescu commentedon Jan 11, 2023
Should we try to
SaxonF commentedon Jan 12, 2023
From a UX perspective there isn't much difference between those approaches as all the complexity should be hidden behind the scenes. It should just feel like you're adding to or updating an existing menu. Let me know if I can help with this one at all but sounds like it's a technical decision.
draganescu commentedon Jan 30, 2023
In a discussion with @scruffian this idea came up:
What if we always create a navigation menu post
Instead of having to deal with spinners and weird undo situations (see #46476) we just follow this simple rule. This way the navigation block would be updated so that it: always creates a
wp_navigationpost:wp_navigationpost with a page list block in it. Being the only one the block will use it. Create this both when rendering an empty block, or when 1st opening it.wp-navigationwith the inner blocks in it.In all cases, update the navigation block ref silently and save the template part or post also silently, creating a really seamless experience.
getdave commentedon Apr 19, 2023
This was never completed but may be addressed by #48698.
More context at #48698 (comment)
getdave commentedon Apr 21, 2023
This was completed as a result of #48698 which will now always create a fallback menu for a user unless there are uncontrolled inner blocks present. This means that we should now rarely see the (jarring) state where the block transitions from uncontrolled to controlled.