Page MenuHomePhabricator

Skeleton: Add Skeleton loader component to Codex
Open, Needs TriagePublic

Description

NOTE: this task should be reformatted to the mvp component template T329320

Background

  • Description: Skeletons are loading indicators that take the approximate shape of the UI elements they are acting as a placeholder for.
  • History: There are two main tasks and threads that should be taken into consideration when tackling the definition of this pattern: T280842: Define and add guidelines for adding skeleton/placeholder UI to the DSG and T266028: Add “Progress indicators” to DSG.
  • Known use case(s): Skeleton loaders are currently used in production in the following scenarios: Within Growth's Newcomer homepage suggested edits modules (or cards), as loading indicators for images in Wikipedia articles (only in Minerva), as loading indicators for the main search's menu item thumbnails in Minerva.
  • Considerations: This pattern should be approved by the design team before being introduced in our design system. Its place among other progress/loading indicators (T266028) and usage recommendations should also be properly defined.

Further details are available in the following product document.

User stories

  • As a designer and developer, I want to be able to reuse a skeleton animation to visually indicate to users that UI content is loading.

Previous implementations

These artifacts are listed for historical context. The figma spec, linked below, is the source of truth for the new component.

The most relevant implementations of skeleton loaders are in MobileForntend and Minerva skin (using the class .image-lazy-loaded), and GrowthExperiments project (.se-card-image.skeleton, .se-card-extract.skeleton, .se-card-pageviews.skeleton).

Growth newcomer homepageImage thumbnails on articlesImage thumbnails on search (Minerva)
T263040 Suggested edits module
image.png (1×2 px, 261 KB)
T321675 Impact module
image.png (1×934 px, 113 KB)
image.png (1×2 px, 897 KB)
image.png (2×1 px, 456 KB)

Open questions

  • Skeleton size: will skeleton be the same size of the element that is replacing or should we create different predefined skeleton sizes? (e.g. 16px, 24px, 40px height)
    Captura de Pantalla 2022-11-11 a las 11.56.54.png (772×550 px, 133 KB)
  • Skeleton color: If skeleton will be used on gray bg components (e.g. in framed tab component) we should use a different color for the skeleton.
    Captura de Pantalla 2022-11-11 a las 11.46.48.png (778×1 px, 234 KB)
  • Skeleton sequence: could implementers control the sequence in which skeleton loads? Could this be a prop?

Codex implementation

Component task owners

  • Designer: @Sarai-WMDE
  • Developer: add the main developer's name

Design spec


Stage 1: Minimum viable product (MVP)

MVP includes basic layout, default states, and most important functionality.

Acceptance criteria

  • Determine what MVP includes for this component and document this in a subtask. Assign task to designer.
  • Design MVP.
    • Get approval by Product design team
    • Once complete design MVP, assign task to developer.
  • Implement MVP

Stage 2: Additional states, features, and variants

Acceptance criteria

  • Document design and implementation of additional states and features in individual subtasks
  • Complete each additional state/feature subtask

Stage 3: Refinement

Acceptance criteria

  • Finalize docs: open and complete a subtask for any additional demos that need to be added or documentation that needs work
  • Update loading guidelines added in T377434 with relevant information about Skeleton loaders
  • Meet accessibility standards: open and complete a subtask for any necessary accessibility improvements
  • Meet internationalization standards: open and complete a subtask to fix any i18n bugs
  • Complete testing: open and complete a subtask for any additional unit or functional tests that are needed

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

The Figma spec sheet for the Skeleton has been created and is ready to be implemented.

@RHo once the skeleton is implemented we will create another task to implement the skeleton state in Card component T256036 and other components where we need this loading state (such as menu-items with data, table component, etc.). You can review the spec sheet and provide feedback if needed.

bmartinezcalvo renamed this task from Design and build skeleton loader to Design and build Skeleton loader.Nov 9 2022, 7:23 PM

Currently

The Figma spec sheet for the Skeleton has been created and is ready to be implemented.

@RHo once the skeleton is implemented we will create another task to implement the skeleton state in Card component T256036 and other components where we need this loading state (such as menu-items with data, table component, etc.). You can review the spec sheet and provide feedback if needed.

Thanks for the ping @bmartinezcalvo. It largely looks fine to me, but one aspect that is missing/not addressed is having an order and delay of the loading animation of the different skeleton elements. By that I mean, for example in a list of articles, having a cascade effect with the first item "shimmering" across and downwards. I have a rudimentary example in this codepen that was created for one place where the Growth team uses skeletons.

