-
Notifications
You must be signed in to change notification settings - Fork 154
Distinct progress bars instead of indeterminate spinners #77
Comments
Installing redux directly ( |
NPM CLI's logger uses noUnicode = {
startCap: `[`,
complete: ` `, // single space, displayed with white background
incomplete: `.`,
endCap: `]`
}
unicode = {
startCap: `⸨`, // \u2e28
complete: ` `, // single space, displayed with white background
incomplete: `░`, // \u2591
endCap: `⸩` // \u2e29
} |
Hi @superhawk610! Thanks so much for your involvement in this and other issues :D Breaking this up into a couple sections: Dependency installation / updatingYeah, so this is a real pain point. Dependency installation is really not fun right now. There are a few thoughts/concerns around this:
I think if we go with the idea in #33, having toast-like notifications (either on top or on the bottom), a progress bar would be really nice. I'd vote for deferring work on this issue until the previous two issues are solved, so that we can really target this solution. Project creationI'm not as worried about project creation - it feels more justified that it's slow, since it's a bigger operation. And it's not something done super often (I imagine even serial experimenters still only do it a handful of times a week). That said, it's still not great that the progress bar hangs for quite a while on the "installing dependencies" step. The good part about this is that the UI is already sorted out; you could just use the progress bar that already exists! And there aren't any dependent issues that I'm aware of, so nothing's stopping you from hacking on this problem. Go for it, if you're interested! Slower?
Ah, wild. Guppy uses |
So after banging my head against this for a couple hours, I'm here to report back. I haven't even gotten around to parsing input yet as so far, I can't seem to generate any. Whether I use I'm far from an expert at CLI conventions, but I believe gauge and similar progress reporting solutions (think curl and wget) accomplish this updating single line of information by writing out the information followed by a carriage return (\r) but not a newline, which simply returns the output location to the beginning of the same line and allows it to be overwritten. The problem I'm running into with childProcess is that it doesn't seem to flush output to I know this is doable because there are full terminal emulators written for Node that correctly flush updates without newlines. Can anyone point me in the right direction? |
(Added a |
Update: headway has been made
Looks like by default Edit: Ahh, Microsoft has one that appears to be actively supported. This looks promising.
before installing dependencies, otherwise node-gyp will fail if they don't already have the correct Python/C++ installer in their path.
|
Ok, so now that the proof of concept is done, it's time to decide on UI. As mentioned in #103, we may want to use native notifications for status updates, which do not support any form of live progress display. This leaves us with two options:
These aren't mutually exclusive, they could both be used in conjunction. Thoughts? |
I think the ideal would be both, and a notification if the app isn’t focused anymore, WDYT? |
That complies well with most platform standards, I like it. I think Electron also has a Mac-only API for the dock icon to show a numeric badge, like the notification badge on apps for missed notifications, we could probably integrate with that as well if a task finishes while the application is in the background.
|
Thanks a ton for looking into this =D Ah, I love the idea of dock icon progress! Brilliant idea. I like the mockup you proposed, for also having an in-app indicator; I think I'd opt for something smaller / more subtle, but I like the idea. How do you envision either of these ideas working with queued items? Say I'm currently installing 1 dependency, but there's a clustered group of 3 dependencies next, followed by removing a dependency. I think we could probably treat them as discrete events; The progress bar represents that first dependency. When it finishes, the progress resets to 0 and starts climbing again. It might be a bit surprising for folks, but I think the alternative is too unpredictable to provide realistic progress (plus it'd be weird if the progress bar suddenly jumped backwards a bunch when adding new stuff to the queue). Also, it seems simplest, and given the inherent complexity in a queue, I like the idea of going for the simplest approach. For notification badges... I'm not sure I like the idea. For me, a notification badge should represent an unexpected update (eg. you received a message, the app wants to update). I don't often see them used for predicted things (eg. download complete). I think it might be a bit underwhelming if you see a red "2" on the icon, and clicking over just reveals that the thing you expected had happened. Plus we'd need some additional UI to make it clear what the badge represents, otherwise it might just be confusing. |
I think Transmission shows a red bubble of a download is done, but only when app isn’t focused. (As an example of the usage) |
You could use something like |
@Haroenv yeah Transmission was what I had in mind too haha. @j-f1 our task queue is essentially synchronous since no more than one action can run on a single project at a time and tasks run one after the other. I imagine the progress indicator would be distinct per project and largely handled by the reducer. I'll keep that in mind though if we ever do manage to incorporate more async parallel tasks. |
It would still be useful for a global progress bar since multiple projects could be installing stuff at the same time. |
Redux saga comes with some pretty fancy control-flow tools... I think I'd like to see if we can do it with the existing tools before reaching for another, although definitely not against it if there's a pain point it can address! |
@joshwcomeau You're right, adding the progress or a number to the dock icon could be difficult to understand. And I would also calculate the progress for the current task and not for all active tasks - easier to implement and the user experience is OK. Maybe the progress bar could replace the pixelated guppy (screenshot below). I like the draft of @superhawk610 but not in the top right corner. I think it should be at the dependency panel. |
@AWolf81 the only issue with having it at the dependency panel is that during batched installs, we only have one progress bar for multiple dependencies, so if you're installing 3 dependencies, all their respective progress bars would move together - not terrible, but it feels a bit disingenuous, I guess? I also really like the pixel guppy, so there's that 😁 |
@superhawk610 Ah OK, so we have to keep the guppy as indetermined spinner or do a special handling for the progress of batch installs. e.g. the overall bar shows 1 of 3 installations finished. Maybe we can add the loader close to each dependency and replace that spinner - so it's possible to show a spinner for each dependency. |
This was originally supposed to be the logo! But it looked too much like a spinner, plus I decided pixel-art wasn't a good fit for the rest of the design. (I actually commissioned 3 separate logos, before @superhawk610 and @AWolf81 both contributed better ones :D although I bought them on fiverr, so it was quite inexpensive). For finding an area for dependency progress, hm. I like @AWolf81's suggestion of adding an indicator to each dependency in the list, could be a radial progress bar as suggested earlier. BTW, we use radial progress bars at Khan Academy - we did it by using an SVG circle, giving it a thick |
While installing dependencies, both during step 4 of project creation as well as when adding them manually to an existing project, the UI simply displays an indeterminate spinner until the dependency is installed. To new users, this may be concerning, especially if they are running on older hardware (redux took well over two minutes on my 2011 MBP). NPM's CLI displays a progress bar at the left of its output, so it should be trivial to hook into this and use it to display a more visually appealing distinct progress bar in the UI so users will confidently know that a long-running process is in fact still running and not stalled indefinitely.
I'll work on the logic, but I'm nowhere near @joshwcomeau when it comes to design so any help with styling would be much appreciated.
The text was updated successfully, but these errors were encountered: