Improve feedback on Nav Menu deletion#39677
Merged
Conversation
getdave
commented
Mar 23, 2022
|
Size Change: -1 B (0%) Total Size: 1.21 MB
ℹ️ View Unchanged
|
da28146 to
8bba457
Compare
8bba457 to
98cca66
Compare
draganescu
approved these changes
Mar 28, 2022
Contributor
draganescu
left a comment
There was a problem hiding this comment.
This does what it says, code wise one nit, that may be just my opinion. 👌🏻
| canUserDeleteNavigationMenu && ( | ||
| <NavigationMenuDeleteControl | ||
| onDelete={ resetToEmptyBlock } | ||
| onDelete={ ( deletedMenuTitle = '' ) => { |
Contributor
There was a problem hiding this comment.
Nitpick: can't we just get the title from the edit component instead of having the NavigationMenuDeleteControl forced to "know" the title?
Contributor
Author
There was a problem hiding this comment.
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.
82 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
⚠️ 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
Advancedtab, 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 emptyAdvancedpanel in block inspector controls.DeletebuttonScreenshots or screencast