remotestorage / remotestorage.js

⬡ JavaScript client library for integrating remoteStorage in apps
https://remotestoragejs.readthedocs.io
MIT License
2.31k stars 141 forks source link

feedback after connect until data appears #104

Closed jancborchardt closed 11 years ago

jancborchardt commented 11 years ago

Pulling the data after connecting usually takes some seconds. Currently the cube only spins (like on every sync) but on the first connection/sync there should be some additional feedback in the widget. Using the same CSS text box when you hover over the cube to disconnect, it should show "Connecting user@host" (the same way as it is "Disconnect user@host"), until the data appears in the interface.

nilclass commented 11 years ago

Sounds nice. Also I think when hovering while syncing (after initial sync), the bubble shouldn't say "Disconnect user@host" (because you can't do that right now), but "Synchronizing..." or something.

jancborchardt commented 11 years ago

Yeah, good point. Should we block disconnecting when syncing though? When you disconnect, it force syncs anyway, and we shouldn’t force people to wait for disconnecting until syncing is done. Instead they should always be able to disconnect, and then sync will be automatic.

jancborchardt commented 11 years ago

What about this: When syncing, hovering the cube will still show »Disconnect«, and clicking will initiate disconnect. Regardless of state (if syncing or not), after clicking there will/should still be »Syncing …« displayed permanently until it’s done and the widget shows again.

nilclass commented 11 years ago

Yeah, makes sense. Sorry I handn't replied earlier, was silently agreeing and then just forgot about this issue.

So, to summarize:

  1. The issue shows "get remotestorage" and "connect" buttons
  2. clicking "connect" displays the useraddress input (and focuses it)
  3. clicking "connect" again starts oauth dance
  4. when returning from oauth dance, initial sync happens, the cube spins and the bubble says "Connecting user@host"
  5. after initial sync is done, once sync is triggered again, it says "Synchronizing..."
  6. a) when hovering during sync it says "Synchronizing... (click to disconnect)", b) when hovering and no sync is happening it shows "Disconnect user@host"
  7. clicking the cube at any point, then triggers a final sync, that will either start once the current sync is done, or immediately (if no sync is in progress)

When the app is started again, after having been closed without disconnecting, the same process starts at (4).

Have I forgotten anything?

nilclass commented 11 years ago

Oh yes, I have:

  1. When final sync succeeds, the user is disconnected and we're back at (1)
nilclass commented 11 years ago

Also, we need to think about error cases, errors can happen at many steps:

3) webfinger lookup can fail (possible causes: invalid user address; no network connection; server error) 4) authentication can fail or the user decides not to log in and use the "back" button, or even reject the requested scope (which all amounts to the same in the end -> display some message, then go back to (1) or (2)) 5) synchronization can fail for one or more items (possible causes: network down, server error, client error (such as attempting to overwrite a directory with a file)) 6) the same as in (5), just that we need to react differently to make sure that the user knows their data is not synced and will be kept locally until sync is possible again. Maybe at that point the user should have the option to save the localStorage data to a file and "disconnect" (i.e. clear localStorage) anyway.

jancborchardt commented 11 years ago

Yes. And for 4. and 7. the bubble will be shown permanently for the time of connecting (respectively final synchronizing), not only when hovered. (The »permanent« display of the bubble is an interaction which should only be used in very important cases, that is when it still needs to connect / initially sync, when there’s an error, and when there’s the final sync.)

And I’m not sure about the wording in 6. a) »Synchronizing... (click to disconnect)« is a bit long and also weird to mention »clicking« explicitly as an action. Let’s first just keep a) the same as b), just also with spinning cube in the case of a).

Regarding errors, they should be displayed in the bubble itself. When not connected yet, by increasing the height of the box and inserting the text below the connect field. That would be 3. and 4. For the synchronization error in 5., the bubble should be shown permanently (I mean, for the time of the error) and say »Syncing problems …«, with still spinning cube and trying further to connect. Then if there are multiple tries (should be fast, or only one try) then … one should probably stay connected, but the bubble should get bigger in height to show a proper but very short error message. Basically just »Syncing problems …« left to the cube, and then in a second line »network connection issue« (or similar). The problem with 6 I have yet to understand fully, but I know that giving any weird option is not a good solution, especially because in this case it makes the remotestorage system seem inferior – it gives you options to back up your data because it’s afraid to fuck up.