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

Social proof #2548

Merged
merged 5 commits into from
Jun 6, 2024
Merged

Conversation

dirkmc
Copy link
Contributor

@dirkmc dirkmc commented Jun 4, 2024

When you view a user’s profile we’d like to provide some details about followers of the given account that you follow. This establishes social connections between the two users, and we hope that it will facilitate users discovering their broader clusters and ultimately following each other. Here’s an example:
image

This PR adds a socialProof to the viewer section of the profile, eg:

{
    ...
    socialProof: {
      count: 1,
      follows: [
        {
          did: 'did:plc:x3bne6hoa7xokmoccsqzgxvm',
          handle: 'bob.test',
          displayName: 'bobby',
          avatar: 'https://bsky.public.url/img/avatar/plain/did:plc:x3bne6hoa7xokmoccsqzgxvm/bafkreiaivizp4xldojmmpuzmiu75cmea7nq56dnntnuhzhsjcb63aou5ei@jpeg',
          viewer: [Object],
          labels: []
        }
      ]
    }
}

The PR implements

  • a getFollowsFollowing({ actorDid, targetDid }) method at the data-plane layer, that returns a list of dids
  • hydration:
    • the socialProof element of the ProfileViewerState with a count and follows for the first 5 dids returned from the data-plane layer
    • each did is hydrated into a profile on the HydrationState
  • a view layer that maps each of the follows into a basic profile

dholms and others added 5 commits June 4, 2024 10:33
* attach hosting status to entryway session responses

* integrate account deactivation in with entryway

* tidy

* tidy

* chnageset

* update changeset
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@estrattonbailey
Copy link
Member

Thanks @dirkmc! Gonna merge into the base and take it from here 👍

@estrattonbailey estrattonbailey merged commit 5c4b3d3 into bluesky-social:social-proof Jun 6, 2024
estrattonbailey pushed a commit that referenced this pull request Jun 6, 2024
* Update deactivation through updateSubjectStatus (#2539)

* attach hosting status to entryway session responses

* integrate account deactivation in with entryway

* tidy

* tidy

* chnageset

* update changeset

* Version packages (#2546)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* lexicon: initial social proof lexicons

* feat: add generated types for social proof

* feat: social proof implementation

---------

Co-authored-by: Daniel Holmgren <dtholmgren@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Devin Ivy <devinivy@gmail.com>
@dirkmc dirkmc deleted the social-proof branch June 7, 2024 07:03
estrattonbailey pushed a commit that referenced this pull request Jun 7, 2024
* Update deactivation through updateSubjectStatus (#2539)

* attach hosting status to entryway session responses

* integrate account deactivation in with entryway

* tidy

* tidy

* chnageset

* update changeset

* Version packages (#2546)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* lexicon: initial social proof lexicons

* feat: add generated types for social proof

* feat: social proof implementation

---------

Co-authored-by: Daniel Holmgren <dtholmgren@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Devin Ivy <devinivy@gmail.com>
dholms added a commit that referenced this pull request Jun 11, 2024
* lexicon: initial social proof lexicons

* Social proof (#2548)

* Update deactivation through updateSubjectStatus (#2539)

* attach hosting status to entryway session responses

* integrate account deactivation in with entryway

* tidy

* tidy

* chnageset

* update changeset

* Version packages (#2546)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* lexicon: initial social proof lexicons

* feat: add generated types for social proof

* feat: social proof implementation

---------

Co-authored-by: Daniel Holmgren <dtholmgren@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Devin Ivy <devinivy@gmail.com>

* Rename

* Codegen

* Implementation, renaming

* Remove only

* Add depth resolution param, update snaps

* Be smart like Devin

* Snaps

* Revert lock changes

* Snaps

* Snaps

* Snaps

* Add changeset

* Snaps

* Revert lock changes

* Add test for basic profile

* Add getKnownFollowersEndpoint

* Make it zero

* Return max of 5

* Remove isNoHosted

* Use array and index

* Clarify ternary

* Remove includeKnownFollowers from views

* Revert "Return max of 5"

This reverts commit 1a27eb7.

* Ope missed a param

* Rename view method

* Don't return viewer if undefined

* Format

* Clean up hydrator

* Snaps

* Update proto, use batch endpoint

* Format

* Fix proto, codegen

* Remove unneeded promise

* Move hydrator into route handler

* Add hydrationLogger

* Handle failures of dataplane getKnownFollowers

* Use .at(), defer to params.limit

* Create instance of FollowsFollowing for better type support

* Support knownFollowers in mergeStates

* Add back fat-fingered deleted imports

* Filter out blocks

* Codegen lex

* Naive block filtering

* Remove whitespace edits

* Update changeset desc

* Remove whitespace

---------

Co-authored-by: Devin Ivy <devinivy@gmail.com>
Co-authored-by: dirkmc <dirkmdev@gmail.com>
Co-authored-by: Daniel Holmgren <dtholmgren@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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