hypothesis / product-backlog

Where new feature ideas and current bugs for the Hypothesis product live
118 stars 7 forks source link

Removing filter in sidebar brings user back to top #1177

Open klemay opened 3 years ago

klemay commented 3 years ago

Steps to reproduce:

  1. Open a web page or document that has a lot of annotations - you could even try this on the Hypothesis website home page.
  2. Scroll down a ways and click on a highlight. The sidebar will be filtered to only show annotations associated with that text selection: Screen Shot 2021-02-12 at 3 30 58 PM
  3. Click the "Show all" button to clear the filter

Expected behavior

The sidebar shows the annotation I was just looking at, with the preceding and following annotations being viewable by scrolling up or down in the sidebar

Actual behavior

The sidebar scrolls all the way back to the top. You have to scroll and manually find the annotation you were just looking at:

Screen Shot 2021-02-12 at 3 33 46 PM

Notes

klemay commented 3 years ago

Notes from a conversation in Slack: This gets tricky when a user is filtering by search term rather than by document location. For example, visit this PDF and search the sidebar for the term "sequence". The sidebar looks like this:

Screenshot 2021-02-16 at 3 54 13 PM

When a user clicks "Clear search", where should we scroll the sidebar to? Should it be to the first search result?

...or would it be possible to have different behaviors for "Show all" vs "Clear Search"?