1. 05 Aug, 2016 5 commits
  2. 04 Aug, 2016 7 commits
    • Robert Knight's avatar
      Switch back to the Annotations tab when the last orphan is removed · 856685f3
      Robert Knight authored
      When there are no orphans, the Orphans tab is not shown, so we need to
      switch back to the Annotations tab in that case.
      856685f3
    • Robert Knight's avatar
      Simplify tab counts calculation and move into a separate module · 8977ca5f
      Robert Knight authored
      Refactor some repetition in the functions that produced the counts for
      the Annotations, Page Notes and Orphans tabs and extract it into a
      separate module where it is easier to test.
      
      Moving this into a single function also makes it easier to memoize
      later, so we can avoid recalculating it when the list of annotations has
      not changed between two app states.
      8977ca5f
    • Robert Knight's avatar
    • Sheetal Umesh Kumar's avatar
      Separate anchored and unanchored annotations into tabs. · 054cb186
      Sheetal Umesh Kumar authored
      Default to the annotations tab when user switches between groups, clears a selection or reloads a page.
      The ANNOTATIONS_SYNCED event is emitted when annotations for a document have finished anchoring. Because annotations are not marked as orphans until they fail to anchor, select the annotations tab after they have finished anchoring.
      
      Test cases:
      -------------
      1. On page load localhost:3000
         annotations tab is selected.
         clicking on new note switches to the notes tab with a new draft created.
         switching between tabs maintains tab selection, if notes or annotations.
         when tab selected is orphans, changing groups defaults to the annotations tab.
      2. On page load localhost:3000/#annotations:<id>
         clicking on new page note should select the notes tab.
         When an annotation/note is selected, the tab selection carries between group changes.
         all tests listed in #1 above should apply.
      3. On page load  localhost:3000/#annotations:<orphan_id>
         clicking on “show all annotations and notes” selects the annotations tab and displays all annotations.
         all tests listed in #1 and #2 above should apply.
         switching between groups selects the annotations tab by default
      
      https://trello.com/c/1NVK2jwv/400-add-a-tab-for-unanchored-annotations
      https://trello.com/c/OLdLTlLT/342-separate-annotations-and-notes
      
      Hide orphans tab behind orphans_tab flag.
      
      Fix bug where notes tab isn't selected when user attempts to create a new page note.
      054cb186
    • Robert Knight's avatar
      Update annotation tag and anchoring status via a Redux action (#70) · cecb3b66
      Robert Knight authored
      Update an annotation's anchoring status and local tag via a Redux action
      rather than just direct assignment to the annotation's properties.  This
      ensures that store subscribers and a digest cycle happen after the
      anchoring status changes. This in turn ensures that the UI state is kept
      in sync.
      
      This also brings us another step closer to being able to make annotation
      objects immutable within the sidebar app.
      cecb3b66
    • Robert Knight's avatar
      Add a service which provides Hypothesis service URLs (#69) · 323edcc9
      Robert Knight authored
      Add a service which maps named, parameterized routes to corresponding
      URLs on the Hypothesis service.
      
      This makes it easier to identify which URLs the client links to on the
      service and update all uses of a particular URL.
      323edcc9
    • Sheetal Umesh Kumar's avatar
      eb9f1ed6
  3. 03 Aug, 2016 3 commits
  4. 02 Aug, 2016 4 commits
    • Robert Knight's avatar
      Merge pull request #57 from hypothesis/fix-rootscope-usage · 9e5755da
      Robert Knight authored
      Fix incorrect usages of the $rootScope
      9e5755da
    • Nick Stenning's avatar
      Update npm-shrinkwrap.json · 2ea88e19
      Nick Stenning authored
      I'm not really sure I understand the mechanism by which this is out of
      date or even what the changes here imply, but this is the result of
      running
      
          npm shrinkwrap --dev
      
      with latest npm (3.10.5), and the output appears to be stable --
      multiple runs do not change it further.
      
      In addition, installing new packages and rerunning `npm shrinkwrap
      --dev` appears to generate a minimal diff after this one-off update.
      2ea88e19
    • Nick Stenning's avatar
      Embed release version in built package · af954a8a
      Nick Stenning authored
      Rather than relying on the release version being passed in as config,
      build the current release version (as read from `package.json`) into the
      bundle.
      
      We use browserify-versionify for this, rather than simply requiring
      `package.json`, as our current build toolchain does not support any kind
      of tree-shaking, so `require('package.json')` would pull the whole of
      the `package.json` file into the bundle.
      af954a8a
    • Alice Wyan's avatar
  5. 01 Aug, 2016 7 commits
  6. 29 Jul, 2016 1 commit
    • Robert Knight's avatar
      Make the adder a self-contained component (#48) · dbd16d1d
      Robert Knight authored
      * Make the adder a self-contained component
      
      Move adder event handling and UI creation to Adder component, so that
      Guest does not need to know about its internal structure or handle
      events for it. Instead it just supplies callbacks to invoke when the
      Annotate and Highlight buttons are clicked.
      
      This makes it easier to test event handling for the adder and to make
      future changes to the UI of the Adder.
      
      This commit removes a piece of logic that stopped propagation of
      'mouseup' events from the adder because I couldn't find a clear
      explanation in the code or commit history of why that was done.
      
      * Remove a couple of misplaced assertions from tests
      
      Remove assertions checking the horizontal position of the adder in tests
      which are only concerned with the vertical position of the adder
      relative to the selection.
      dbd16d1d
  7. 27 Jul, 2016 5 commits
  8. 26 Jul, 2016 1 commit
  9. 25 Jul, 2016 1 commit
    • Nick Stenning's avatar
      Ensure that frame-rpc event listeners are correctly torn down · 6ca273c1
      Nick Stenning authored
      When the client is destroyed, it's important that we correctly tear down
      the frame-rpc event listeners (bound to the document's `onmessage`
      event).
      
      These event listeners are responsible for relaying messages from the
      frame-rpc mechanism to various parts of the code on either side of the
      frame boundary, including the `AnnotationSync` component. If the
      frame-rpc channels aren't correctly torn down, they will hold a
      reference to the `Bridge` object, which in turn holds a reference to the
      `AnnotationSync` object, and thus old copies of `AnnotationSync` which
      should have been garbage-collected will continue to receive events from
      the brand new Hypothesis client.
      
      The most visible result of this problem was that repeated activation and
      deactivation of the client would result in increasing numbers of
      highlights being drawn on annotated text, as reported in
      hypothesis/h#3096.
      
      Fixes hypothesis/h#3096.
      6ca273c1
  10. 22 Jul, 2016 3 commits
    • Robert Knight's avatar
      0.35.0 · 429009ca
      Robert Knight authored
      429009ca
    • Robert Knight's avatar
      Update CHANGELOG.md · a18345d9
      Robert Knight authored
      a18345d9
    • Robert Knight's avatar
      Remove PhantomJS-specific polyfills (#45) · 6656a63f
      Robert Knight authored
      PhantomJS supports ES5 fully and does not require specific polyfills for
      it. This means that we can use exactly the same polyfill script in both
      our unit tests and the actual app, which reduces the chances of breakage
      due to mismatches.
      
      Additionally, the broken URL constructor could potentially affect other
      browsers, so it makes sense to include it in the main polyfill script.
      6656a63f
  11. 21 Jul, 2016 3 commits