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

Feed interactions schema #2383

Merged
merged 11 commits into from
Apr 11, 2024
Merged

Feed interactions schema #2383

merged 11 commits into from
Apr 11, 2024

Conversation

dholms
Copy link
Collaborator

@dholms dholms commented Apr 3, 2024

Adds a lexicon for a client to send interactions back to a feed generator.

This is an optional (but helpful) API for clients to implement to give feedgens feedback on what the user is seeing and whether the user is giving any positive or negative signals about the content, including an "I don't like this" / "Less of this content" signal.

Comment on lines 53 to 56
"feedContext": {
"type": "string",
"description": "Context provided by feed generator that may be passed back alongside interactions."
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is truly freeform context, I might lean towards making it an unknown object. If it's meant to be used as a nonce, token, or something like that it might be cool to reflect it in the name more explicitly (feedToken / interactionToken / feedbackToken?).

There's also probably a practical size limit to these, since all the services need to pass them around. I would lean towards something less than or equal to safe URL lengths (I usually conservatively call this ~2k).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah unknown just really blows it open and we can't add any constraints to it. Figured keeping it a string made it a bit easier to wrangle. Paul & Why both seemed cozy with an opaque string

Which speaking of, I like throwing a utf8 limit on it. 2000 sounds good 👍

Comment on lines 33 to 36
"acceptsFeedback": {
"type": "boolean",
"description": "Declaration that a feed accepts feedback from a client through app.bsky.feed.sendInteractions"
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if there's a way to unify the terminology around either "feedback" or "interactions."

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I was wondering that myself. I guess acceptsInteractions works just seemed a bit off 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thought about it & don't mind it so I changed it to acceptsInteractions 👍

"interaction": {
"type": "object",
"properties": {
"item": { "type": "string", "format": "at-uri" },
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this generally be either a post or repost URI?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now I was thinking it would always be the post uri & any repost that got it in there would be associated through the feedContext that gets sent around 🤔

I left it somewhat vague because I think it's likely we'll start passing down non-post objects in feeds at some point

Comment on lines +194 to +196
"event": {
"type": "string",
"knownValues": [
Copy link
Collaborator

@devinivy devinivy Apr 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have any thoughts on { item: at-uri, event: token, feedContext: string } versus open-union-style { $type, item: at-uri, feedContext: string, ... } I'd be interested to hear! I have a feeling both options crossed your mind 😏

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup that was my first pass on it but then ended up redoing it this way.

Mainly reconsidered because an array of open unions is tough in languages like Go. But also nearly all these interaction types had similar values on them so they were pretty friendly to squash down into a flat object like this so didn't seem like any resolution was lost

@henoya
Copy link

henoya commented Apr 5, 2024

Looking at this definition of "interaction", let me raise a few questions and requests.

Question:

  • Is "interactionShare" sent by selecting share from the post menu?
  • Is the "clickthroughEmbed" trigger only for embedded content like link cards or Youtube?

@henoya
Copy link

henoya commented Apr 5, 2024

Requests:

  • I would also like to see an item like "clickthroughLink." If possible, it would be nice to be able to identify which link was clicked at this time, if there are multiple links attached.
    I once used the feed generator to create a maze exploration game. After that, it stopped working properly due to a change in the display cache specifications of the official custom feed client.
    https://henoya.com/posts/20231210/20231210_feed_screen.png
    It would be nice to be able to get some kind of interaction from the post in the feed, such as choices (yes, just like the choices in Ozone with the labeler's warnings, etc...! I don't need something that rich), I think it would expand the use of custom feeds.

@dholms
Copy link
Collaborator Author

dholms commented Apr 11, 2024

Is "interactionShare" sent by selecting share from the post menu?

Yup that's right 👍

Is the "clickthroughEmbed" trigger only for embedded content like link cards or Youtube?

As well as record embeds (posts, feed generators, lists, etc). You can tell what type of embed it is by looking at the post

I would also like to see an item like "clickthroughLink." If possible, it would be nice to be able to identify which link was clicked at this time, if there are multiple links attached.

I dig the creativity there, but it's a bit out of scope for what we're shooting for right now. We'll likely add more clickthrough events and metadata in the future but wanted to keep it fairly simple for now. The schemas open for extension :)

@dholms dholms merged commit 0edef0e into main Apr 11, 2024
10 checks passed
@dholms dholms deleted the feed-interactions branch April 11, 2024 00:27
@github-actions github-actions bot mentioned this pull request Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants