-
Notifications
You must be signed in to change notification settings - Fork 27
fix: progress bar full width before fading out #12
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
base: main
Are you sure you want to change the base?
Conversation
|
I actually used this version, it looks as expected, and there are no issues. |
| if (!loading) { | ||
| spring.jump(0); | ||
| if (loading) { | ||
| // Simluate first "tick", to avoid having to wait 750 ms for feedback |
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.
Simulate.
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.
Thanks for the review. I'll fix it
|
It seems that this causes the progress bar to unnecessarily flash when clicking on links to previously visited, cached pages. Previously, the progress bar will not be shown at all. |
So there was a problem before. Users should get some kind of feedback for every action. A visited page may load quickly on your device, but it may not load as quickly on my device. I need to know that I clicked on the link and that loading has begun. |
Yeh, I agree with AnYiEE. Feedback for the action is what this is. If the action is fast, so is the feedback. It shouldn't be no feedback at all if the action is fast (which might be hard to determine deterministically to) |
|
In my local version, I added a 100ms delay before the progress bar is animated and it feels fantastic IMO. Progress bars being flashed constantly for every little action makes the experience feels slower not faster for me. But it's fine if you don't want to change it, I was planning to vendor this library anyways since it's tiny and easily customizable. |
You mean you only show the progress bar for actions slower than 100ms? If the transition settles faster than 100ms there is no progress bar shown at all? |
|
Basically, yeah. |
Nice idea, reminds me of https://www.npmjs.com/package/spin-delay |
This PR makes the progress bar reach 100 % when loading is complete before fading out.
I had a bit of trouble with formatting, the codebase doesn't have any consistent style. So I tried my best to match it. Hope it is OK, otherwise let me know.
Fixes #4