<seanh> nick: What have you done for focus-on-a-group so far? Looking for the relevant PRs that I should know about
<nick> basically nothing other than planning and cleaning up
<nick> translating the annotation mapper service to JS
<nick> my plan, briefly:
<nick> - make CRUD interactions from the client go through the annotation mapper service
<nick> (i.e. nothing other than the annotation mapper service interacts with the threading service)
<nick> - at that point hopefully everything would be mediated by annotationmapper, and changing focus would be as simple as `unload()` and then load for the focused group.
<nick> i have a WIP branch, actually
<nick> one second
panagiotis has quit
<seanh> Ok, I'll take a look
<nick> i haven't got very far!
<seanh> No problem
<seanh> This will take me a while 'cos I'll have to (re-)learn my ways around the relevant bits of frontend, but I'll get on with it. I'll break it into steps. Step 1: annotations from the initial request for annotations from the server should go through annotation-mapper and get filtered by group
travis-ci joined the channel
travis-ci
hypothesis/h#8210 (focus-on-a-group - 62d698b : Nick Stenning): The build passed.
<seanh> So annotationMapper needs to inject the groups service, so that it can ask what group is currently focused (this is needed for the initial load of annotations, for example)
<seanh> But the groups service also needs to inject annotationMapper, so that it can call it whenever the focused group changes - circular dependency
<seanh> I suppose this could be worked around by having the groups service do a $rootScope.$emit() when the focused group changes. A $on() function in annotationMapper currently can't access local variables like `loaded` that are normally available to annotationMapper's functions via closure
<seanh> Another solution might be to merge annotationMapper and groups into one thing
<nick> @seanh: that doesn't make a lot of sense
<nick> if the mapper is asking groups for the focused group, why would groups also need to tell the mapper?
<seanh> There are two cases
<seanh> 1. The initial load of annotations, 2. When the selected group in the dropdown changes
<seanh> I've actually just got it working, but I should probably look into refactoring 1 to just be another case of 2
<seanh> Yeah, I need to factor this better, but the good news is that I don't think focus-on-a-group is going to be very difficult
<nick> So typically in angular land you would solve this problem using the scope
<nick> so the groupList directive could take a callback parameter to execute when a group is clicked on
<nick> I don't think the groups service should need to know anything about the annotation mapper
<nick> it's just a container object for the singleton state of the "focused group"
<nick> I suppose you could put the callback there...
<nick> ...anyway, there are options :)
<seanh> The way that I have working right now is that the groups service just emits a "groupFocused" event
<nick> Ok, great. I'd like to get away from using events for control as far as possible, but I'm certainly happy to take a look at a PR so I can talk about the concrete rather than the abstract!
<seanh> Yeah, okay. I'll try it with events first and then we can talk, I agree they're bad
<seanh> The ugliness mostly comes from annotationMapper now keeping track of two lists of annotations: all the ones it has received, and the ones it's currently showing
<nick> Cool. I'll take a look tomorrow.
<nick> I'm sure we can clean it up a bit.
travis-ci joined the channel
travis-ci
hypothesis/h#8214 (remove-dependencies-on-threading - df00c89 : Sean Hammond): The build is still failing.