We currently use spinners to render loading states. These are problematic because the page flickers when it loads quickly and looks jumpy when it loads less quickly.
Let's switch to skeleton text for loading states. This approach would render a full layout as much as possible, using placeholders for any text that has not yet loaded.
It will address the flicker problem since the layout will be close to final. Transitioning to a fully loaded layout should trigger only a minimal re-rendering.
It should mostly address the jumpiness problem because each component will be fully laid out. There will still be some jumpiness for things like file content when the final content only includes one or two lines of code (it will jump from many lines to a few).
It will provide an illusion of speed. When you click on something, it will render immediately before the data has loaded.
We used this technique on addons-frontend and it worked well
Some considerations:
It's important to render a skeleton screen as close to the final screen as possible. This means everything: line-height, margins, headers. Any deviation creates jumpiness.
On addons-frontend we used an inline-block with a background color as the skeleton text. Because a div is not text, this sometimes caused a major difference in layout.
The width of skeleton text needs to be realistic for what the final text will look like.
This issue has been automatically marked as stale because it has not had recent activity. If you think this bug should stay open, please comment on the issue with further details. Thank you for your contributions.
I played around with this but it needs work. The idea is to save an imprint of the current file and use that as a skeleton when transitioning to the next file. For the very first file load, it has to generate a random skeleton.
The spacing of the imprint lines doesn't match the code view exactly so it would be nice to fix that.
We currently use spinners to render loading states. These are problematic because the page flickers when it loads quickly and looks jumpy when it loads less quickly.
Let's switch to skeleton text for loading states. This approach would render a full layout as much as possible, using placeholders for any text that has not yet loaded.
addons-frontend
and it worked wellSome considerations:
addons-frontend
we used an inline-block with a background color as the skeleton text. Because a div is not text, this sometimes caused a major difference in layout.┆Issue is synchronized with this Jira Task