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

AP => Bluesky: add link to original post if truncated #986

Closed
snarfed opened this issue May 2, 2024 · 28 comments
Closed

AP => Bluesky: add link to original post if truncated #986

snarfed opened this issue May 2, 2024 · 28 comments
Labels

Comments

@snarfed
Copy link
Owner

snarfed commented May 2, 2024

Related to #976

@snarfed
Copy link
Owner Author

snarfed commented May 5, 2024

More ideas in #1002! (Merged in here.)

@snarfed snarfed changed the title ATProto: add link to original post if truncated AP => Bluesky: add link to original post if truncated May 6, 2024
@Fauli1221
Copy link

Would that also apply to media Bluesky doesn't support like Videos and Audio?

@snarfed
Copy link
Owner Author

snarfed commented May 14, 2024

Maybe!

snarfed added a commit to snarfed/granary that referenced this issue May 14, 2024
@snarfed
Copy link
Owner Author

snarfed commented May 14, 2024

Done! Example: https://indieweb.social/@snarfed/112441080098401081 => https://bsky.app/profile/snarfed.indieweb.social.ap.brid.gy/post/3kshvvi466tb2 . Presentation could be better, ideally we'd include an image if available, but it's a start.

image

@snarfed snarfed closed this as completed May 14, 2024
@mackuba
Copy link

mackuba commented May 29, 2024

Hmm, suggestion: maybe do "(…)" instead of just "…" at the end? It's not immediately clear that the post was truncated and is not just a normal post that just happens to end the sentence with an ellipsis…

Current:

Screen Shot 2024-05-29 at 22 57 53

Proposed:

Screen Shot 2024-05-29 at 22 59 54

@snarfed
Copy link
Owner Author

snarfed commented May 29, 2024

Good point! Reopening.

@snarfed snarfed reopened this May 29, 2024
@mackuba
Copy link

mackuba commented May 29, 2024

Btw, I'm adding a way to load the full contents from the Mastodon API and paste it inline to Skythread now 🙂

Screen Shot 2024-05-30 at 00 28 04 Screen Shot 2024-05-30 at 00 30 20

@snarfed
Copy link
Owner Author

snarfed commented May 29, 2024

Oh, awesome! Or you could fetch it via AP. You'd need to sign those fetches and serve a minimal AP actor with the public key; not sure if that's net more or less work than registering Mastodon OAuth clients dynamically per instance.

@snarfed
Copy link
Owner Author

snarfed commented May 29, 2024

That gives me another idea: I should store the full text in a custom field in the Bluesky record!

@mackuba
Copy link

mackuba commented May 29, 2024

That gives me another idea: I should store the full text in a custom field in the Bluesky record!

Omg yes!!

@mackuba
Copy link

mackuba commented May 29, 2024

Oh, awesome! Or you could fetch it via AP. You'd need to sign those fetches and serve a minimal AP actor with the public key; not sure if that's net more or less work than registering Mastodon OAuth clients dynamically per instance.

I haven't worked with the "low-level" AP API at all yet, just with the Mastodon REST one… and it's just one simple fetch here: mackuba/skythread@540a8b2#diff-1989dcd9cd0d832606735cbad270705ed51ae39d039b915672d37c9828e2da25R388 (it won't work for non-Mastodon instances, but I guess that won't be needed if you add that field :)

@snarfed
Copy link
Owner Author

snarfed commented May 29, 2024

Oh right, I forgot that big chunks of the Mastodon API are open, no auth needed. sgtm!

@jonpincus
Copy link

(it won't work for non-Mastodon instances, but I guess that won't be needed if you add that field :)

A lot of non-Mastodon instances support the API so that apps work so you might be okay

@AtiusAmy
Copy link

I feel like this would be a good solution to content warning as well just have the CW and then load full post maybe

@snarfed
Copy link
Owner Author

snarfed commented May 30, 2024

I feel like this would be a good solution to content warning as well just have the CW and then load full post maybe

The catch is that we have no control over client UIs, whether official ones like https://bsky.app/ and the mobile apps or any others. We can't add a "load full post" button or link.

@qazmlp
Copy link

qazmlp commented May 31, 2024

I think it would still be useful to have the full CN text1 and hidden text/attachments as custom fields on the bridged posts, both distinct from the mechanism for text that was just truncated to avoid mixups. That would allow third party apps to implement this flow without hitting the origin instance (i.e. better for privacy) or worrying about whether it supports the Mastodon API or if there's an implementation difference on the AP level.

Footnotes

  1. or a fragment indicating which part of the text is the CN, as that way you don't have to worry as much about whether UIs validate it matches presentation on Bsky, in case other PDSs use your lexicon to spoof something there.

@snarfed
Copy link
Owner Author

snarfed commented Jun 5, 2024

Anyone know the etiquette for choosing field names for custom fields in app.bsky.* lexicons that you don't own? I'm not sure what to name these fields. eg fullText, bridgyFedFullText, fediverseFullText, bridgyFedFediverseFullText, ...?

@snarfed
Copy link
Owner Author

snarfed commented Jun 5, 2024

