Page MenuHomePhabricator

Create loading and error states for the IP info box and popup [M]
Closed, ResolvedPublic

Assigned To
Authored By
Prtksxna
Jan 11 2021, 3:26 AM
Referenced Files
F34644245: Screen Shot 2021-09-15 at 4.08.07 PM.png
Sep 15 2021, 8:12 PM
F34551033: image.png
Jul 14 2021, 3:50 PM
F34551014: image.png
Jul 14 2021, 3:38 PM
F34551017: image.png
Jul 14 2021, 3:38 PM
F34534727: image.png
Jul 14 2021, 3:38 PM
F34551021: image.png
Jul 14 2021, 3:38 PM

Description

Motivation

While the data is being fetched for display in the IP Info popup or box, we should show a loading state indicator to the user so they know they should wait for it.

Specs
IP info popup loading stateIP Info box loading stateIP Info box incomplete data
image.png (228×1 px, 38 KB)
image.png (196×1 px, 32 KB)
image.png (768×1 px, 224 KB)

Full design spec on Figma

  • The loading state for the popup shows up after the user has clicked the info button next to an IP and a request to fetch the data has been generated
  • The loading state for the box shows up while the data is being fetched after the user has clicked the box to open it or when the user lands on the page and the box was already open
  • If all the data for the IP is found, the loading state goes away and is replaced by the data: F34534727
  • If some data fields are missing, those fields appear with an error: Not available while other fields appear populated
  • Note: The loading state shimmer is built into OOUI.
Relevant links

Event Timeline

I'll answer what I can!

Is it possible to show the IP info box before the data has come in?

I believe it already does (at least, you can observe the loading bar for the API call).

Can we trigger the requests when the box is toggled open? It'll always be closed by default.

Sure.

Would errors happen per field (eg, location errored out, but we got ASN) or per request (got ip info but not on-wiki info)? I understand that Not Available is different from an error.

We generally don't bubble up any per-field errors. Unless it fails on an API-call level, it all returns as "not available" on the field regardless of how that field lookup failed.

I haven't looked into on-wiki requirements at all so this is me guessing:

Would the on-wiki info and IP info be separate requests?

Possibly. They'd need a separate set of functions to transform data at the very least.

Would the errors documented in T263442 be same for on-wiki info and ip info?

Unclear to me. These are all returned from the API call so it depends on how the architecture needs to be modified (different API calls or same). We can also add errors as necessary.

Niharika renamed this task from Create loading states for the IP info box, popup and fields to Create loading and error states for the IP info box and popup .Jul 14 2021, 3:38 PM
Niharika triaged this task as Medium priority.
Niharika updated the task description. (Show Details)
Niharika moved this task from Design to Triage/To be Estimated on the Anti-Harassment board.

I was able to see the loading state briefly, when I throttle the network traffic, on the page below:
https://en.wikipedia.beta.wmflabs.org/w/index.php?title=Main_Page&action=history

I didn't get to see the loading image on the page below, not certain if it is expected.
https://en.wikipedia.beta.wmflabs.org/wiki/Special:Contributions/216.38.130.164

Note: I have not added any screen shots of the loading state since it was quite brief, you'll have to take my word for it 😊

I can take your word for it @imaigwilo. 😆

I was able to see the loading state briefly, when I throttle the network traffic, on the page below:
https://en.wikipedia.beta.wmflabs.org/w/index.php?title=Main_Page&action=history

This was for the popup, correct?

I didn't get to see the loading image on the page below, not certain if it is expected.
https://en.wikipedia.beta.wmflabs.org/wiki/Special:Contributions/216.38.130.164

You should be able to see the loading indicator for the "IP Information" accordion on Special:Contributions.
One of the things we to do but haven't implemented yet is to preserve the state of the accordion when the page is refreshed (if it is open, it should stay open on subsequent loads; if it is collapsed, it should stay collapsed on subsequent loads). I don't know if that is somehow related to why you don't see the loading indicator here. Maybe this can be re-tested once that part is complete.

Note: I have not added any screen shots of the loading state since it was quite brief, you'll have to take my word for it 😊

@Niharika I did not see loading icon when I clicked the IP Information dropdown icon when I set the network to lowest signal (throttling)

Screen Shot 2021-09-15 at 4.08.07 PM.png (1×2 px, 527 KB)

ARamirez_WMF renamed this task from Create loading and error states for the IP info box and popup to Create loading and error states for the IP info box and popup [M].Oct 13 2021, 4:37 PM
Niharika claimed this task.