-
Notifications
You must be signed in to change notification settings - Fork 340
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
Implement instance agnostic community linking #1156
Implement instance agnostic community linking #1156
Conversation
I'll test this out locally when I get the chance. Otherwise, looks good. |
Hm wait, before this is pulled there I realized there might be a slight issue with the implementation. While Lemmy UI uses the Since I'm not super familiar with how the standard is supposed to work, I think it's probably best to defer to the maintainers. |
After some thought, I have a proposal We can formally (and unilaterally) establish a "Lemmy Community Linking Standard (tm)" with the format What are people's thoughts |
Two thoughts:
Both are considered valid endpoints in kbin and there is no way to distinguish between the two. I think using the ! to distinguish community names is important, but its adoption outside of Lemmy is up to other devs. Full disclosure. I am not a real software dev, I just like this project. Defer to dessalines and nutomic. |
Sorry for ping, but thoughts on this most recent kind of implementation? |
@@ -700,7 +700,7 @@ export function setupTribute() { | |||
trigger: "!", | |||
selectTemplate: (item: any) => { | |||
const it: CommunityTribute = item.original; | |||
return `[${it.key}](${it.view.community.actor_id})`; | |||
return `${it.key}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a fan of this approach.
Instead, just have two links, the fedi one, and whatever you local instance is with the community.name.
IE something like [it.key](community.actor_id),[^local^](this_instance/c/community.name@community_instance.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My worry with having two links is that it doesn't make the linking experience transparent. In my opinion, the user shouldn't need to know about the nuances of instances and how they interact in order to consume content. They should just be able to click a link and get sent to the version of the post on their home instance, especially since that feature is already built-in. That is, they should be able to get a single link and when they click it, things should should "just work".
Also, having the separate "local" link breaks interoperability with other fediverse services. The motivation behind my approach is that when a user posts, they just put text in a particular format. When that post gets fetched by other services (like Kbin), the other service can (or not) handle the formatted text in whichever manner they like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They should just be able to click a link and get sent to the version of the post on their home instance,
Without the real community / actor links tho, there's a good chance that they won't even exist on your instance yet. We do this on all post and comment nodes, which have both their fedilink, and their local link.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, would it be a good idea to implement a companion solution to that issue then? That is, should we make it so that if you navigate to a post on a remote instance which hasn't been federated with your home instance yet, the home instance will automatically fetch the content from the remote instance instead of 404'ing? Or was there an explicit design choice to 404 instead of fetching?
This seems to be related to another common issue that people are having with interacting with remote instances, namely being able to discover communities on instances which their home instance hasn't encountered yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There aren't any 404s currently, because the post and comment nodes already exist on your own instance, or you wouldn't be seeing them (so neither link will 404).
But with searched content like this, the comment with text referencing a federated community or actor, might not exist everywhere.
the home instance will automatically fetch the content from the remote instance instead of 404'ing?
We don't currently do this, but this is the advantage of having a local link. We could do a resolveObject if it 404s, and cache it to our local instance. No guarantees still, since it could be blocked, but at least its possible.
We've chosen for resolve to only work on the search page currently, and by logged-in users only, but I'm open to a discussion for changing that. Def has pros and cons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another solution if we want to keep the explicit hyperlinks to different instances could be to implement a "You are leaving your home instance" screen before redirection. That way users are explicitly told that they are moving to a physically different website and they don't have to rely on vague UI clues to realize that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But with searched content like this, the comment with text referencing a federated community or actor, might not exist everywhere.
I think we might be misunderstanding each other. In my mind, I imagine that all we're doing on the frontend is a search and replace for text of a particular format to render a link.
The Tribute autocomplete is just a "nice-to-have", but is ultimately particular to Lemmy UI's implementation. If a local instance isn't federated with a particular remote, I think the user should still be able to manually put just [email protected]
in their comment. Text of that form would semantically mean that people should go to asklemmy on the lemmy.ml instance in whatever way their UI supports.
Particular UI implementations which support this format could render the text to be a link which refers to a location on their local instance which makes content from the appropriate remote community/instance pair viewable, but implementing this feature isn't required for other UI implementations.
What I thought the problem was was that the local instance might not have the community cached, and so navigating to that link might not work. But testing it out myself has made me realize that any local instance can navigate to any community on any remote instance as long as the user knows exactly what the remote community name is and the remote instance domain is. So really what I thought was an issue is a non-issue.
This is a fundamental change which will affect lots of users. It would be better to discuss this more in an issue or directly on Lemmy before implementing any specific change. |
sgtm, found an already existing issue (#1048) so I guess discussion should be redirected there |
This is superceded now by #1462 |
Replaces the hyperlink component of the markdown link of the Tribute template with an instance agnostic way of linking to different communities.
For example, instead of autofilling ![email protected] to https://beehaw.org/c/technology, we should autofill it to /c/[email protected]. That way, we redirect users to the version of the linked community on their home instance. This makes moving around lemmy less jarring. Currently when someone whose home instance isn't beehaw clicks that link, they'll be "logged out" (even though they aren't "logged out"; they've just moved to a different website). This should be implemented because of the fact that all lemmy instances have the same UI, making what should be a pretty painless traversal kind of confusing.
I'm not sure how to spin up a local lemmy instance for testing frontend changes, so if someone could tell me how to spin one up or test this real quick for me, that would be much appreciated.
Also I'm not really acquainted with what convention the maintainers prefer for using existing types, but this seemed like the most straight forward solution. It's kind of inefficient though, since we don't use the CommunityView returned by the network response.