On that note, there are 3 different places where Growth uses/plans to use skeletons for reference:

  1. Suggested edits module (see T263040)
  2. Post-edit dialog (see T294835, which is a task to solve some jankiness with the skeleton behaviour)
  3. Planned skeleton for New Impact module being built with Vue - see T321675.

Thanks for the ping @bmartinezcalvo. It largely looks fine to me, but one aspect that is missing/not addressed is having an order and delay of the loading animation of the different skeleton elements. By that I mean, for example in a list of articles, having a cascade effect with the first item "shimmering" across and downwards. I have a rudimentary example in this codepen that was created for one place where the Growth team uses skeletons.

@RHo we could use that gradient or use simply the background-color-interactive as a flat color. We decided to use the color instead since we don't have any gradient in our system at the moment and we should add it as token if we want to use it for the skeleton, which would slow down the implementation. Y recommend to use the background-color-interactive as a flat color for now and then study if we want to apply a gradient. You can check an example of skeleton without gradient in this Figma loading.

Captura de Pantalla 2022-11-10 a las 10.41.21.png (960×1 px, 323 KB)

Hey @RHo. Thanks so much for your help!

I think that keeping the animation-delay property custom is what will allow teams to freely set the loading order of the skeletons, and achieve the cascading effect you are referring to:

Screenshot 2022-11-10 at 10.42.33.png (664×890 px, 74 KB)

It would be great to get confirmation about this from engineers.

Thanks for the ping @bmartinezcalvo. It largely looks fine to me, but one aspect that is missing/not addressed is having an order and delay of the loading animation of the different skeleton elements. By that I mean, for example in a list of articles, having a cascade effect with the first item "shimmering" across and downwards. I have a rudimentary example in this codepen that was created for one place where the Growth team uses skeletons.

@RHo we could use that gradient or use simply the background-color-interactive as a flat color. We decided to use the color instead since we don't have any gradient in our system at the moment and we should add it as token if we want to use it for the skeleton, which would slow down the implementation. Y recommend to use the background-color-interactive as a flat color for now and then study if we want to apply a gradient. You can check an example of skeleton without gradient in this Figma loading.

Captura de Pantalla 2022-11-10 a las 10.41.21.png (960×1 px, 323 KB)

Thanks @bmartinezcalvo - the current implementation we have doesn't have a gradient so don't think this is an issue. The change in colour at different times I'm talking about is through animation-delay and changing the opacity of the skeleton element.

Hey @RHo. Thanks so much for your help!

I think that keeping the animation-delay property custom is what will allow teams to freely set the loading order of the skeletons, and achieve the cascading effect you are referring to:

Screenshot 2022-11-10 at 10.42.33.png (664×890 px, 74 KB)

It would be great to get confirmation about this from engineers.

Thanks for clarifying @Sarai-WMDE and will await confirmation from Eng. I think it could be useful to have in the spec a recommendation about whether to cascade or not, in what circumstances. For example it might be nice for items in a list or multi-lines in a chunk of text, but not to have it across different loading elements (card image, title, body text)

Providing som open questions for the skeleton:

  1. Will skeleton be needed in tab component? If yes, we need to find a solution for the framed tabs since they are using the same gray tone as the skeleton.
    Captura de Pantalla 2022-11-11 a las 11.46.48.png (778×1 px, 234 KB)
  1. Should skeleton be the same size of the element that is replacing or should we create different predefined skeleton sizes? (e.g. 16px, 24px, 40px height)
    Captura de Pantalla 2022-11-11 a las 11.56.54.png (772×550 px, 133 KB)

Hello just wanted to share that we are following similar pattern in our project for loading content in quick view. In our next iteration we can align this to your final proposal if you notice any discrepancies. Here is the Phab ticket that outlines the behaviour T318951.

CCiufo-WMF moved this task from Backlog to Design Upcoming on the Design-System-Team board.

We're hoping to implement a version of this for the type settings interface. See T350612. Here's what that's looking like right now based on the Figma above.

Reading theme logged in unhide - skeleton.png (922×1 px, 311 KB)

Reading theme logged in no tools - skeleton.png (922×1 px, 337 KB)

CCiufo-WMF renamed this task from Design and build Skeleton loader to Skeleton: Add Skeleton loader component to Codex.Feb 15 2024, 8:31 PM
CCiufo-WMF raised the priority of this task from Low to Needs Triage.
CCiufo-WMF added a project: Design.
CCiufo-WMF removed a subscriber: Prtksxna.