voyager icon indicating copy to clipboard operation
voyager copied to clipboard

Open lemmy links in the app itself instead of the browser

Open Abogical opened this issue 2 years ago • 2 comments

Links in post comments to Lemmy communities, posts or comments currently open in an internal browser. It would be more intuitive to open it inside the app.

  • A post link ( e.g. https://lemmy.one/post/691409 ) should open a Lemmy post inside the native app.
  • A comment link ( e.g. https://lemmy.one/comment/682672 ) should open a Lemmy comment inside the native app.
  • A community link ( e.g. https://lemmy.one/c/[email protected] or https://lemmy.ml/c/memes or [email protected]) should open a lemmy community inside the native app.

Just a suggestion, this app is amazing nonetheless. Thank you for making it!

Abogical avatar Jul 04 '23 05:07 Abogical

I'll take a look at this ticket

xpertbot avatar Jul 04 '23 06:07 xpertbot

Community links should already intercept. We just need comment and post links too, as well.

Where this is complicated is that post and comment IDs are different depending on the instance.

We can then call resolveObject(), but this is async and so we'd need loading UI. And if it fails and we need to open the browser, we are required to do that with user interaction in webapps, so we'd need a popup to ask user to tap to open in browser.

aeharding avatar Jul 04 '23 18:07 aeharding

If we’re considering all cases, there are also link posts (not a text post with a link in the description). In [email protected] a link post is usually a link to a community.

  • Example: https://lemmy.world/post/2195303
  • That post is a link post to https://lemm.ee/c/sousvide
  • To open the link in-app for someone at infosec.pub, the link should be https://infosec.pub/c/[email protected]

I can confirm though that if the post is a text post with links to the community, both the !community@instance and https://instance/c/community formats open the community in the app as hoped.

natflow avatar Jul 27 '23 15:07 natflow