dandi / dandi-archive

DANDI API server and Web app
https://dandiarchive.org
13 stars 10 forks source link

Use spinners in sidebar elements to indicate running jobs #1392

Open waxlamp opened 1 year ago

waxlamp commented 1 year ago

For example:

Screen Shot 2021-12-31 at 9 51 44 AM

See #740 for full design discussion and this comment for the source of the image above.

yarikoptic commented 1 year ago

IMHO this relates to good old request (https://github.com/dandi/dandi-archive/issues/1060) to be able to identify whenever some view finishes loading or are we talking about some other processes which should change state of some things and be reflected within API (as "index of files being updated" here)?

waxlamp commented 1 year ago

This has to do with async jobs like metadata/asset validation, not with loading of the website itself (the second thing you mentioned).

mvandenburgh commented 1 year ago

We can use the status field to determine when validation is running like we do here https://github.com/dandi/dandi-archive/blob/83d3a10432f6554969542a2f8fc209bc5f9c269f/web/src/views/DandisetLandingView/DandisetPublish.vue#L157, except we'll want to continuously poll the server at some interval to bring that status field up to date.

One issue is that we don't currently differentiate between asset metadata validation status and version metadata validation status; the backend checks if the version metadata is pending OR if the asset metadata is pending, and returns the result as a single field, status. If we want to differentiate between the two via separate spinners on the "Files" and "Metadata" buttons, this would also need to be updated.