1. 25 May, 2016 9 commits
    • Robert Knight's avatar
      Fix strict-mode violations in streamer.js (#3358) · afc5812a
      Robert Knight authored
      Fix several missing 'var' declarations in streamer.js
      afc5812a
    • Nick Stenning's avatar
      Merge pull request #3285 from hypothesis/virtualize-thread-list · 536ba5e0
      Nick Stenning authored
      New threading 4/N - Virtualize the thread list
      536ba5e0
    • Robert Knight's avatar
      Scroll new annotations into view · d0876bbd
      Robert Knight authored
      Re-implement the behavior to scroll newly created annotations into view
      in the sidebar so that the user can start editing them immediately.
      
      A complication with doing this given that the annotation list is
      virtualized is that if we want to scroll to the Nth visible annotation,
      we may not know the actual heights of the N-1 annotations above it.
      
      As a result of scrolling the list, some of the heights of those N-1
      annotations may be updated from an estimate to an actual measured
      height, changing the Y offset that we want to scroll to in order
      to make the Nth annotation visible.
      
      There are a few strategies that we could use for dealing with this:
      
       1. Forcibly render all N-1 annotations and measure their height.
          This is prohibitively expensive for long annotation lists.
      
       2. Use a cheaper method to calculate the exact height of an annotation.
          Unfortunately we don't have a way to do this at the moment.
      
       3. Use an iterative approach:
      
          a. Estimate the target position based on current known/guessed
             heights.
      
          b. Scroll to the estimated position, which will trigger re-rendering
             and possibly alter the known thread heights.
      
          c. Re-estimate the target position and if it changed, go to step b.
      
      This commit implements the third method.
      d0876bbd
    • Robert Knight's avatar
      Remove margins for spacer elements in thread list · 488ebdc1
      Robert Knight authored
      These elements are used purely to reserve space for offscreen threads
      which are not actually present in the DOM, so they should not occupy any
      space beyond that assigned to their 'height' inline style properties.
      488ebdc1
    • Robert Knight's avatar
      Take into account top and bottom margins when computing annotation card heights · b2faeb98
      Robert Knight authored
      Annotation cards have a small (~8px) margin at the bottom which needs to
      be taken into account when computing the height of each thread in order
      to accurately size the spacer element which reserves space for
      off-screen threads.
      b2faeb98
    • Robert Knight's avatar
      Improve code comments for VirtualThreadList · fdd58e8d
      Robert Knight authored
      Expand the class description to better explain how virtualization
      improves UI performance.
      fdd58e8d
    • Robert Knight's avatar
      Save annotation state to drafts whenever annotation component is destroyed · 645858cb
      Robert Knight authored
      Prior to this unsaved changes were lost when an annotation being edited
      was scrolled off-screen and the annotation component was destroyed.
      
      There was already a mechanism in place for persisting unsaved changes
      to a temporary store when switching accounts and when switching groups
      but this was only triggered when the signed in user changed or the
      focused group changed.
      
      This commit unifies the handling of all three cases by listening
      for the '$destroy' event which is fired whenever an <annotation>
      is about to be destroyed.
      645858cb
    • Robert Knight's avatar
      Fix top bar juddering when scrolling window · 617148e1
      Robert Knight authored
      Use transform3d() to force the top bar onto a new compositor layer so
      that it does not judder around when scrolling the window.
      
      The better fix here will be to make the body scroll rather than the
      whole window.
      617148e1
    • Robert Knight's avatar
      Virtualize the annotation thread list · 0e67b614
      Robert Knight authored
      Make the sidebar handle "large" (ie. 50+) numbers of annotation threads
      much better by virtualizing the thread list. Virtualizing means that we
      only instantiate <annotation-thread> components for threads which are
      either in or 'near' (above/below) the viewport. For the remaining
      offscreen threads space is reserved by a couple of <li> elements above
      and below the visible threads.
      0e67b614
  2. 23 May, 2016 2 commits
  3. 13 May, 2016 10 commits
  4. 12 May, 2016 7 commits
  5. 11 May, 2016 4 commits
  6. 10 May, 2016 7 commits
  7. 09 May, 2016 1 commit