Uh oh!
There was an error while loading. Please reload this page.
fix: progress bar full width before fading out - #12
Conversation
AnYiEE
commented
Aug 7, 2024
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.
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. |
AnYiEE
commented
Aug 15, 2024
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. |
michaellopez
commented
Aug 17, 2024
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) |
musjj
commented
Aug 17, 2024
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. |
michaellopez
commented
Aug 17, 2024
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? |
musjj
commented
Aug 17, 2024
Basically, yeah. |
philwolstenholme
commented
Sep 17, 2024
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