Skip to content

Postponing the loadingspinners and where to implement the design system #118

Open
@erikarenhill

Description

@erikarenhill

Me and @HendrikThePendric came into an issue while building on the WHO DQ Tool, where we begun to discuss how and where to implement postponing of displaying a loading spinner to avoid having flickering/blinking loadingspinners in our apps. I should also mention that this came up for the specific usage of app-service-datastore where we can pass in a custom loadingComponent to the provider as a prop (https://github.com/dhis2/app-service-datastore/blob/master/src/DataStoreProvider.tsx)

Then it took fire in a slack-thread in #ui channel: https://dhis2.slack.com/archives/CBM8LNEQM/p1593440347005200 so we're creating a note for it instead.

Talking to @cooper-joe we already have a guideline to only display a loader if something takes more than 700ms (https://github.com/dhis2/design-system/blob/master/atoms/loading.md#usage) but this is merely how it should behave against the user.

How long the delay should be, is left for another discussion, so lets instead discuss where and how to support this design guideline.

Basically we came to the conclusion that we have 5 options, where I think most of us are in favor for one of the last 2

  • Implement a timer/effect in the app where to use the loading
  • Implement an css animation on the loader in the app
  • Implement a timer/effect in the library app-service-datastore that takes care of this no matter which loadingComponent you pass in
  • Implement a timer/effect on the CircularLoader component in UI-library to enforce this guideline automatically across all apps using our components and no matter where.
  • Same as previous but using css-animations

I think(?) from the Slack-discussion that most of us were in favor of adding this to the UI- library, so either 4 or 5 would be the choice for us.

And lastly, should we implement it in the already existing CircularLoader or do we need yet another component such as a PageLoader?

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions