client
client copied to clipboard
Also filter the highlights on the document, when the cards in the sidebar are filtered
When you apply a search filter to the annotations in the sidebar that document continues to show the highlights for all annotations, not just the ones still being shown in the sidebar. This is confusing, especially if you click on some of the highlights.
The highlights in the document should be filtered along with the annotations in the sidebar.
FYI - I have some code related to this on my laptop, which may be a useful starting point.
Edit: Umm, no I don't, but I did look at this at one point. I may be able to dig it up again somewhere from my fork.
This came up in the context of the new search UI at https://hypothes-is.slack.com/archives/C07NXBDNW/p1706540405763019?thread_ts=1706110489.507859&cid=C07NXBDNW.
One issue with this is that clicking on a highlight in the document itself has the effect of filtering the sidebar by creating a "selection". If we naively filtered highlights to match what was visible in the sidebar, then clicking a highlight would cause all other highlights to temporarily disappear, which would be weird.
Some possible solutions:
- Only filter highlights based on the filters active in the sidebar, not counting the selection
- Don't actually hide non-matching highlights completely, but change their appearance in some way