-
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
Improve feedback on Nav Menu deletion #39677
Conversation
Size Change: -1 B (0%) Total Size: 1.21 MB
ℹ️ View Unchanged
|
da28146
to
8bba457
Compare
8bba457
to
98cca66
Compare
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 does what it says, code wise one nit, that may be just my opinion. 👌🏻
@@ -794,7 +798,18 @@ function Navigation( { | |||
{ hasResolvedCanUserDeleteNavigationMenu && | |||
canUserDeleteNavigationMenu && ( | |||
<NavigationMenuDeleteControl | |||
onDelete={ resetToEmptyBlock } | |||
onDelete={ ( deletedMenuTitle = '' ) => { |
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.
Nitpick: can't we just get the title from the edit component instead of having the NavigationMenuDeleteControl
forced to "know" the title?
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.
I guess we could. I suppose it's just that
const [ title, updateTitle ] = useEntityProp(
'postType',
'wp_navigation',
'title'
);
...requires that we're within an EntityProvider
. edit.js
isn't within that context.
⚠️ This PR currently relies on #39683. Once that is merged this PR will be testable.✅What?
This PR adds feedback when the user deletes a Navigation menu via the block.
Now when the menu is deleted a notice is displayed providing both auditory and visual confirmation that the operation succeeded.
Why?
Previously when deleting the menu using the Nav block inspector controls under the
Advanced
tab, there was no feedback that the operation had succeeded other than the block returning to a given "resting" state. That's not really good enough. Moreover, it provides zero feedback for users of assistive tech who may not be able to perceive that change.How?
When the menu is successfully deleted a message is shown.
Testing Instructions
Start empty
Advanced
panel in block inspector controls.Delete
buttonScreenshots or screencast