Skip to content

Conversation

@michaellopez
Copy link
Contributor

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

@AnYiEE
Copy link

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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simulate.

Copy link
Contributor Author

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

@musjj
Copy link

musjj commented Aug 14, 2024

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
Copy link

AnYiEE commented Aug 15, 2024

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.

@michaellopez
Copy link
Contributor Author

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.

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
Copy link

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
Copy link
Contributor Author

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?

@musjj
Copy link

musjj commented Aug 17, 2024

Basically, yeah.

@philwolstenholme
Copy link

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.

Nice idea, reminds me of https://www.npmjs.com/package/spin-delay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Progress bar never reaches full width

4 participants