Next step for changing the ellipsis string is to parameterize brevity.shorten to take a new ellipsis='...' kwarg: https://github.com/snarfed/brevity/blob/bb3cb14d2225c5401b010648e3e0e1158d82ba4c/brevity.py#L242-L245

@qazmlp
Copy link

qazmlp commented Jun 5, 2024

Anyone know the etiquette for choosing field names for custom fields in app.bsky.* lexicons that you don't own? I'm not sure what to name these fields. eg fullText, bridgyFedFullText, fediverseFullText, bridgyFedFediverseFullText, ...?

I think the answer to that is basically 'don't', according to https://atproto.com/specs/lexicon#authority-and-control.

Is there a way to specify a secondary NSID similarly to how you can import multiple namespaces in AP?

@snarfed
Copy link
Owner Author

snarfed commented Jun 5, 2024

Is there a way to specify a secondary NSID similarly to how you can import multiple namespaces in AP?

No, there isn't. Custom fields in existing records is generally what people do right now, there's plenty of precedent for it in the ATProto ecosystem. It's true that the docs you linked say:

This is not the recommended way to extend applications, but it is not specifically disallowed.

...but there's no other realistic extension pattern yet.

I guess one way would be to store our own separate records, and publish logic for finding those records. That's much less discoverable or usable than custom fields in existing records though. I haven't heard of any external developers using "sidecar" records like that yet.

@mackuba
Copy link

mackuba commented Jun 6, 2024

Anyone know the etiquette for choosing field names for custom fields in app.bsky.* lexicons that you don't own? I'm not sure what to name these fields. eg fullText, bridgyFedFullText, fediverseFullText, bridgyFedFediverseFullText, ...?

Hey! I've done some digging for this today. It looks like we're still at the stage where there aren't really any clear conventions for this, or to put it differently, the stage where the conventions are being formed by what we're doing ;)

I've scanned the last few days worth of posts for unexpected record keys, and it looks like the only one of this kind is from the Skeets app by @seboslaw, which I think uses this for the post editing feature. The key there is named skeetsAppHistory.

There are also several non-standard but very generic-sounding keys (and probably in most cases added by mistake), like: via, type, alt, labels etc. This is probably not a good idea.

Some (inconclusive) threads I've found about this:

As I understand it, something like gy.brid.fed.originalPost would probably be technically more "correct". But it looks ugly ;) Something like bridgyOriginalPost, bridgyOriginalPostContent or bridgyFedFullText looks better imho and I would go in this direction (we can bikeshed a bit about the specific name). In any case, apps will probably eventually use both of these conventions and more, and ultimately what matters is only that a key is well defined & documented so that others can make use of it if it makes sense, and to minimize the probability of collisions between 3rd party and Bluesky and between two 3rd parties by doing anything in that direction… I'd think that anything that starts with "bridgy" is extremely unlikely to accidentally create a collision with anything else.

(tagging also @bnewbold)

@snarfed
Copy link
Owner Author

snarfed commented Jun 6, 2024

Wow, thanks for the detailed investigation @mackuba!

Moving to #1092

@qazmlp
Copy link

qazmlp commented Jun 8, 2024

Hmm, suggestion: maybe do "(…)" instead of just "…" at the end? It's not immediately clear that the post was truncated and is not just a normal post that just happens to end the sentence with an ellipsis…

I just ran into that issue and would like to request the same 😅
[…] to me is the standard shortening, but maybe (…) is more common in English?

Another suggestion, but rather than "Original post on …" I'd like to see

  • "Read more on …"
  • "See full text and 2 images on …"
  • eventually (where applicable) also e.g. "See 1 video on …" if all text is present but some media was truncated

since that feels more descriptive of what can be expected after navigation.

snarfed added a commit to snarfed/granary that referenced this issue Jun 10, 2024
…t's HTML

attempts to better preserve whitespace in profile bios. for snarfed/bridgy-fed#986
@snarfed
Copy link
Owner Author

snarfed commented Jun 10, 2024

Agreed on [...]! I've switched to that for both posts and bios. Examples: https://bsky.app/profile/snarfed.indieweb.social.ap.brid.gy/post/3kumap43apaj2 , https://bsky.app/profile/evan.cosocial.ca.ap.brid.gy

@snarfed snarfed closed this as completed Jun 10, 2024
@mackuba
Copy link

mackuba commented Jun 13, 2024

Hmm, have you changed something there to add the link to original inside the post body instead of as an embed?

@snarfed
Copy link
Owner Author

snarfed commented Jun 13, 2024

Good eye! Yes, only for posts with images, since Bluesky can't do both images and link embeds in the same post. 😕 Background in #1106 (comment) and bluesky-social/atproto#2575 .

@mackuba
Copy link

mackuba commented Jun 13, 2024

Ahh, ok, makes sense. I was worried this was a change for all truncated posts :) I saw the discussions about the different embed types, but I didn't realize it was about this. Not ideal, but it will have to do in this case. I think it's better to have this inconsistency with posts w/o images, because otherwise we lose a lot of space for text in those too.

@mackuba
Copy link

mackuba commented Jun 13, 2024

Alternatively, you could possibly link just the "[...]" to the original post instead of adding a second [] with "original post" below? But that might be not obvious enough I guess.

Like:

This is a very long post that was truncated becase [...].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants