1. 13 Jan, 2021 3 commits
    • Lyza Danger Gardner's avatar
      Adjust UI for sharing annotations on non-shareable documents · 53b33217
      Lyza Danger Gardner authored
      In both the share-this-annotation and share-this-page's-annotations
      components, provide a UI path for when the annotation's URI or the
      page's URI (respectively) are not web-available. That is, to be
      "shareable in context", the URI in question needs to have an
      `http:` or `https:` protocol.
      
      For "share this page's annotations" when the page is not web-accessible,
      explain why the page's annotations can't be shared in context and don't
      provide a sharing link, as it won't work.
      
      For "share this annotation," when the annotation's URI (document) isn't
      web-accessible, provide some explanatory text about how it can't be
      shared in-context, but provide a link to the single-annotation view,
      when available.
      
      These changes are intended to avoid confusion when users try to share an
      annotation or a set of annotations that have been made on a local
      (e.g. PDF) document.
      
      Some SCSS patterns have also been adjusted to accommodate more flexible
      styling of the share-single-annotation panel. The width of the compact
      panel pattern has been increased slightly so that the new wording
      variant for not-shareable-in-context single annotations doesn't risk
      taking up too much vertical space.
      
      Fixes #2786
      53b33217
    • Lyza Danger Gardner's avatar
      3a7c1157
    • Lyza Danger Gardner's avatar
      Add typing utility module · 488664af
      Lyza Danger Gardner authored
      Add a typing utility module with a helper function to "cast" the input
      so that TS understands that it is not null/undefined. This is useful
      in situations where logic would prevent a reference from being empty
      but TS can't follow that logic.
      488664af
  2. 11 Jan, 2021 6 commits
  3. 08 Jan, 2021 2 commits
  4. 04 Jan, 2021 10 commits
  5. 28 Dec, 2020 1 commit
  6. 26 Dec, 2020 3 commits
  7. 21 Dec, 2020 4 commits
  8. 18 Dec, 2020 7 commits
  9. 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
  10. 16 Dec, 2020 1 commit