Skip to content
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

Fix loading bar to handle longer requests, god forbid #1670

Merged
merged 1 commit into from
Jul 17, 2023

Conversation

david-crespo
Copy link
Collaborator

@david-crespo david-crespo commented Jul 17, 2023

Fixes #1657. Two main changes:

  • Use animation-fill-mode: forwards to make the bar sit in place when it runs out of time instead of resetting to 0
  • Stretch out the time of the loading part of the animation from 1.5s to 4s, adjusting the % location of the keyframes to make it so it looks the same as before for short requests, but for longer ones can spend a bit more time creeping forward rather than sitting still

The video is too long, I did not feel like editing out the useless parts.

  • main with fast request (good)
  • main with 2000ms request (bad, bar disappears at 1.5s, reappears for whoosh done animation)
  • This PR with 2000ms request (good, bar hangs out in the middle, moving slowly, then finishes with whoosh out)
  • This PR with fast request (good, looks about the same as main)
loading-bar.mp4

@vercel
Copy link

vercel bot commented Jul 17, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
console ✅ Ready (Inspect) Visit Preview Jul 17, 2023 5:29pm

@david-crespo david-crespo merged commit 6c463aa into main Jul 17, 2023
6 checks passed
@david-crespo david-crespo deleted the fix-loading-bar branch July 17, 2023 17:37
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 disappears if requests take too long
2 participants