WIP Overhaul view and sort behavior

Bring the view and sort controls closer in line with the latest
design decisions.

- Start in Document view and Location sort.
- When in Document view and Location sort, use dynamic bucket.
- When in any sort other than location, disable dynamic bucket.
- When in Location sort, all comments always appear at the bottom.
- Remove the Screen and Comment views.
- Remove the focus annotation state that was triggered by expanding
  a top level annotation; there is only hover emphasis now.
- The `showViewer` call always goes to Selection view.
- Using multi-select (Cmd or Ctrl Click on tabs and highlights) will
  trigger the Selection view, or switch back to the Document view
  if the selection is empty.
- Page search always searches the whole document.
- Leaving the page search switches back to the Document view.

Additionally, many cleanups were made as a result.

- No need to track focused state or comments in the client frames.
- No need to pass the view name in `updateViewer` or `showViewer`.
- No need to pass the focus purpose in `updateViewer`, `showViewer`,
  or `toggleViewerSelection`.
- Drop various helper functions around focus.
- No need to manually unshift or push newly created or streamed
  annotations into the view.
- The viewer template uses threads at the top repeater, like the
  page search template.
- The app controller maintains all the annotations on the root scope,
  the current selection shadowing it on the application scope, and
  a cheap, identity watch that retreives the threads.
- The page search can use a cheap watch on the threads to refresh.
- The reply list of each annotation is no longer set on the annotation
  object.
- The thread directive now watches the thread children and keeps them
  sorted, rather than the annotation directive.
- The recursive `buildReplyList` function is no longer needed.
- Scattered use of the root scope is much reduced.
- Drop requestAnimationFrame polyfill because angular has its own.
- Drop the recursive directive, splitting out thread.html and using
  using ng-include for recursion.
- Use a single render queue for all threads and sequence updates on
  animation frames, resulting in smooth, progressive rendering.
- Combine the viewer and page_search templates.
Not worrying about this one because I have a stash I'll get ready soon that
eliminates this hack with a more elegant forced login approach.


On Mon, Aug 25, 2014 at 1:58 AM, Aron Carroll <notifications@github.com>
wrote:

> In h/static/scripts/controllers.coffee:
>
> > @@ -492,8 +428,7 @@ class Editor
> >            annotator.unsubscribe 'annotationCreated', save
> >            annotator.unsubscribe 'annotationDeleted', cancel
> >
> > -    $scope.annotation = annotator.ongoing_edit
> > -
> > +    $scope.thread = message: annotator.ongoing_edit
>
> Would be great to start tidying up these snake case variables as we
> refactor.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/hypothesis/h/pull/1436/files#r16647039>.
>