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

Support alternate link sources #1516

Merged
merged 4 commits into from
Sep 26, 2024

Conversation

micahmo
Copy link
Member

@micahmo micahmo commented Aug 7, 2024

This PR was inspired by the following post: https://lemmy.world/post/18198313

In that post a screenshot of the Tesseract front-end was shown, demonstrating how it provides links to "Alternate Sources" for a given article link. The sources that Tesseract provides are these:

Notes

  • The first three sources provide archives of the given link (often to bypass paywalls or to see an article after it's been taken down). The last one finds similar articles from other media outlets so that folks can compare the same story from different perspectives.
  • These are all auto-generated links. There are no API calls to any of these sites (e.g., to request an archive), so the user may navigate to one of these sites and find that there is no archive of the given page. We can't make any guarantees; we can just provide the link.
  • We can't make a determination about whether a given link is really a news article or just a link to a web page. As a result, these alternate links may not always be completely appropriate (but they shouldn't cause any harm).
  • Tesseract has a similar feature that provides links to alternate YouTube front-ends for YouTube videos, such as Piped and Invidious. It may even have other site-specific alternatives that I just didn't run across. I think these would all be cool to implement, but they can be done later on a site-by-site basis.
  • Although I had to significantly change how the link bottom sheet is being built (from a BottomSheetListPicker to a manually-constructed list of PickerItems) I did a back-and-forth comparison to ensure that the layout looks exactly the same as before.

I have decided to implement this feature with the following sources.

I excluded the following sources.

  • Ghost Archive, because we have two other well known archive sites. However, if users are strongly in favor of Ghost Archive, of course we can add it back.
  • 12ft.io, because it is known to not work as well these days and not be totally reliable

The good news is that new sources are super easy to add (one line of code) so we can be totally flexible there.

The alternate sources can be accessed from the following places.

  • Link long-press bottom sheet
  • Post page (old and new) overflow menu
  • In-app browser overflow menu

In all cases, the alternative links are displayed using the same bottom sheet widget, to reduce duplicate code

qemu-system-x86_64_DrxTLZXUQX.mp4

@micahmo
Copy link
Member Author

micahmo commented Aug 9, 2024

I pushed a small change which ensures that navigation to alternate sources once you're already in a webview occurs within that same webview instead of pushing a new one on top.

@realeatham
Copy link

This is cool

Copy link
Member

@hjiangsu hjiangsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for adding this feature 😄

@hjiangsu hjiangsu merged commit cc58c97 into thunder-app:develop Sep 26, 2024
1 check passed
@micahmo micahmo deleted the feature/alternative-sources branch September 26, 2024 17:23
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

Successfully merging this pull request may close these issues.

3 participants