1. 06 Nov, 2024 2 commits
    • Robert Knight's avatar
      Update browser baseline for boot script · 39cf23df
      Robert Knight authored
      The client's boot script supports older browsers than the rest of the client so
      it can log a warning if it can't start in "somewhat" older browsers.
      
      Update the boot script's supported officially browsers from ~2013 (IE 11) to
      ~2017 (Safari 11), although the code will probably still run in older browsers.
      This allows dropping an async/await Babel plugin, although async is not actually
      used in the current boot script.
      39cf23df
    • Robert Knight's avatar
      Replace hammer.js with local code · 1b5c4076
      Robert Knight authored
      Hammer.js is used to facilitate resizing the sidebar by dragging the sidebar
      button. For this use case, we can avoid a dependency which is not actively
      maintained, get more visibility into what the code is doing and make testing
      easier by using a small amount of our own code.
      
      In the process the tests for drag resizing in the sidebar were refactored to
      avoid referencing private fields of `Sidebar` and mocking `getComputedStyle`.
      
      The user-facing behavior should be unchanged.
      1b5c4076
  2. 05 Nov, 2024 2 commits
  3. 04 Nov, 2024 9 commits
  4. 30 Oct, 2024 2 commits
    • Robert Knight's avatar
      Update `allowLeavingGroups` docs to match reality · 2522dc18
      Robert Knight authored
      Update the documentation to match the current behavior. As noted in
      https://github.com/hypothesis/client/pull/6638, the code comments and behavior
      were inconsistent. Since changing the behavior is potentially disruptive, that
      PR changed the comments instead. This commit updates the publisher-facing
      documentation.
      2522dc18
    • Robert Knight's avatar
      Show "Leave group" option for open and restricted groups that user is a member of · d14c255b
      Robert Knight authored
      Previously the "Leave group" option was only shown for private groups on the
      basis that membership of open and restricted groups was managed by h admins.
      However first-party Hypothesis users can now create open and restricted groups
      themselves and members of these groups will see an option to leave the group on
      activity pages. Align whether the client shows the "Leave group" option with h's
      behavior.
      
      During this change it was noticed that the documentation in the code and test
      descriptions did not match the actual handling of `allowLeavingGroups`. The
      comments said that services had to explicitly set `allowLeavingGroups` to
      prevent users leaving. However the code would treat `allowLeavingGroups` as false
      if a) service configuration was present and b) the value of `allowLeavingGroups`
      was falsey (including undefined). Changing this behavior may cause issues for
      existing users of third party authorities, so this commit updates the
      documentation and tests to accurately describe the current behavior.
      
      Fixes https://github.com/hypothesis/client/issues/6637
      d14c255b
  5. 28 Oct, 2024 11 commits
  6. 23 Oct, 2024 1 commit
  7. 22 Oct, 2024 2 commits
  8. 21 Oct, 2024 5 commits
  9. 18 Oct, 2024 1 commit
  10. 16 Oct, 2024 1 commit
  11. 15 Oct, 2024 1 commit
    • Robert Knight's avatar
      Initialize route state in store before fetching groups · 25358a00
      Robert Knight authored
      The behavior of `GroupsService.load` varies depending on whether the current
      route is the sidebar or not. During sidebar startup, `GroupsService.load` was
      called before `RouterService.sync`. As a result the route was `null` during the
      initial call to `GroupsService._loadGroupsForUserAndDocument` and hence the
      service did not execute the sidebar-specific code path to wait for the document
      URI to become known at that point.
      
      During the first `GroupsService._loadGroupsForUserAndDocument` call,
      `_setupAutoReload` would set up a watcher that would react to changes in
      `store.mainURI()`. This watcher would fire after the main guest frame connects.
      Depending on when that happens, requests from the initial `GroupsService.load`
      request could still be in-flight. If the second set of groups API calls
      completed first, followed by the first set of groups API calls, then the final
      set of loaded groups might reflect the _first_ call to `GroupsService.load`,
      where the document URI was not used (because the route was unknown).
      
      This commit fixes the issue by re-arranging the sidebar startup sequence to
      initialize the router service before other services.
      
      Fixes https://github.com/hypothesis/support/issues/79
      25358a00
  12. 14 Oct, 2024 3 commits
    • Alejandro Celaya's avatar
      Update dev express server to v5 · 6a6e3ce7
      Alejandro Celaya authored
      6a6e3ce7
    • Robert Knight's avatar
      Fix flakey ProfileModal tests · 0340a9f1
      Robert Knight authored
      The ProfileModal tests would sometimes fail with this error:
      
      ```
      FAILED TESTS:
         "after each" hook for "shows modal on "openProfile" event"
          Chrome Headless 129.0.0.0 (Linux x86_64)
        Error: Failed to execute 'showModal' on 'HTMLDialogElement': The element is not in a Document.
      ```
      
      The `HTMLDialogElement.showModal` call happens in an effect when the
      `ModalDialog` component is rendered with the `isClosed` prop set to false. In
      the ProfileModal tests, the component was rendered in a disconnected DOM node,
      so this error should have happened on every run. However the
      `emitter.publish("openProfile")` call which triggered this render was not
      wrapped in `act` and so the effect which calls `showModal` was scheduled, but
      often did not actually run before the component was unmounted in the `afterEach`
      hook.
      
      Fix the issue by:
      
       - Wrapping all `emitter.publish("openProfile")` calls in `act`, so they
         synchronously execute the effect.
       - Rendering the `ProfileModal` component in a connected DOM container
         which is removed after the test runs
       - For consistency, update the `NotebookModal` tests to work in the same
         way as the ProfileModal tests, with a single container element which
         is removed at the end of the test
      0340a9f1
    • dependabot[bot]'s avatar
      Bump typescript from 5.6.2 to 5.6.3 · 25b6147c
      dependabot[bot] authored
      Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.6.2 to 5.6.3.
      - [Release notes](https://github.com/microsoft/TypeScript/releases)
      - [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
      - [Commits](https://github.com/microsoft/TypeScript/compare/v5.6.2...v5.6.3)
      
      ---
      updated-dependencies:
      - dependency-name: typescript
        dependency-type: direct:development
        update-type: version-update:semver-patch
      ...
      Signed-off-by: 's avatardependabot[bot] <support@github.com>
      25b6147c