damus-io / damus

iOS nostr client
GNU General Public License v3.0
1.95k stars 290 forks source link

Hide external link URLs #2187

Open dmnyc opened 3 weeks ago

dmnyc commented 3 weeks ago

When a note contains an external link such as an article or YouTube video, Damus should hide the URL and only display the link preview. This would produce a cleaner user view and save space on screen.

Caveat:

This has to be contextual as a link to the top level of a website should probably not be hidden.

Example when link should be hidden:

https://damus.io/nevent1qqsgv35vzvyl4eesqm8quk33jgxkddgvvnxntj3r75nk5jkwljgr4vgyx2pse

Example when link should not be hidden:

https://damus.io/nevent1qqs04gq030x3ew3mgdumy2j324lpww08enx6q06yldmqmv43vr05x9gpz3mhxue69uhhyetvv9ujumn0wd68ytnzvuq36amnwvaz7tmwdaehgu3dwp6kytnhv4kxcmmjv3jhytnwv46qzxrhwden5te0wfjkccte9ehx7um5wfshg6fwvdhk6qg4waehxw309ajkgetw9ehx7um5wghxcctwvsx36csg

alltheseas commented 3 weeks ago

it is not clear to me how / when would damus know when to hide a link

dmnyc commented 3 weeks ago

In my logic it would meet two conditions:

  1. There is something past the .tld/
  2. It's the last line of the note (only)

On Thu, Apr 25, 2024 at 9:38 AM alltheseas @.***> wrote:

it is not clear to me how / when would damus know when to hide a link

— Reply to this email directly, view it on GitHub https://github.com/damus-io/damus/issues/2187#issuecomment-2077215854, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA3YJQ3KREIWBGFLQDPK47DY7EBOTAVCNFSM6AAAAABGY2KAJWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZXGIYTKOBVGQ . You are receiving this because you authored the thread.Message ID: @.***>

alltheseas commented 3 weeks ago

I am not certain about this approach.

Maybe @robagreda or @ericholguin have thought about this.

dmnyc commented 3 weeks ago

The other idea is related to this issue: https://github.com/damus-io/damus/issues/1397

Create a link card in the note, which would allow the user to delete the URL and the link is still visible in the post.

jb55 commented 3 weeks ago

I think it's a good idea!

dmnyc commented 2 weeks ago

I don't know if this should be a separate issue but Damus also exposes @nevent tags, for example:

https://damus.io/nevent1qqsv9z59d39e47j86577sun65a5a7pqac0hmqjxfzzvh8mqzz0m7facpz3mhxue69uhhyetvv9ujuerpd46hxtnfduq3vamnwvaz7tmjv4kxz7fwdehhxarj9e3xzmnyqyvhwumn8ghj7mn0wd68ytnsd3jkycmgv95kutn0wfnszrthwden5te0dehhxtnvdakqra33mf

image

alltheseas commented 2 weeks ago

what do you expect to see in place of ATnevent @dmnyc ?

dmnyc commented 2 weeks ago

Nothing, I think it should be invisible the same way @note / nostr:note links are.

Message ID: <damus-io/damus/issues/2187/2087842427 @.***>

alltheseas commented 2 weeks ago

Nothing, I think it should be invisible the same way @note / nostr:note links are.

Message ID: <damus-io/damus/issues/2187/2087842427 @.***>

this is ATnote behavior: display as quote note image

jb55 commented 2 weeks ago

On Tue, Apr 30, 2024 at 05:10:53PM GMT, The: Daniel ⚡️ wrote:

I don't know if this should be a separate issue but Damus also exposes @nevent tags, for example:

yes this was a bug introduced during the nevent refactoring. still needs to be fixed

dmnyc commented 2 weeks ago

I like how Primal renders links, similar to Nostur but cleaner and with a larger image.

Primal image

Nostur image

Damus image