voyager icon indicating copy to clipboard operation
voyager copied to clipboard

Link/share URL should be on instance thread is hosted on

Open slrgt opened this issue 2 years ago • 9 comments

Is your feature request related to a problem? Please describe. When clicking the Link icon on a thread it opens the thread based on the user's instance that submitted the thread and not the instance the thread is hosted on.

Describe the solution you'd like The Open Link button and sharing link buttons should instead use the instance that the thread is hosted on similar to this button on the lemmy web ui librewolf_dqHnNw58WD

slrgt avatar Dec 11 '23 01:12 slrgt

Hi @slrgt. I just checked and it should be functioning similar to what you describe. Voyager is just linking to the post ap_id. If there is a specific post URL you're having trouble with, please link it so I can try to reproduce.

aeharding avatar Dec 12 '23 23:12 aeharding

Here's an example: https://lemmings.world/post/3702826

The community is on lemmy.ml but the user is on lemmings.world so when i click the link button it opens on lemmings.world instead of lemmy.ml which would be much more convenient

slrgt avatar Dec 12 '23 23:12 slrgt

I see. So there could be a lot of things linked to:

  1. Instance where my account is on
  2. Instance where OP account is on (current behavior)
  3. Instance where community is on

Right now, we do the second. This is considered the ap_id from Lemmy, or where the content originated from.

I could see a use case for the first one, so you could interact from your own instance, but what is the use-case for the third option>

aeharding avatar Dec 12 '23 23:12 aeharding

I think the third option is the most user friendly for sharing links. When i send someone a link to lemmy they most likely dont use lemmy and its much easier for new people to onboard lemmy if they arrive on an instance that is a bit more used and especially if the link i send them is something theyre interested in.

its convenient if they're arriving to lemmy on the instance the community is already in so they can just sign up and follow the community locally instead of learning about federation and how there might be a community with the same name on the instance i sent them instead of the instance the post was on.

Also its kinda weird to share a link with someone to a post about technology and the link is the users instance which might be a shady instance or an instance filled with nsfw furry art 😅

I could see the use case where the Link🔗 button opens in my instance (1.) and the Share ↗️ button uses the instance of the community (3.) but i can't ever see a good use case for opening in the OPs instance since that can be a single user instance, a nsfw instance, or any number of things I dont want to open or share

slrgt avatar Dec 12 '23 23:12 slrgt

@slrgt Thanks for the explanation, that helps a lot!

aeharding avatar Dec 13 '23 00:12 aeharding

Just wanted to add a plus one for option 1 for all of the reasons that slrgt mentioned. I would much rather have the choice of instance that I’m sharing since it can be rather inconvenient to find a specific post using the OP’s home instance back on my instance.

My friends are also not Lemmy users and I love to share with them, but it’s rather clunky for me since I have to recreate option 1 manually by going to my browser to find the appropriate link.

The functionality described in option 1 currently corresponds to the functionality in the stock Lemmy web experience when pressing icon with the three dots connected by a line (just to the right of the comment count and to the left of the rainbow icon shown in slrgt‘s original issue text), so I know it must be possible.

trjohnson19 avatar Dec 16 '23 05:12 trjohnson19

Was able to get around to poking into the API response to see if I could figure out how we could return the specified link for option 1. The URL would be built by combining

  • https://<base-url-for-user>/
  • post or comment (or other potential path? Not sure what other path options there are)
  • id from the appropriate id field
