Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Conversion of Overlapping Highlights or Notes Upon Page Navigation #6348

Open
likithesh-ts opened this issue Apr 25, 2024 · 5 comments

Comments

@likithesh-ts
Copy link

likithesh-ts commented Apr 25, 2024

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:

Hypothesis-issue.mp4
@robertknight
Copy link
Member

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?

@likithesh-ts
Copy link
Author

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

@robertknight
Copy link
Member

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.

@likithesh-ts
Copy link
Author

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.

Hypothesis-issue-3.1.mp4

@acelaya
Copy link
Contributor

acelaya commented Apr 29, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants