Lurker News
Back to discussion

Comment by ketzo

ketzo3 replies#
just this week, I put a minimum 200ms wait time on a loading spinner, because otherwise we thought it felt "buggy" because it was completing too quickly!
b1121 reply#
Monsters!
ketzo#
y'know, I felt like a monster doing it, but it weirdly is way more satisfying to use

it goes from "wtf just flickered on my screen" to "wow, that loaded really fast!

janc_1 reply#
The alternative is to show no spinner at all when something is that fast, of course...
ketzo#
haha you're not wrong

but it's an async process that could take longer, so then you get into "well if it's <200ms we won't show a spinner, but if it takes longer we will..."
it's a settings page where you're clicking toggles, and each toggle saves automatically when you hit it. so when you click one, you get a short spinner, then a check mark when it succeeds. feels right to me when I'm using it

frosted-flakes1 reply#
There should be a short delay (200ms to 500ms) before showing a loading spinner, and if the operation completes in that time you can avoid showing it at all. But if it takes longer than that, the spinner should be shown for a minimum of 500ms or so, to avoid a sudden flash of the spinner.

I wrote a React hook called usePending[1] for this once. It's surprisingly difficult to get right.
[1] https://gist.github.com/cmmartti/4f7833292b9d277685fc0813532...

ketzo#
wow, wait, this is awesome. I think I might drop this in instead. thank you!