Closed willkg closed 9 years ago
Thoughts on names: Indicator
seems awfully generic. Maybe LoadingIndicator
?
Although it is nice to know exactly what is happening, I worry about things that happen in parallel. For example, PRs and bugs are downloaded at the same time. The way we did this in Ernest was to just have a count of outstanding tasks. That might work, but it doesn't say what step you are on.
Alternatively, we could have each task added and removed. Something like IndicatorActions.taskStart('Fetching bugs')
and IndicatorActions.taskDone('Fetching bugs')
. Or maybe that but with constants like IndicatorActions.taskStart(IndicatorConstants.FETCH_BUGS)
. Maybe those are all too much typing.
Then the UI could show all open tasks at once.
I'll switch it to "Progress" which lets us use it for all running tasks.
+1 to Progress
^^^ That rebases against master and redoes IndicatorStore as ProgressStore which allows tasks to start/end themselves.
That seems better. I can't tell if it's got a sensible architecture or not, though.
I actually cloned this and ran it. It looks hawt. I'm amazed how much a difference this makes. Nice job!
Also, I'm surprised that PRs and Bugs aren't downloading parallel. I thought they did. Oh well, I should look into that.
Fixes #52
Does this look generally like a valid approach? For the most part, all it does is flash "LOAD_BUGS" for a while (that's the step that takes most of the time) and then disappear. The other steps don't take much time. However, this does give complete visibility into whether it's still working or not.
I tried to generalize it to be a general progress indicator that we could use for other things. I'm not sure what those other things would be or how that would manifest itself. It might be better to do like we did with ernest where we have a "turn indicator on" and "turn indicator off" kind of thing.
Thoughts?
Also, thoughts on names of classes and files?