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

Allow to relatively link to individual posts #1229

Open
db0 opened this issue Jun 13, 2023 · 11 comments
Open

Allow to relatively link to individual posts #1229

db0 opened this issue Jun 13, 2023 · 11 comments
Labels
area: discovery enhancement New feature or request

Comments

@db0
Copy link

db0 commented Jun 13, 2023

Is your proposal related to a problem?

Currently when I want to link to a specific post, I have to always make an absolute link like https://lemmy.dbzer0.com/post/2212

However anyone following this link from a different instance will be prevented from subscribing or commenting.

If I link to it relatively like so /post/2212 it doesn't work, because each instance attaches its own ID to every post.

Adding the domain to the end like so /post/[email protected] also doesn't seem to work

Describe the solution you'd like.

I want a method to allow to link to posts in other instances relatively, to allow discussions to flow natively across the fediverse.

I am thinking of a special format, perhaps like [email protected] which the UI would translate to a hyperlink for the current instance if it's federated and exists, or expand to the normal absolute link https://lemmy.dbzer0.com/post/2212 if it's unknown.

The same functionality should also be possible in the URL links of new posts.

Describe alternatives you've considered.

None that I could think of

Additional context

Cousin of #1227

I am also not sure if this belongs to UI or to lemmy main repo.

@db0 db0 added the enhancement New feature or request label Jun 13, 2023
@Catsrules
Copy link

There is a good discussion about this issue here

#1048

@db0
Copy link
Author

db0 commented Jun 16, 2023

Just noticed that lemmy is perfectly capable of finding the local instances version of a comment when the full URL is posted in the search.

As such, I should be fairly easy for a link to a comment on the fediverse be automatically translated to to the local instance by the UI, if it's cached

@jacklynnepenick
Copy link

We could just have it so that if a URL to a post is posted in the comments, your local instance automatically notices it and interprets it as a link to that post on your own lemmy instance. We'd obviously need to make it so that there's some escaping mechanism, but linking to a post within your own instance seems to be the reasonable default behavior

@Falmarri
Copy link

There is a good discussion about this issue here

#1048

I think that's not the same issue. This is about comments. Which, if they don't even share the same ID could be problematic

@Catsrules
Copy link

Catsrules commented Jun 21, 2023

I think that's not the same issue. This is about comments. Which, if they don't even share the same ID could be problematic

That was referencing both posts and communities. Although the most recent discussion seems to just focus on communities. So your right it is probably a good idea to seperate the two.

I do think post and comments will be a similar solution as both have unique IDs per instance. Communities should be easier as they are ultimately linking back to a single instance it is just a matter of converting the URL to your instance.

@Zetaphor
Copy link
Contributor

I'm interested in working on this, but we're going to need to hash out syntax. #1462 codeifies the following formats for communities:

Ideally we'd be able to use a similar syntax, but this gets more complicated because of federated content having a local ID, and there being possible ID collisions between a post and comment. For example there could be post #1 with comments #1-3 and then post #2 with comments #4-6.

Unfortunately the /c/ nomenclature is already being used by communities as that would have been useful for comments.

I'm trying to think of what a useful but recognizable shorthand syntax could be for invoking a remote post versus a remote comment

@WayneSheppard
Copy link

Every post/comment needs their own UUID in the URL. When a server displays a link, it checks to see if the UUID exists locally (federated). If so, rewrite the display URL to point to the local federated copy. Otherwise display the original link. Or the local server could do the same rewrite on incoming Federation objects before storing in the DB.

@marbovo
Copy link

marbovo commented Jul 6, 2023

Is there any news on this topic?

@db0
Copy link
Author

db0 commented Jul 6, 2023

The best option currently is this violentmonkey script

@Zetaphor
Copy link
Contributor

Zetaphor commented Jul 6, 2023

The best option currently is this violentmonkey script

For now this will likely remain the best approach as there's no clean and simple way to handle this in without introducing new convoluted syntax that people would have to choose to use for it to be at all effective

@henrikx
Copy link

henrikx commented Dec 20, 2023

Considering the ViolentMonkey script is just javascript being injected, couldn't it be implemented into the frontend by default?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: discovery enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

9 participants