1. 23 Sep, 2024 1 commit
  2. 20 Sep, 2024 4 commits
    • Robert Knight's avatar
      Take into account the forced-visible set when filtering threads · 7e9a65e5
      Robert Knight authored
      When filtering annotations the `forcedVisible` list was taken into account, but
      not when filtering threads. Consult this list when filtering threads as well.
      
      This fixes an issue where newly created annotations would not be shown if they
      did not match a thread filter. Note that newly added annotations are added to
      the forced-visible set by the `ThreadList` component.
      7e9a65e5
    • Robert Knight's avatar
      Only apply selector filters to threads, not replies · 3c90f0c0
      Robert Knight authored
      Add a property to filter facets which indicate whether they apply to annotations
      and replies or only threads. Use this property to apply the filter either to all
      annotations or only the root annotation in a thread respectively.
      
      Queries based on the user or annotation body for example can apply to both.
      Queries based on a selector such as page number, book chapter or quote only make
      sense as thread-level filters.
      
      Fixes https://github.com/hypothesis/support/issues/158
      3c90f0c0
    • Robert Knight's avatar
      Allow draft annotations to match filters · 19fc6f7f
      Robert Knight authored
      The internal function that filters annotations returned a list of matching IDs.
      Unsaved annotations do not have IDs, so were excluded from the matches. Change
      the function to return a list of matching annotations instead, lifting this
      restriction.
      
      No callers of the function had to change because currently they only test the
      length of the returned array.
      
      A caveat with this change is that it only matches the data stored in the
      annotation object, not data stored in separate "draft" objects which are
      combined when rendering unsaved annotations. The result is that a filter will
      only match the fields of the annotation that are populated when the new
      annotation initially appears in the sidebar. This for example includes the user
      and page number, but not text added in the text field later.
      19fc6f7f
    • Robert Knight's avatar
      Treat empty strings as unparsable instead of open page ranges · 76040e76
      Robert Knight authored
      Previously `pageLabelInRange` treated an empty label like a fully-open page
      range ("-"). Since a fully open range overlaps all other ranges, the function
      would always return true. Now it treats an empty string as an unparsable range
      and returns false.
      
      When filtering annotations, this change means that a page range filter will
      no longer match annotations without a page range.
      76040e76
  3. 18 Sep, 2024 4 commits
  4. 16 Sep, 2024 8 commits
  5. 12 Sep, 2024 1 commit
  6. 09 Sep, 2024 5 commits
  7. 04 Sep, 2024 9 commits
  8. 02 Sep, 2024 1 commit
  9. 28 Aug, 2024 1 commit
  10. 26 Aug, 2024 4 commits
  11. 22 Aug, 2024 1 commit
  12. 21 Aug, 2024 1 commit
    • Robert Knight's avatar
      Fix failure to fetch groups in VitalSource · ab548854
      Robert Knight authored
      Before loading groups the client waits for the main document frame to connect in
      order to be able to fetch groups associated with that frame's URL. In
      VitalSource however there is no "main frame", only the current content frame, so
      `GroupsService._loadGroupsForUserAndDocument` waited indefinitely.
      
      This failure to fetch groups did not happen on the initial launch due to a
      different bug in `GroupsService._loadGroupsForUserAndDocument`. The
      `this_store.route()` call returned `null` during startup and hence the code did
      not wait for the main frame to connect. After a subsequent login/logout however,
      the `route` call returned "sidebar" and the code did wait for the main frame.
      
      This problem also did not happen in the LMS environment because there the client
      loads a set of groups specified by our LMS app, instead of fetching groups based
      on the logged-in user and current document.
      
      Solve the first problem by using the `defaultContentFrame` method to get the
      frame instead of `mainFrame`. `defaultContentFrame` returns the main frame if
      there is one, or the first content frame that connected otherwise.
      ab548854