Mlem icon indicating copy to clipboard operation
Mlem copied to clipboard

Handle links in app

Open tht7 opened this issue 1 year ago • 4 comments

Checklist

  • [x] I have described what this PR contains

Choose one of the following two options:

    • [ ] This PR does not introduce major changes
    • [x] This PR introduces major changes, and I have consulted the Mlem Development Matrix room (not really, I should really look into what this whole Matrix room is about 😅 )

Choose one of the following two options:

    • [x] This PR does not change the UI in any way
    • [ ] This PR adds new UI elements / changes the UI, and I have attached pictures or videos of the new / changed UI elements

Pull Request Information

About this Pull Request

The gist is that if you click a link in a post that looks like it's another Lemmy post/community/user we'll open that in app and not in Safari! but here're the more detailed change log since it was no easy task:

  • changed all the NavigationLinks to the new iOS 16 style "value" oriented
  • doing that allowed us to push/pop anything we want to the navigation stack
  • added new link handling, now if a link looks even remotely "sus" I will ask Lemmy's servers if they know it, if they do know it: We push the appropriate object to the navigation stack if they don't know about it and it's an HTTP link, kept the old behavior otherwise I let the system try to open it (which is way nicer than telling the user "it's not supported" especially for mailto: links XD

Screenshots and Videos

https://github.com/mormaer/Mlem/assets/6067331/38e5c89e-cbaa-4312-a866-3516f901a84f

(It's less helpful since you don't see where I'm tapping 😅 but I hope you understood from context that Im pressing on each individual representation of these links)

Additional Context

tht7 avatar Jun 23 '23 14:06 tht7

Nice!

I'll get a look at this but likely tomorrow at the earliest, if you're looking for the matrix chat here's a link which I think should work;

https://matrix.to/#/%23MlemApp%3Amatrix.org

Once there we should be to get you into the dev chat if you like 👍

mormaer avatar Jun 23 '23 21:06 mormaer

Ahaha I’m already there (General and recruitment) and just saw the invite to dev,, I’ll try to be just as active there as I am here

tht7 avatar Jun 23 '23 21:06 tht7

I

https://github.com/mormaer/Mlem/assets/6067331/26433888-1539-41ac-8a18-aa298edd49d9

'd say it's looking pretty good

tht7 avatar Jun 24 '23 11:06 tht7

I'd say I have to agree with your statement

Emiliaaah avatar Jun 24 '23 17:06 Emiliaaah