Closed robertknight closed 1 month ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 99.43%. Comparing base (
76040e7
) to head (0b1e540
). Report is 3 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I noticed a weird behavior when testing this, which is that the annotation creation card does not show while the filter is applied:
Ah. It turns out there was another existing issue where thread-level filtering did not take into account the set of "forced visible" threads which are shown even if they don't match the filter. Annotation-level filtering did handle this. See https://github.com/hypothesis/client/pull/6562/commits/0b1e5401366a672846fb6c18cd6b71a96fbfcd25.
There is something else wrong here though, because in this context it shouldn't matter if the annotation is in the "forced visible" set or not. The annotation was created on a page that matches the filter, and the page info is present in the new annotation. Update: The explanation for this is https://github.com/hypothesis/client/pull/6565.
Add a property to filter facets which indicate whether they apply to annotations and replies or only top-level annotations. 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
Testing:
In Step 2 there is a known issue that the "Show replies" toggle disappears when the filter is active. The reply should nevertheless be visible. In contrast on the
main
branch, then the "Selected chapter" filter is active, the reply will initially be hidden and shown under "Show N more in conversation".