Full example for a post (https://lemmy.world/post/9195682) (using the `post_view`:`post`:`id` field)
  "post_view": {
    "post": {
      "id": 9195682,
      "name": "2:1 White/Whole Wheat with DIY steam oven.",
      "url": "https://lemmy.ca/pictrs/image/6d4dbfae-2ae7-4bc5-9fba-0c7145a501a3.jpeg",
      "body": "- 1/3 Whole wheat flour\n- 2/3 White bread flour (all purpose works as well)\n- 70% Mill Street Organic Lager (any light lager works)\n- 2% Salt\n- 1.5% Yeast\n\nBulk ferment for 2 hrs with one or two folds at 20min and 40min. Proof for 2 hrs then bake in an oven that was preheated with a cookie sheet full of water (careful of the scalding steam when you open the door). As soon as the bread is in the oven spray it down with way too much water (careful of your oven window) then close the door to trap all the steam. You should get some good spring and that nice crunchy/speckled crust.\n\nProtip: 500g of flour is the perfect amount for a 355ml can of beer.",
      "creator_id": 2158970,
      "community_id": 2302,
      "removed": false,
      "locked": false,
      "published": "2023-12-05T22:32:57.364142",
      "deleted": false,
      "nsfw": false,
      "thumbnail_url": "https://lemmy.ca/pictrs/image/90839e73-feef-48fd-9744-db5fe468e61b.jpeg",
      "ap_id": "https://lemmy.ca/post/10725015",
      "local": false,
      "language_id": 37,
      "featured_community": false,
      "featured_local": false
    },
    "creator": {
      "id": 2158970,
      "name": "nik282000",
      "avatar": "https://lemmy.ca/pictrs/image/daa40847-3d53-4a96-9f97-179bc221995f.png",
      "banned": false,
      "published": "2023-08-22T15:35:12.219537",
      "actor_id": "https://lemmy.ca/u/nik282000",
      "bio": " http://nik282000.com/",
      "local": false,
      "banner": "https://lemmy.ca/pictrs/image/633a0de3-6a3f-4e5b-ae28-618e8a9eaaa3.jpeg",
      "deleted": false,
      "admin": false,
      "bot_account": false,
      "instance_id": 251
    },
    "community": {
      "id": 2302,
      "name": "bread",
      "title": "Bread",
      "description": "A day without bread is like a day without sun.\n\nPost your success, post your failures, ask questions, and share your favorite recipes!",
      "removed": false,
      "published": "2023-06-09T18:38:10.819315",
      "updated": "2023-06-22T01:23:10.655160",
      "deleted": false,
      "nsfw": false,
      "actor_id": "https://lemmy.ca/c/bread",
      "local": false,
      "icon": "https://lemmy.ca/pictrs/image/6bd30836-bf1f-40b1-aa89-530f181a21e1.jpeg",
      "banner": "https://lemmy.ca/pictrs/image/26f64434-5a3d-48e7-bb58-2fa7863bffaf.webp",
      "hidden": false,
      "posting_restricted_to_mods": false,
      "instance_id": 251
    },
    "creator_banned_from_community": false,
    "counts": {
      "id": 919147,
      "post_id": 9195682,
      "comments": 2,
      "score": 24,
      "upvotes": 25,
      "downvotes": 1,
      "published": "2023-12-05T22:32:57.364142",
      "newest_comment_time_necro": "2023-12-06T00:04:00.069758",
      "newest_comment_time": "2023-12-06T00:04:00.069758",
      "featured_community": false,
      "featured_local": false,
      "hot_rank": 0,
      "hot_rank_active": 0,
      "community_id": 2302,
      "creator_id": 2158970
    },
    "subscribed": "Subscribed",
    "saved": false,
    "read": false,
    "creator_blocked": false,
    "my_vote": 0,
    "unread_comments": 2
  },
  "community_view": {
    "community": {
      "id": 2302,
      "name": "bread",
      "title": "Bread",
      "description": "A day without bread is like a day without sun.\n\nPost your success, post your failures, ask questions, and share your favorite recipes!",
      "removed": false,
      "published": "2023-06-09T18:38:10.819315",
      "updated": "2023-06-22T01:23:10.655160",
      "deleted": false,
      "nsfw": false,
      "actor_id": "https://lemmy.ca/c/bread",
      "local": false,
      "icon": "https://lemmy.ca/pictrs/image/6bd30836-bf1f-40b1-aa89-530f181a21e1.jpeg",
      "banner": "https://lemmy.ca/pictrs/image/26f64434-5a3d-48e7-bb58-2fa7863bffaf.webp",
      "hidden": false,
      "posting_restricted_to_mods": false,
      "instance_id": 251
    },
    "subscribed": "Subscribed",
    "blocked": false,
    "counts": {
      "id": 1252,
      "community_id": 2302,
      "subscribers": 149,
      "posts": 34,
      "comments": 122,
      "published": "2023-06-09T18:38:10.819315",
      "users_active_day": 1,
      "users_active_week": 1,
      "users_active_month": 10,
      "users_active_half_year": 63,
      "hot_rank": 0
    }
  },
  "moderators": [
    {
      "community": {
        "id": 2302,
        "name": "bread",
        "title": "Bread",
        "description": "A day without bread is like a day without sun.\n\nPost your success, post your failures, ask questions, and share your favorite recipes!",
        "removed": false,
        "published": "2023-06-09T18:38:10.819315",
        "updated": "2023-06-22T01:23:10.655160",
        "deleted": false,
        "nsfw": false,
        "actor_id": "https://lemmy.ca/c/bread",
        "local": false,
        "icon": "https://lemmy.ca/pictrs/image/6bd30836-bf1f-40b1-aa89-530f181a21e1.jpeg",
        "banner": "https://lemmy.ca/pictrs/image/26f64434-5a3d-48e7-bb58-2fa7863bffaf.webp",
        "hidden": false,
        "posting_restricted_to_mods": false,
        "instance_id": 251
      },
      "moderator": {
        "id": 27165,
        "name": "Noved",
        "avatar": "https://lemmy.ca/pictrs/image/23caef2c-179b-4ec4-9e0e-522735250b42.jpeg",
        "banned": false,
        "published": "2023-06-09T03:09:11.978889",
        "actor_id": "https://lemmy.ca/u/Noved",
        "local": false,
        "banner": "https://lemmy.ca/pictrs/image/0102be1f-218b-479f-923b-74a6750a0b70.jpeg",
        "deleted": false,
        "admin": false,
        "bot_account": false,
        "instance_id": 251
      }
    }
  ],
  "cross_posts": []
}
Full example for a comment (https://lemmy.world/comment/5832081) (using the `comments`:[`comment`:`id`...] field)
  "comments": [
    {
      "comment": {
        "id": 5832081,
        "creator_id": 55749,
        "post_id": 9195682,
        "content": "Looks so good! I have no idea on baking but starting to get into it. What difference does the steam do? What would happen if you didn’t have the water pan and didn’t spray the bread before closing the door?",
        "removed": false,
        "published": "2023-12-05T23:47:43.969403",
        "deleted": false,
        "ap_id": "https://lemmy.world/comment/5832081",
        "local": true,
        "path": "0.5832081",
        "distinguished": false,
        "language_id": 37
      },
      "creator": {
        "id": 55749,
        "name": "tarmac",
        "banned": false,
        "published": "2023-06-11T21:34:16.770616",
        "actor_id": "https://lemmy.world/u/tarmac",
        "local": true,
        "deleted": false,
        "admin": false,
        "bot_account": false,
        "instance_id": 1
      },
      "post": {
        "id": 9195682,
        "name": "2:1 White/Whole Wheat with DIY steam oven.",
        "url": "https://lemmy.ca/pictrs/image/6d4dbfae-2ae7-4bc5-9fba-0c7145a501a3.jpeg",
        "body": "- 1/3 Whole wheat flour\n- 2/3 White bread flour (all purpose works as well)\n- 70% Mill Street Organic Lager (any light lager works)\n- 2% Salt\n- 1.5% Yeast\n\nBulk ferment for 2 hrs with one or two folds at 20min and 40min. Proof for 2 hrs then bake in an oven that was preheated with a cookie sheet full of water (careful of the scalding steam when you open the door). As soon as the bread is in the oven spray it down with way too much water (careful of your oven window) then close the door to trap all the steam. You should get some good spring and that nice crunchy/speckled crust.\n\nProtip: 500g of flour is the perfect amount for a 355ml can of beer.",
        "creator_id": 2158970,
        "community_id": 2302,
        "removed": false,
        "locked": false,
        "published": "2023-12-05T22:32:57.364142",
        "deleted": false,
        "nsfw": false,
        "thumbnail_url": "https://lemmy.ca/pictrs/image/90839e73-feef-48fd-9744-db5fe468e61b.jpeg",
        "ap_id": "https://lemmy.ca/post/10725015",
        "local": false,
        "language_id": 37,
        "featured_community": false,
        "featured_local": false
      },
      "community": {
        "id": 2302,
        "name": "bread",
        "title": "Bread",
        "description": "A day without bread is like a day without sun.\n\nPost your success, post your failures, ask questions, and share your favorite recipes!",
        "removed": false,
        "published": "2023-06-09T18:38:10.819315",
        "updated": "2023-06-22T01:23:10.655160",
        "deleted": false,
        "nsfw": false,
        "actor_id": "https://lemmy.ca/c/bread",
        "local": false,
        "icon": "https://lemmy.ca/pictrs/image/6bd30836-bf1f-40b1-aa89-530f181a21e1.jpeg",
        "banner": "https://lemmy.ca/pictrs/image/26f64434-5a3d-48e7-bb58-2fa7863bffaf.webp",
        "hidden": false,
        "posting_restricted_to_mods": false,
        "instance_id": 251
      },
      "counts": {
        "id": 5006901,
        "comment_id": 5832081,
        "score": 2,
        "upvotes": 2,
        "downvotes": 0,
        "published": "2023-12-05T23:47:43.969403",
        "child_count": 1,
        "hot_rank": 0
      },
      "creator_banned_from_community": false,
      "subscribed": "Subscribed",
      "saved": false,
      "creator_blocked": false
    },
    {
      "comment": {
        "id": 5832461,
        "creator_id": 163777,
        "post_id": 9195682,
        "content": "From my inexperience, steam allows for the expansion of the bread by not setting or hardening the outside. The waters and spray serve the same purpose.",
        "removed": false,
        "published": "2023-12-06T00:04:00.069758",
        "deleted": false,
        "ap_id": "https://lemmy.world/comment/5832461",
        "local": true,
        "path": "0.5832081.5832461",
        "distinguished": false,
        "language_id": 37
      },
      "creator": {
        "id": 163777,
        "name": "Squizzy",
        "banned": false,
        "published": "2023-06-16T06:43:11.058553",
        "actor_id": "https://lemmy.world/u/Squizzy",
        "local": true,
        "deleted": false,
        "admin": false,
        "bot_account": false,
        "instance_id": 1
      },
      "post": {
        "id": 9195682,
        "name": "2:1 White/Whole Wheat with DIY steam oven.",
        "url": "https://lemmy.ca/pictrs/image/6d4dbfae-2ae7-4bc5-9fba-0c7145a501a3.jpeg",
        "body": "- 1/3 Whole wheat flour\n- 2/3 White bread flour (all purpose works as well)\n- 70% Mill Street Organic Lager (any light lager works)\n- 2% Salt\n- 1.5% Yeast\n\nBulk ferment for 2 hrs with one or two folds at 20min and 40min. Proof for 2 hrs then bake in an oven that was preheated with a cookie sheet full of water (careful of the scalding steam when you open the door). As soon as the bread is in the oven spray it down with way too much water (careful of your oven window) then close the door to trap all the steam. You should get some good spring and that nice crunchy/speckled crust.\n\nProtip: 500g of flour is the perfect amount for a 355ml can of beer.",
        "creator_id": 2158970,
        "community_id": 2302,
        "removed": false,
        "locked": false,
        "published": "2023-12-05T22:32:57.364142",
        "deleted": false,
        "nsfw": false,
        "thumbnail_url": "https://lemmy.ca/pictrs/image/90839e73-feef-48fd-9744-db5fe468e61b.jpeg",
        "ap_id": "https://lemmy.ca/post/10725015",
        "local": false,
        "language_id": 37,
        "featured_community": false,
        "featured_local": false
      },
      "community": {
        "id": 2302,
        "name": "bread",
        "title": "Bread",
        "description": "A day without bread is like a day without sun.\n\nPost your success, post your failures, ask questions, and share your favorite recipes!",
        "removed": false,
        "published": "2023-06-09T18:38:10.819315",
        "updated": "2023-06-22T01:23:10.655160",
        "deleted": false,
        "nsfw": false,
        "actor_id": "https://lemmy.ca/c/bread",
        "local": false,
        "icon": "https://lemmy.ca/pictrs/image/6bd30836-bf1f-40b1-aa89-530f181a21e1.jpeg",
        "banner": "https://lemmy.ca/pictrs/image/26f64434-5a3d-48e7-bb58-2fa7863bffaf.webp",
        "hidden": false,
        "posting_restricted_to_mods": false,
        "instance_id": 251
      },
      "counts": {
        "id": 5007140,
        "comment_id": 5832461,
        "score": 3,
        "upvotes": 3,
        "downvotes": 0,
        "published": "2023-12-06T00:04:00.069758",
        "child_count": 0,
        "hot_rank": 0
      },
      "creator_banned_from_community": false,
      "subscribed": "Subscribed",
      "saved": false,
      "creator_blocked": false
    }
  ]
}

trjohnson19 avatar Dec 17 '23 00:12 trjohnson19

thanks @trjohnson19 !

slrgt avatar Jan 23 '24 03:01 slrgt

Had an issue today trying to share something where the instance where the OP was from (lemmy.today) error'd out, but lemmy.world (where the community was) and my home instance worked fine. Be great if this was at least a setting you could switch.

wleona3 avatar Mar 11 '24 20:03 wleona3