client icon indicating copy to clipboard operation
client copied to clipboard

Incorrect Conversion of Overlapping Highlights or Notes Upon Page Navigation

Open likithesh-ts opened this issue 1 year ago • 5 comments

Bug Description: When overlapping highlights or notes occur in the Hypothesis client, navigating between pages causes the overlapped words to be mistakenly converted into either highlights or notes. This issue specifically arises when a note is applied to a word that is already highlighted or vice versa, and then navigating to another page and returning to the original page.

Steps to Reproduce: -> Highlight two words. -> Add a note to the first word, which is already highlighted. -> Navigate to another page and then return to the original page. -> Observe that the entire two words may be converted into either highlights or notes.

Expected Behavior: After navigation, the highlighted and noted words should remain intact without any conversion.

Before switching pages:

image

After switching pages:

image

Reference video:

https://github.com/hypothesis/client/assets/159520431/b87e2cf4-3571-416f-b70c-b2ff673a83bf

likithesh-ts avatar Apr 25 '24 06:04 likithesh-ts

That's not a standard build of the Hypothesis client shown in the video, which also probably means it is not based on a current version. The controls in the standard build look like this:

Annotate Highlight

Can you confirm the version number that is shown in the sidebar (it's under the "?" button), the URL of the page that is being annotated (if there is one) or the software in which Hypothesis is being used?

robertknight avatar Apr 25 '24 07:04 robertknight

That's not a standard build of the Hypothesis client shown in the video, which also probably means it is not based on a current version. The controls in the standard build look like this:

Annotate Highlight Can you confirm the version number that is shown in the sidebar (it's under the "?" button), the URL of the page that is being annotated (if there is one) or the software in which Hypothesis is being used?

We have made some changes on the CSS part so it's looking bit different than the standard version and I was able to replicate this issue in latest version of the hypothesis-client. Please find the below video for reference https://github.com/hypothesis/client/assets/159520431/2a50c3dc-e34e-4943-8c5e-36ad58fc040c

likithesh-ts avatar Apr 25 '24 10:04 likithesh-ts

In that video I see two highlights created and saved and two notes created, but not saved. After the navigation away from the page and back to it, only the saved highlights persist. Changing groups in the sidebar would also lead to the same result as a navigation.

If the issue here is the confusion that the draft notes are not automatically saved, or that there isn't a warning about it, then that's understandable and I would recommend to create a specific issue about it.

robertknight avatar Apr 25 '24 10:04 robertknight

In that video I see two highlights created and saved and two notes created, but not saved. After the navigation away from the page and back to it, only the saved highlights persist. Changing groups in the sidebar would also lead to the same result as a navigation.

If the issue here is the confusion that the draft notes are not automatically saved, or that there isn't a warning about it, then that's understandable and I would recommend to create a specific issue about it.

If you watch the video below, you'll notice that before navigation, highlighted text and notes appear in different colors: highlights are light yellow, while notes are a darker shade. However, when switching between pages, both words become the darker shade of yellow. Additionally, clicking on a noted word in the sidebar should only highlight the single word that we initially highlighted, but it highlights both words instead.

https://github.com/hypothesis/client/assets/159520431/ccab1ffb-b8bc-42c5-af01-0a68fcaf752f

likithesh-ts avatar Apr 29 '24 06:04 likithesh-ts

highlighted text and notes appear in different colors: highlights are light yellow

Highlights and annotations don't actually have different colors, but we do show a "darker" color when there are "stacked" annotations, or more than one annotation in the same block of text, in order to more visually spotlight what parts are heavily annotated.

In fact, it's not really darker, technically speaking. What really happens is that the element we use for highlights and annotations has a yellow color with opacity. As an intentional side effect, the opacity makes it look darker the more annotations are rendered in the same piece of text.

However, when switching between pages, both words become the darker shade of yellow. Additionally, clicking on a noted word in the sidebar should only highlight the single word that we initially highlighted, but it highlights both words instead.

I was able to reproduce this with the standard hypothesis client in that particular Google search result, but not in other pages.

I think this was a known issue due to how hypothesis detects where the quoted text starts and ends. Let me see if I can find some related issue.

acelaya avatar Apr 29 '24 08:04 acelaya