1. 03 May, 2021 2 commits
    • Robert Knight's avatar
      Refactor `SessionService` to a more idiomatic ES class · 1c3aa03b
      Robert Knight authored
       - Convert closures into methods
      
       - Remove the `profileFetchRetryOpts` field that was used only to shorten the
         delay between retries in tests, in favor of mocking
         `retryPromiseOperation` in tests to remove the delay between retries.
      
       - Change `SessionService` instance creation in tests to allow
         individual tests to run custom setup logic before the service is
         constructed. This was needed due to allow the `serviceConfig` mock to
         take effect when the `SessionService` constructor runs
      
       - Remove unnecessary custom Sinon sandbox in tests
      1c3aa03b
    • Robert Knight's avatar
      Convert `session` service to ES class · 2376f0f8
      Robert Knight authored
      This is a straightforward conversion, except for the removal of an
      unused `state` property on the instance.
      
      Part of https://github.com/hypothesis/client/issues/3298
      2376f0f8
  2. 29 Apr, 2021 5 commits
  3. 28 Apr, 2021 1 commit
    • Robert Knight's avatar
      Ignore zero-height highlights when creating bucket bar buckets · e1eaca4a
      Robert Knight authored
      When a PDF page transitions from a rendered to non-rendered state the
      text layer element is removed and existing highlights in that layer
      briefly become disconnected from the document. As a result they have an
      empty/zero client rect as returned by `element.getBoundingClientRect()`.
      This caused the bucket-building logic to think that the anchor
      had moved to the top of the screen as the `top` and `bottom` coordinates
      of the anchor box became zero. This could lead to anchors which should
      be in the "below screen" bucket briefly jumping to the "above screen"
      bucket. Once re-anchoring completes and the highlight is anchored into a
      placeholder element for the non-rendered page, its anchor box becomes
      non-empty again and the anchor "jumps back" to the "below screen" box.
      
      This commit adds logic to ignore any highlights which have zero height,
      including highlight elements that are disconnected from the document.
      e1eaca4a
  4. 27 Apr, 2021 7 commits
  5. 26 Apr, 2021 17 commits
  6. 22 Apr, 2021 8 commits