freelawproject / recap

This repository is for filing issues on any RECAP-related effort.
https://free.law/recap/
12 stars 4 forks source link

Add a progress indicator (bar/spinner/etc) so that users know they're waiting for an upload #284

Open mlissner opened 4 years ago

mlissner commented 4 years ago

If an upload is underway and a user browses away or refreshes the page, the upload will be cancelled and we won't get the document (or docket).

This surely happens presently, but with #235 landing soon, we'll be getting larger documents. Those will take longer to upload and this issue may get worse (though by getting worse it only puts us back at where we were before #235, so that's not the end of the world either).

A couple solutions:

  1. A spinner or progress bar of some kind. I imagine there are some decent solutions for this with bootstrap though the easiest path is probably to use the spinning cursor thing.

  2. Blocking the user from leaving the page in some way while the upload is still going. This would be pretty aggressive and rude, so it'd have to be behind a setting, which makes it pretty lame.

  3. Using a worker in the background (am I saying the right words?) to maintain a queue of the uploads and to thereby solve this issue entirely.

Probably more ideas for solutions too.

johnhawkinson commented 4 years ago

I agree that (2) is too aggressive. I wonder if something less aggressive than (1) is, such as static warning ("<STOPSIGN/TRAFFICLIGHT-RED> Please don't navigate away, RECAP is [whatever]").

I dunno, I suppose there's a school of thought that says progress bars are always better than static warnings, although I'm not sure anymore.

ikeboy commented 4 years ago

I think 3 makes sense and is very doable. I might take a stab at this.

Wouldn't even need to be a queue, just have the extension call a background function to do the upload, as soon as that function is called the page could be closed without issue.

mlissner commented 4 years ago

Let's have a discussion of this feature in Slack (or here) before you get too far on number 3. I think @litewarp may have ideas or goals about this already that I'm not aware of (he's been in the guts of the current uploading mechanism for a few weeks).