1. 13 Dec, 2021 9 commits
  2. 10 Dec, 2021 2 commits
  3. 09 Dec, 2021 5 commits
  4. 08 Dec, 2021 7 commits
    • Eduardo's avatar
      Apply suggestions from code review · f54ca621
      Eduardo authored
      Co-authored-by: 's avatarRobert Knight <robertknight@gmail.com>
      f54ca621
    • Eduardo's avatar
      Apply suggestions from code review · f05b0759
      Eduardo authored
      Co-authored-by: 's avatarRobert Knight <robertknight@gmail.com>
      f05b0759
    • Eduardo Sanz García's avatar
      Toggle annotation/note button in multi-frame scenarios · b802451d
      Eduardo Sanz García authored
      In order to toggle correctly the `Toolbar` button between `New page
      note` and `New annotation` we have created a new `guest-host` channel of
      communication. Previous code failed to toggle the button because it used
      an event emitter, hence assuming that the `Guest` was in the same frame
      as the host.
      
      - The `Sidebar` keeps track of the iframe that has currently text
        selected. It uses the `subFrameIdentifier`. If there is no
        `subFrameIdentifier` (currently the top `Guest` frame), it sets the
        identifier to 'main', referring to the frame with the main annotatable
        content. This will change in a follow up PR that will add more logic
        into which frame is tagged as 'main'.
      
      - Only one iframe at a time can have selected text.
      
      - The event emitter `hasSelectionChanged` has been replaced by three RPC
        methods: 'textSelectedAt`, 'textDeselectedAt', 'deselecTextExcept'
      
      - `deselecTextExcept` is used to clear text selections in other frames,
        except from the iframe that has the latest selection. This is not the
        neatest solution, but for now it works.
      
      On a follow up PR I will address the removal of the shadow left from
      previous a selection.
      
      Closes https://github.com/hypothesis/product-backlog/issues/1236
      b802451d
    • Robert Knight's avatar
      Capture message validation errors when handling port provider requests · dc90424c
      Robert Knight authored
      To help us debug issues with sidebar-host connection setup [1], report an
      error to the sidebar if PortProvider receives a message which looks like
      a port request (data has the structure `{ frame1: string, frame2:
      string, type: 'request' }`) but comes from a non-Window source, invalid
      origin or is not a valid combination of frames.
      
      [1] https://sentry.io/organizations/hypothesis/issues/2810452318/
      dc90424c
    • Robert Knight's avatar
      Handle port requests from guests with opaque origins · 905077aa
      Robert Knight authored
      When a guest frame with an opaque origin, such as file:// URL or a sandboxed
      iframe, sends a request for a port to the host frame, the `event.origin` value
      will be the string "null". This is not a legal value for the `targetOrigin`
      argument to `postMessage`, so we need to remap it to "*" (any origin).
      905077aa
    • Robert Knight's avatar
      Remove a test which doesn't test what it intends to · a9ce9227
      Robert Knight authored
      Dates are in fact JSON-serializable, but as strings.
      
      Recent changes to `isMessageEqual` mean that the `JSON.stringify` calls
      cannot fail, because the `isMessage` check ensures all the fields we
      serialize are strings. Writing a test to check for this failure mode is
      not possible. There is a refactoring hazard here, so I added a comment
      to call this out.
      a9ce9227
    • Robert Knight's avatar
      Ignore unknown keys when checking payload / message match · 28fa4e8c
      Robert Knight authored
      When comparing a MessageEvent's data to an expected message, only
      compare the known fields of the message and ignore any unknown fields.
      
      Unknown fields don't cause problems for us in parsing the message, and
      there is a risk that it might cause us to silently ignore messages in
      some environments. We don't know yet if that actually happens.
      28fa4e8c
  5. 07 Dec, 2021 4 commits
    • Robert Knight's avatar
      Rebuild boot script when modules in src/boot change · 97a71736
      Robert Knight authored
      Previously the boot script was not regenerated when its JS inputs
      changed, as opposed to the JSON manifest.
      
      This approach relies on `src/boot` not having dependencies on other
      modules. We could improve this by using `watchJS`, but that currently
      produces too much distracting log noise when running `make dev`.
      97a71736
    • Robert Knight's avatar
      Serve boot script with correct mime type · 251410ca
      Robert Knight authored
      It was previously served as text/html, which caused warnings in some
      contexts.
      251410ca
    • Robert Knight's avatar
      Modernize browser check logic · 7173bde9
      Robert Knight authored
      Update the representative feature tests to check for Shadow DOM v1 and CSS grid.
      
      This avoids loading the client in browsers that are definitely too old.
      7173bde9
    • Lyza Danger Gardner's avatar
      Fully un-set user-focus filter when empty user is passed · 791c4bf2
      Lyza Danger Gardner authored
      Fix a UI confusion by fully un-setting the user-focus filter if a
      empty user value is provided to the `changeFocusModeUser` RPC method.
      
      This prevents a confusing half-set user-focus filter from sticking
      around when an instructor returns to viewing all users in grading mode
      after focusing on one or more students.
      791c4bf2
  6. 06 Dec, 2021 12 commits
  7. 03 Dec, 2021 1 commit