-
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
Navigation: Hide loading when overlay menu is selected #64262
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +17 B (0%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
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 seems like a good UX enhancement. Thanks for the PR.
What?
Hides navigation loading spinner when the option to always display the overlay menu is selected.
Why?
To decrease the amount of jumping caused by the navigation block during the loading process. This is especially valuable for rendering pattern previews when the navigation block is used in a pattern.
Found while working on #44750.
How?
Right now, if the user has a navigation block with the "always" option set, they'll see a spinner and then a navigation menu. However, we can display the menu icon immediately, and the loading will still happen in the background. This is what this PR suggests. Then, if the user is quick enough to click on the navigation icon in the navigation menu popover, they'll see the loading bar - then, and only then. This doesn't affect the behavior if any of the other "Overlay Menu" options are chosen.
One other issue I've noticed, and this is pre-existing:
The custom popover implementation that's used to display a preview of the navigation menu will stay behind the block toolbar. I don't think that's expected, and it looks awkward on small devices (as shown in the preview below). Should we use an actual dialog component instead and remove the custom implementation altogether? @WordPress/gutenberg-components thoughts?
Testing Instructions
Testing Instructions for Keyboard
None
Screenshots or screencast
Before:
Screen.Recording.2024-08-05.at.17.57.22.mov
After:
Screen.Recording.2024-08-05.at.17.56.01.mov