lindylearn / unclutter

A modern reader mode and article library for your browser.
https://unclutter.lindylearn.io
GNU Affero General Public License v3.0
1.25k stars 54 forks source link

Re-enable Hypothes.is annotations sync #509

Open th0rgall opened 1 year ago

th0rgall commented 1 year ago

Context

I'm trying sync my annotations from Unclutter to Hypothes.is. After reading the following line in the docs, I'm trying to find a settings page where I can fill in the API key.

https://github.com/lindylearn/unclutter/blob/061dda9e5be53188d0257c196892cf85ba6ce6b9/docs/annotations.md?plain=1#L19

Going to extension settings, I can't find it:

CleanShot 2022-11-19 at 13 56 13@2x

Neither when pressing TAB on an article, then going to the setting page there.

I did a quick search to see if I could find the reason.

Has this feature been disabled?

phgn0 commented 1 year ago

@th0rgall you're right, the Hypothesis sync is currently disabled.

All highlights need to be locally saved to make the highlight counts and full-text search work inside the library modal. And the previous implementation of the Hypothesis sync just naively sent & retrieved annotations from their API.

How would you want the sync to work? Should annotations you make using the official Hypothesis extension also turn up inside Unclutter? Should it be possible to import annotations?

Just uploading highlights based on changes in the local data store is relatively straightforward, we already do this to update the search index: https://github.com/lindylearn/unclutter/blob/f1384a15d51331a3be610c72d7bb9dfe382c44f0/common/library-components/src/common/search.ts#L302-L310

Thanks for creating the issue!

jesusgarza commented 1 year ago

I would be happy with just uploading my highlights and annotations to Hypothesis, so I can have them available everywhere.

th0rgall commented 1 year ago

@phgn0 to clarify, from the documentation/home page, I had expected this to happen:

So I guess I was expecting a full sync!

imaverage commented 1 year ago

current doc is outdated. https://github.com/lindylearn/unclutter/blob/main/docs/annotations.md#hypothesis-sync

imaverage commented 1 year ago

prior to my knowledge about hypothes.is integration in the first place, i used the following adapter to get the actual hypothes.is highlighter to work (in a limited fashion)[0] in the uncluttered mode. I like using the real highlighter since its the canonical tool for it, and use it outside of unclutter mode, and know that it works. it is also more stable than relying on the hypothes.is integration for many reasons, for which this issue can be a testament.

not to say this issue is not good; im just sharing my context which surely has its own downsides.

here's my adapter:

hypothesis-highlight {
    background-color: rgba(144, 238, 144, 0.4) !important;
    border-radius: 3px;
    padding: 0 1px 0 1px;
}

[0] selected items are able to be highlighted, but details are not visible upon clicking, nor are they deletable (with unclutter mode)

phgn0 commented 1 year ago

@th0rgall you're correct, viewing public annotations is separate from the currently-disabled Hypothes.is sync.

I'll take a look at this later this week. Having a working sync method will be very helpful for #680 and #679 too.

Unclutter actually started as an alternative to the official Hypothes.is extension, we should definitely re-enable this soon. All local highlights will be backfilled to your account at that point.

phgn0 commented 1 year ago

@th0rgall @krillin666 @jesusgarza @imaverage the Hypothes.is sync is finally working again inside Unclutter!

It's a bi-directional sync now, so all your annotations & edits turn up both inside Unclutter and via the official Hypothes.is interface. Once you re-activate the sync in the extension settings it uploads all highlights you made while this was inactive.

Screenshot 2022-12-08 at 1 14 01 PM

If you have a lot of annotations the full-text search index (for the search box on the library highlights page) might take a few minutes to update.

Please let me know if it works!

krillin666 commented 1 year ago

@th0rgall @krillin666 @jesusgarza @imaverage the Hypothes.is sync is finally working again inside Unclutter!

It's a bi-directional sync now, so all your annotations & edits turn up both inside Unclutter and via the official Hypothes.is interface. Once you re-activate the sync in the extension settings it uploads all highlights you made while this was inactive.

Screenshot 2022-12-08 at 1 14 01 PM

If you have a lot of annotations the full-text search index (for the search box on the library highlights page) might take a few minutes to update.

Please let me know if it works!

Thank you so much for this ! This was the only thing that kept me from using Unclutter, but if I knew that the highlights would after all, I could've kept using it :sweat_smile: This really enhances the internet experience !

pyxelr commented 1 year ago

@phgn0: Is it also possible to highlight the text within Unclutter by including tags that would sync with Hypothesis?

For now, it seems like this option is unsupported. I could also simply try to annotate text with the Hypothesis extension, but once activated, it is hidden underneath the Unclutter pane.

phgn0 commented 1 year ago

@pyxelr there definitely should be annotation tags, but I wasn't sure how to do the UI for it yet. Let's discuss this in https://github.com/lindylearn/unclutter/issues/810.

Is the hypothes.is sync in Unclutter otherwise working as expected?

pyxelr commented 1 year ago

@phgn0: Thanks, this is great to hear!

Yes, the hypothes.is sync feature is working as expected, although, I've tested it only for an hour so far.

krillin666 commented 1 year ago

The annotations sync stopped working for me ! I've tried to go back to version 1.6.5 but the problem still persists. Basically, the sync stays like this forever:

image

Is there any way I can debug this to give you more info ?

phgn0 commented 1 year ago

@krillin666 you're right, I see the issue too now. Seems like the bug was caused by 1de57632c51dab722783361afc1a38b15b7af886.

I'll let you know once the fix is released later this week!

phgn0 commented 1 year ago

@krillin666 the hypothesis sync should be fixed now finally with version 1.7.4 of Unclutter!

I moved the sync setup to the companion website at my.unclutter.it to have it in the same place as the new Pocket sync. But if you entered your hypothesis token in the past it still works.

Do you see your highlights turning up in your hypothesis account now?

Otherwise, do you see any errors in the extension log? (click "Developer mode" in the top right of the manage extension page, then "service worker" under "Inspect views")

krillin666 commented 1 year ago

@krillin666 the hypothesis sync should be fixed now finally with version 1.7.4 of Unclutter!

I moved the sync setup to the companion website at my.unclutter.it to have it in the same place as the new Pocket sync. But if you entered your hypothesis token in the past it still works.

Do you see your highlights turning up in your hypothesis account now?

Otherwise, do you see any errors in the extension log? (click "Developer mode" in the top right of the manage extension page, then "service worker" under "Inspect views")

Hey, so I've updated the extension and no longer there's an option to activate sync (or insert the token).

Then, as advised, I created an account on my.unclutter.it. To my dismay, I found that the all feature are greyed out and behind a paywall now ! Well, this is rather unexpected to put the most essential feature (sync) behind a paywall without any warning at all :/

So no, I haven't tried the sync because it's behind a paywall.

Thank you for working on it, though. I hope the project grows.

krillin666 commented 1 year ago

Plus, the social comments are gone :disappointed:

krillin666 commented 1 year ago

And now I can no longer access my saved and read articles from the extension (the option does not appear !). The only way to access them now is at the my.unclutter.it, and I can't see any of them because it's behind a paywall.

phgn0 commented 1 year ago

@krillin666 Yes, for new users the sync feature now requires financial support to Unclutter. But the hypothesis sync should still work for you (even without accessing the "sync" tab) if you configured it in the past -- does it?

You can also export the saved articles from your Unclutter Library in the settings. The idea behind the paywall for the library features (with a free trial) is so that I can spend more time on making them better :)

Thanks for the feedback!

krillin666 commented 1 year ago

No, syncing is not working nor is there any way to check the configurations for this