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

Implement FeedFeedback API #3498

Merged
merged 27 commits into from
May 7, 2024
Merged

Implement FeedFeedback API #3498

merged 27 commits into from
May 7, 2024

Conversation

pfrazee
Copy link
Collaborator

@pfrazee pfrazee commented Apr 12, 2024

This PR introduces a system for feedback to make it's way back to feeds. This feedback lets the feed know which posts have been seen (so it can stop showing the same stuff twice), requests for more/less of a kind of post, and interaction signals to help train the feed's model.

The permissions model for this is going to be important. For now, we're hard-coding it to the Discover feed only. Once we introduce a permission framework for asking user permission, we'll be able to send this feedback to other feeds as well.

Most of this is invisible, except for the show more / less menu items:

CleanShot 2024-04-19 at 12 39 51@2x

Tasks

  • Add visibility tracking API on Web
  • Track seen events
  • Track all other interaction events
  • Add show more / less menu
  • Batch upload periodically

Copy link

github-actions bot commented Apr 12, 2024

Old size New size Diff
6.87 MB 6.88 MB 6.74 KB (0.10%)

Copy link
Collaborator

@gaearon gaearon left a comment

Choose a reason for hiding this comment

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

react parts make sense to me, didn't take a super close look at the product logic.

src/state/feed-feedback.tsx Outdated Show resolved Hide resolved
src/view/com/util/List.web.tsx Outdated Show resolved Hide resolved
Copy link

render bot commented Apr 18, 2024

@pfrazee pfrazee marked this pull request as ready for review April 30, 2024 00:53
@whyrusleeping
Copy link
Collaborator

this seems to be working, can we ship it behind a statsig gate for now?

@whyrusleeping
Copy link
Collaborator

Actually, before shipping, we should make sure that when this api reports a post as seen, the user has definitely seen it.
If i scroll by a post quickly, or a post is partially off screen or something i dont want it reported as 'seen'

@pfrazee
Copy link
Collaborator Author

pfrazee commented May 3, 2024

@whyrusleeping done. I now make sure the post is substantively visible for at least 3 seconds

src/state/feed-feedback.tsx Outdated Show resolved Hide resolved
@gaearon gaearon force-pushed the paul/feedfeedback branch from 75b4c2c to 03a0235 Compare May 6, 2024 21:54
Copy link

github-actions bot commented May 6, 2024

The Pull Request introduced fingerprint changes against the base commit: e264dfb

Fingerprint diff
[{"type":"file","filePath":"package.json","reasons":["expoConfigPlugins"],"hash":"972bc4be2c765e4da03b73ced5fb523694b13879"}]

Generated by PR labeler 🤖

@gaearon gaearon force-pushed the paul/feedfeedback branch from ce7344b to fd1b663 Compare May 7, 2024 01:20
@gaearon gaearon merged commit 4fad18b into main May 7, 2024
6 checks passed
@gaearon gaearon deleted the paul/feedfeedback branch May 7, 2024 02:08
tkusano added a commit to tkusano/social-app that referenced this pull request May 7, 2024
* Updated as PR on Plural is merged (bluesky-social#3882)
* Feedback API (bluesky-social#3498)

etc.
gaearon added a commit that referenced this pull request May 8, 2024
* Implement onViewableItemsChanged on List.web.tsx

* Introduce onItemSeen to List API

* Add FeedFeedback tracker

* Add clickthrough interaction tracking

* Add engagement interaction tracking

* Reduce duplicate sends, introduce a flushAndReset to be triggered on refreshes, and modify the api design a bit

* Wire up SDK types and feedContext

* Avoid needless function allocations

* Fix schema usage

* Add show more / show less buttons

* Fix minor rendering issue on mobile menu

* Wire up sendInteractions()

* Fix logic error

* Fix: it's item not uri

* Update 'seen' to mean 3 seconds on-screen with some significant portion visible

* Fix non-reactive debounce

* Move methods out

* Use a WeakSet for deduping

* Reset timeout

* 3 -> 2 seconds

* Oopsie

* Throttle instead

* Fix divider

* Remove explicit flush calls

* Rm unused

---------

Co-authored-by: dan <dan.abramov@gmail.com>
pfrazee pushed a commit that referenced this pull request May 20, 2024
* Update Japanese translations

* Updated as PR on Plural is merged (#3882)
* Feedback API (#3498)

etc.

* Improve localization marks (#3285)

* Update Lightbox.tsx

* Change strings for easier localization

* Update DeleteAccount.tsx

* Update LabelsOnMeDialog.tsx

* Update FeedCard.tsx

* Update index.tsx

* Update LabelsOnMeDialog.tsx

* Update index.tsx

* Update FeedCard.tsx

* Update SelfLabel.tsx

* Update Hashtag.tsx

* Update index.tsx

* Update Hashtag.tsx

* Update ChangeHandle.tsx

* Update index.web.tsx

* Update index.web.tsx

* Update index.tsx

* Remove unnecessary `<Trans>` tags

* Update Drawer.tsx

* Finnish translation update (#3755)

* Update messages.po

Translated new strings (GIF's etc) and cleaned up deprecated ones.

* Update messages.po

resolve conflict

* Update messages.po

removed double quotes. Thanks @lapanti

* fix bad bool check in action (#3885)

* fix bad bool check in action

* add `fetch-depth` so we can get the commit hash

* `.env` should be in `.easignore` 🙃

* Updated to follow #3285 etc.

* The translation of 'place' and 'apply' of labels has been unified into '適用する'.

* Fix translation of "repost"

* Updated

* Updated Japanese translation

* Updated Japanese translation

- #3816

* Fixed translations

* Updated translation : #3995

* Updated Japanese translation

* Updated Japanese translation (ref. #3962 #4028)

* Updated Japanese translation

* Updated Japanese translation

* Updated Japanese translation

---------

Co-authored-by: Minseo Lee <itoupluk427@gmail.com>
Co-authored-by: Jan-Olof Eriksson <jan-olof.eriksson@iki.fi>
Co-authored-by: Hailey <me@haileyok.com>
@vasi
Copy link

vasi commented Nov 21, 2024

Hi! Sorry if it's rude to comment on an old PR, but wondering if there's somewhere I can follow along with the plans to generalize this to custom feeds. It seems necessary for any good algorithmic feeds.

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.

4 participants