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!
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
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.
it goes from "wtf just flickered on my screen" to "wow, that loaded really fast!
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
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...