-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 create new UI feedback in Nav block #39219
Merged
Merged
Conversation
This file contains 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
getdave
added
[Type] Enhancement
A suggestion for improvement.
[Block] Navigation
Affects the Navigation Block
labels
Mar 4, 2022
Size Change: +505 B (0%) Total Size: 1.15 MB
ℹ️ View Unchanged
|
14 tasks
getdave
force-pushed
the
fix/create-new-ui-feedback
branch
from
March 7, 2022 11:07
8fafe7b
to
783d65e
Compare
This works great and feels solid, @getdave. Also kudos for the accessibility improvements! |
I tested all the scenarios and this works as described. |
scruffian
approved these changes
Mar 8, 2022
Thank you @javierarce and @scruffian. Unless I receive any further feedback by tomorrow morning UTC I'm going to merge and iterate. |
This was referenced Mar 9, 2022
Confirmation on the fix - it works perfectly on my end. |
82 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[Block] Navigation
Affects the Navigation Block
Needs Accessibility Feedback
Need input from accessibility
[Type] Enhancement
A suggestion for improvement.
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.
Description
Builds on work in #38858 to address part of #37190.
This PR improves the UI feedback provided when creating a new menu using the
Start empty
button.On
trunk
when you click theStart empty
button in the placeholder, the block UI provides little or no feedback that anything is happening and can even feel like it's "frozen".This PR changes things so that
speak()
and/or the<Notice>
component.This is principally achieved by improving the utility of the
useCreateNavigationMenu
hook in order that:await
on thecreate
hook property directly or you can call it and use thestate
property to handle the resolution status. This is important for this hook as it is used in both ways in different areas of the codebase.Testing Instructions
Testing feedback in UI
Start empty
in the placeholder.ref
pointing to awp_navigation
- switch to Code view to validate.Check classic Menu conversion process
As the classic menu conversion relies on the create menu hook we need to validate the conversion still works with the new API for the
useCreateNavigationMenu
hook.Select menu
-> pick a classic menu.trunk
.Testing Uncontrolled Inner Blocks
A Navigation can exist that has uncontrolled inner blocks (for example a pattern or a legacy block). In this case the contents are auto-converted to a
wp_navigation
post and the uncontrolled inner blocks are removed. We need to validate that continues to work.<!-- wp:navigation --><!-- wp:page-list /--><!-- /wp:navigation -->
.ref
to a newwp_navigation
. The uncontrolled inner blocks you pasted are no longer present when switching back to Code View.Screenshots
Before
Notice how even though I'm on a super fast fibre connection, the UI seems to "lock up" when I click
Start empty
. The feedback only happens once the request to create the menu resolves.Screen.Capture.on.2022-03-04.at.13-37-04.mov
After
Notice how the UI immediately reflects the "working" state:
Screen.Capture.on.2022-03-04.at.13-35-00.mov
Types of changes
Checklist:
*.native.js
files for terms that need renaming or removal).