Gmail’s fake loading indicator (2020)
Progress bars are inherently difficult to create since you need to predict the future to provide an accurate status on progress.<p>Let's just consider what would factor into an accurate status bar. Gmail would need to know <i>in advance</i>:<p>1. the total payload size (which is different for everyone since some might have locally cached assets and everyones inbox size is different)<p>2. would need to know # of assets to be downloaded by the user (since # of assets, not just file size, affects load time)<p>3. how fast your computer will render the webpage (different processors, browsers, versions, etc all affect load time)<p>4. how fast is your internet connection and pack loss (more pack loss on mobile networks, etc)<p>5. is there any blocking content on the page that will affect delaying "first paint". (Why things like Lighthouse exists)<p>And many more factors.<p>This is unneeded complexity when instead, you can just display an animation to distract the user while the page loads.<p>This is 100% a K.I.S.S.