1. 11 Jan, 2021 6 commits
  2. 08 Jan, 2021 2 commits
  3. 04 Jan, 2021 10 commits
  4. 28 Dec, 2020 1 commit
  5. 26 Dec, 2020 3 commits
  6. 21 Dec, 2020 4 commits
  7. 18 Dec, 2020 7 commits
  8. 17 Dec, 2020 3 commits
    • Robert Knight's avatar
      Defer initial WebSocket connection until profile is fetched · a120b2dd
      Robert Knight authored
      Following https://github.com/hypothesis/client/pull/2837 the
      `SidebarView` component may now be rendered before the profile has been
      fetched. This component contains an effect which triggers the initial
      WebSocket connection. Since the WebSocket reconnects after the profile userid
      changes, this was causing the initial connection to almost immediately
      be disconnected if the user was logged in. Fix this by deferring the initial
      connection until after the profile has been fetched.
      a120b2dd
    • Robert Knight's avatar
      Sync route before waiting for groups and profile to load · 013c82e5
      Robert Knight authored
      Do not wait for groups and profile to load before calling
      `router.sync()` to set the initial route and thereby render the
      appropriate content component.
      
      Historically the main view components assumed that the user profile and
      groups were already loaded before they were rendered, but this is no
      longer the case.
      
      This fixes a brief flash of the sidebar's `TopBar` component inside the
      notebook when it initially loads. It also results in the `Annotations`
      and `Page Notes` tabs appearing immediately in the sidebar rather than
      waiting until the groups list is populated.
      013c82e5
    • Robert Knight's avatar
      Move scroll container measuring into a layout effect · eaaddb46
      Robert Knight authored
      `ThreadList` was measuring the height and scroll offset of the scroll
      container inside the render function instead of a layout effect. As a result
      it could fail if the scroll container is rendered by a parent component
      and its DOM has not yet been created.
      
      This issue was uncovered when trying to change the app to call
      `router.sync()` before waiting for `groups.load()` to complete.
      
      A test expectation had to be changed becaused it turned out that the
      scroll container had the wrong height when it was measured in the
      previous way (it was measured as 0px instead of the expected 350px).
      eaaddb46
  9. 16 Dec, 2020 4 commits
    • Robert Knight's avatar
      Combine `xpath-util` and `xpath` into a single module · e8488b43
      Robert Knight authored
      There was no good reason for the separation between the two any more.
      e8488b43
    • Robert Knight's avatar
      Remove unused range selector generation and anchoring code · b4134e52
      Robert Knight authored
       - The logic for anchoring and generating range selectors provided by `range.js`
         has been replaced in `RangeAnchor`.
       - The normalization of DOM Ranges is no longer required by the rest of
         the code.
      b4134e52
    • Robert Knight's avatar
      Convert `RangeAnchor` to use `TextRange` · 6943f6dd
      Robert Knight authored
      Convert `RangeAnchor` to use `TextRange` and the XPath <-> Node mapping
      functions in xpath.js directly, rather than the `SerializedRange` and
      `NormalizedRange` classes.
      
      This change will mean that all conversion between text positions and
      (text node, offset) points in the client will use the same implementation.
      For `RangeAnchor` selectors this conversion is used for the
      `startOffset` and `endOffset` fields.
      
      The new implementation also avoids modifying the DOM, unlike the
      previous implementation which would sometimes split text nodes. Avoid
      DOM modifications during anchoring opens up the possibility of
      optimizing anchoring by caching text position <-> text node associations.
      6943f6dd
    • Robert Knight's avatar
      Fix menu caret positioning · 0584d344
      Robert Knight authored
      https://github.com/hypothesis/client/pull/2818 inadvertently changed the size
      of the `.menu-toggle__icon` SVG element from 10x10px to 16x16px due to an
      `svg` selector introduced by the `buttons.button--icon-only` mixin
      taking precedence over the `.menu-toggle__icon` selector.
      
      As a result, the caret's vertical position was incorrect and it did not
      remain vertically centered when flipped.
      
      This commit nests the `.menu-toggle__icon` selector inside the parent
      `.menu-toggle` selector to restore the caret icon back to its 10x10
      pixel size.
      0584d344