-
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
Add save/error notifications to Navigation Menu page #21344
Comments
What about a partial success? As in saving a menu item initiates 10 requests and only 8 of them succeeds? Even with the most crafty notification this would still seem broken. I think we should consider taking a step back here, and starting with an atomic save operation which has a binary success / failure result. One idea would be
|
Very true @adamziel. The discussion here about the best way to save menus also ties into what's being discussed on #21964. With partial success, we could consider showing errors on the menu items, but blocks don't really have a generic system for showing errors. I agree a single request for saving would be nice. |
Let's move the discussion there then :-) |
Related PR from Andrei (Adds snackbar notification: #21557) |
Description
Currently when saving a menu on the new Nav Menu page, there's no indication anything happened. Ideally:
I had a look into this initially while working on #21342, I tried creating a react hook that used a store subscription, but it's not trivial to implement so I avoided adding more complexity to that PR.
Part of the difficulty come from the way MenuItems are saved one-by-one:
gutenberg/packages/edit-navigation/src/components/menu-editor/use-navigation-blocks.js
Lines 60 to 83 in 4bbfbc1
A subscription wouldn't know which one of these indicates the final saving of the menu and when to show a snackbar notice.
It might be an idea to move this code to an action generator, like
savePost
in the block editor, and use the same approach for triggering notices:gutenberg/packages/editor/src/store/actions.js
Lines 221 to 296 in 4857ad5
The text was updated successfully, but these errors were encountered: