hypothesis / hypothesis/client
Sidebar displays annotation in original (not current) page order
- Dominant language
- Mustache
- Stars
- 730
- Forks
- 224
- PR merge metrics
- No merged PRs in 30d
Description
_Originally reported as https://github.com/hypothesis/h/issues/2868 by @judell._
Here's a [handy test page] which can be used to repro this issue.
### Steps to reproduce
1. Annotate unique strings in each paragraph.
2. Reorder the paragraphs in the source.
3. Reload Hypothesis.
### Expected behaviour
Annotations reanchor, and are displayed in the sidebar in the order they are *now* found in the page.
### Actual behaviour
Annotations do successfully reanchor (assuming you selected an identifiable part of the text), but are displayed in the sidebar in the order they were in when the page was first annotated.
### Additional details
Note that this doesn't just affect the situation when page content is explicitly reordered. It also applies when changes occur around the annotated content and annotations are made before and after these changes, i.e.
1. Content is annotated.
2. Big chunk of ad copy or whatever is inserted before annotated content.
3. Content is annotated again.
The annotations created in step 3 will have substantially larger offsets in the `TextPositionSelector`, and so will likely all be displayed after the annotations created in step 1, regardless of their actual positions in the annotated content.
---
@judell provides some real-world examples:
> At: http://www.nytimes.com/2015/10/24/opinion/the-patent-troll-smokescreen.html?_r=0
>
>The following appear 1, 2 in the doc, 2, 1 in the sidebar.
>
> https://hyp.is/AVI3AAy28sFu_DXLVbLQ/www.nytimes.com/2015/10/24/opinion/the-patent-troll-smokescreen.html
>
> https://hyp.is/AVIthELH8sFu_DXLVZl7/www.nytimes.com/2015/10/24/opinion/the-patent-troll-smokescreen.htmlhttp://www.nytimes.com/2015/10/24/opinion/the-patent-troll-smokescreen.html?_r=0
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.