-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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 is-busy
animation to save changes button in settings
#47626
Conversation
Hi @adrianduffell, @rjchow, @woocommerce/ghidorah Apart from reviewing the code changes, please make sure to review the testing instructions as well. You can follow this guide to find out what good testing instructions should look like: |
Test using WordPress PlaygroundThe changes in this pull request can be previewed and tested using a WordPress Playground instance. Test this pull request with WordPress Playground. Note that this URL is valid for 30 days from when this comment was last updated. You can update it by closing/reopening the PR or pushing a new commit. |
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.
- Observe Save changes and Add shipping method button is slightly larger
- Enter a zone name
- Save to see the busy animation, but most likely it's too quick to be observed
I used network throttling to slow down the request but I was able to see the busy animation on the shipping zone save.
Screen.Recording.2024-05-21.at.10.55.29.mov
It seems that the is-busy class is added after the request is completed. However, there is another spinner that is shown when the request is in progress. If can find a way to make the spinner show before the request is completed that would be great but I think this is fine for now.
I also tested the other settings screens and everything seems to be working fine. 👍
Thanks for spotting that, @chihsuan! Great suggestion to use throttling to test. I've fixed the busy state in 4e580dd so it triggers on submit instead. |
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.
Nice work, @ilyasfoo! LGTM -- I tested every settings screen without issue 👍 👍
However the animation didn't appear in Safari. It looks like this is due to the disabled
attribute for some reason. I also confirmed the post editor only sets aria-disabled
during the loading state. Perhaps we should do the same? 🤔
@adrianduffell Thanks! However, I was unable to reproduce the issue with disabled attribute (the buttons in settings page are not disabled on saving). It does seem like the screen is frozen while the request is loading, thus the animation is not visible before the screen goes off. You can confirm this by adding I found another bug where the animation is super janky and is resolved by disabling and reenabling style, but I believe it's a Safari specific bug: 4lDQRq.mp4However, I wasn't able to find a quick fix and I wouldn't want to spend too much time on debugging it 😅 |
This reverts commit 3ac7242.
Thanks @ilyasfoo, I think this is what I'm seeing. Perhaps we can improve it in a follow-up but I'm happy to merge. |
Changes proposed in this Pull Request:
Closes #47305
This PR attempts to add loading animations to Settings screen by hitchhiking CSS classes provided by Gutenberg components. This is meant to be an acceptable temporary UX improvment while we work on settings UI refresh.
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
WooCommerce > Settings > General
Save changes
WooCommerce > Settings > Site visibility
Save changes
WooCommerce > Settings > Shipping
Add zone
Save changes
andAdd shipping method
button is slightly larger5xX4Vu.mp4
Changelog entry
Significance
Type
Message
Comment