weichenw / obsidian-hypothesis-plugin

An Obsidian.md plugin that syncs highlights from Hypothesis.
MIT License
235 stars 20 forks source link

Highlights don't respect the original text's order of appearance (like on Hypothesis' side pane) #30

Closed icytree closed 2 years ago

icytree commented 2 years ago

See screenshots : image image

What I am referring is the same thing as the "sort top-level annotations by" setting in this prototype built by a member of the Hypothesis team when set to "document location".

Notes:

weichenw commented 2 years ago

See screenshots : image image

What I am referring is the same thing as the "sort top-level annotations by" setting in this prototype built by a member of the Hypothesis team when set to "document location".

Notes:

  • The same happens to all my notes.
  • I tried deleting all notes and resync them but the result is the same.

I have fixed it in 0.1.15 Before: image

After: image

Give it a try and see if it works on your end..

icytree commented 2 years ago

Thank you for your time, I tested the update but sadly it's not exactly what I was talking about. I saw you modified it to sort highlights by dates but what I meant was to be able to have them sorted by their location in the web page they are from. That way no matter when you highlight new elements in the page, when you do a first sync (or delete and re sync), it will respect the location of each highlight in the web page thus giving better contextual meaning in my opinion.

weichenw commented 2 years ago

Thank you for your time, I tested the update but sadly it's not exactly what I was talking about. I saw you modified it to sort highlights by dates but what I meant was to be able to have them sorted by their location in the web page they are from. That way no matter when you highlight new elements in the page, when you do a first sync (or delete and re sync), it will respect the location of each highlight in the web page thus giving better contextual meaning in my opinion.

Unfortunately, I am not bringing in the positions at this point. I get what you mean, but unfortunately, it is too much work to update the existing document as the sequence of highlights in a document can happen in any position and any given day. The highlight positions need to be stored in the document itself to make it work.

temberature commented 2 years ago

I think maybe changing some logic can handle this with small effort, detail as follow: perhaps the code can rewrite the whole file (one page file) associating with the updated page from last sync time.

temberature commented 2 years ago

after I read Api docs, I find it a little more complicated, there isn't page retrieving, it only can be implemented by processing annotation information. https://h.readthedocs.io/en/latest/api-reference/v1/#tag/annotations/paths/~1search/get

nhan000 commented 1 year ago

I so want this to be implemented :(