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

Show only replies from people you follow in Following by default #2279

Merged
merged 2 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/ten-tools-exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@atproto/ozone': minor
'@atproto/bsky': minor
'@atproto/api': minor
'@atproto/pds': minor
gaearon marked this conversation as resolved.
Show resolved Hide resolved
---

Change Following feed prefs to only show replies from people you follow by default
3 changes: 2 additions & 1 deletion lexicons/app/bsky/actor/defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@
},
"hideRepliesByUnfollowed": {
"type": "boolean",
"description": "Hide replies in the feed if they are not by followed users."
"description": "Hide replies in the feed if they are not by followed users.",
"default": true
},
"hideRepliesByLikeCount": {
"type": "integer",
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/bsky-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

const FEED_VIEW_PREF_DEFAULTS = {
Copy link
Member

Choose a reason for hiding this comment

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

Optional: could be a good time to export these and integrate them into the app instead of the duplicative code we have rn

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't have strong preference on this and don't want to think about it yet so I'll pass

hideReplies: false,
hideRepliesByUnfollowed: false,
hideRepliesByUnfollowed: true,
hideRepliesByLikeCount: 0,
hideReposts: false,
hideQuotePosts: false,
Expand Down Expand Up @@ -621,7 +621,7 @@

async updateMutedWord(mutedWord: AppBskyActorDefs.MutedWord) {
await updatePreferences(this, (prefs: AppBskyActorDefs.Preferences) => {
let mutedWordsPref = prefs.findLast(

Check warning on line 624 in packages/api/src/bsky-agent.ts

View workflow job for this annotation

GitHub Actions / Verify

'mutedWordsPref' is never reassigned. Use 'const' instead
(pref) =>
AppBskyActorDefs.isMutedWordsPref(pref) &&
AppBskyActorDefs.validateMutedWordsPref(pref).success,
Expand All @@ -646,7 +646,7 @@

async removeMutedWord(mutedWord: AppBskyActorDefs.MutedWord) {
await updatePreferences(this, (prefs: AppBskyActorDefs.Preferences) => {
let mutedWordsPref = prefs.findLast(

Check warning on line 649 in packages/api/src/bsky-agent.ts

View workflow job for this annotation

GitHub Actions / Verify

'mutedWordsPref' is never reassigned. Use 'const' instead
(pref) =>
AppBskyActorDefs.isMutedWordsPref(pref) &&
AppBskyActorDefs.validateMutedWordsPref(pref).success,
Expand Down
1 change: 1 addition & 0 deletions packages/api/src/client/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5184,6 +5184,7 @@ export const schemaDict = {
type: 'boolean',
description:
'Hide replies in the feed if they are not by followed users.',
default: true,
},
hideRepliesByLikeCount: {
type: 'integer',
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/client/types/app/bsky/actor/defs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export interface FeedViewPref {
/** Hide replies in the feed. */
hideReplies?: boolean
/** Hide replies in the feed if they are not by followed users. */
hideRepliesByUnfollowed?: boolean
hideRepliesByUnfollowed: boolean
/** Hide replies in the feed if they do not have this number of likes. */
hideRepliesByLikeCount?: number
/** Hide reposts in the feed. */
Expand Down
66 changes: 33 additions & 33 deletions packages/api/tests/bsky-agent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ describe('agent', () => {
feedViewPrefs: {
home: {
hideReplies: false,
hideRepliesByUnfollowed: false,
hideRepliesByUnfollowed: true,
hideRepliesByLikeCount: 0,
hideReposts: false,
hideQuotePosts: false,
Expand All @@ -252,7 +252,7 @@ describe('agent', () => {
feedViewPrefs: {
home: {
hideReplies: false,
hideRepliesByUnfollowed: false,
hideRepliesByUnfollowed: true,
hideRepliesByLikeCount: 0,
hideReposts: false,
hideQuotePosts: false,
Expand All @@ -278,7 +278,7 @@ describe('agent', () => {
feedViewPrefs: {
home: {
hideReplies: false,
hideRepliesByUnfollowed: false,
hideRepliesByUnfollowed: true,
hideRepliesByLikeCount: 0,
hideReposts: false,
hideQuotePosts: false,
Expand Down Expand Up @@ -306,7 +306,7 @@ describe('agent', () => {
feedViewPrefs: {
home: {
hideReplies: false,
hideRepliesByUnfollowed: false,
hideRepliesByUnfollowed: true,
hideRepliesByLikeCount: 0,
hideReposts: false,
hideQuotePosts: false,
Expand Down Expand Up @@ -336,7 +336,7 @@ describe('agent', () => {
feedViewPrefs: {
home: {
hideReplies: false,
hideRepliesByUnfollowed: false,
hideRepliesByUnfollowed: true,
hideRepliesByLikeCount: 0,
hideReposts: false,
hideQuotePosts: false,
Expand Down Expand Up @@ -368,7 +368,7 @@ describe('agent', () => {
feedViewPrefs: {
home: {
hideReplies: false,
hideRepliesByUnfollowed: false,
hideRepliesByUnfollowed: true,
hideRepliesByLikeCount: 0,
hideReposts: false,
hideQuotePosts: false,
Expand Down Expand Up @@ -400,7 +400,7 @@ describe('agent', () => {
feedViewPrefs: {
home: {
hideReplies: false,
hideRepliesByUnfollowed: false,
hideRepliesByUnfollowed: true,
hideRepliesByLikeCount: 0,
hideReposts: false,
hideQuotePosts: false,
Expand Down Expand Up @@ -432,7 +432,7 @@ describe('agent', () => {
feedViewPrefs: {
home: {
hideReplies: false,
hideRepliesByUnfollowed: false,
hideRepliesByUnfollowed: true,
hideRepliesByLikeCount: 0,
hideReposts: false,
hideQuotePosts: false,
Expand Down Expand Up @@ -464,7 +464,7 @@ describe('agent', () => {
feedViewPrefs: {
home: {
hideReplies: false,
hideRepliesByUnfollowed: false,
hideRepliesByUnfollowed: true,
hideRepliesByLikeCount: 0,
hideReposts: false,
hideQuotePosts: false,
Expand Down Expand Up @@ -496,7 +496,7 @@ describe('agent', () => {
feedViewPrefs: {
home: {
hideReplies: false,
hideRepliesByUnfollowed: false,
hideRepliesByUnfollowed: true,
hideRepliesByLikeCount: 0,
hideReposts: false,
hideQuotePosts: false,
Expand Down Expand Up @@ -534,7 +534,7 @@ describe('agent', () => {
feedViewPrefs: {
home: {
hideReplies: false,
hideRepliesByUnfollowed: false,
hideRepliesByUnfollowed: true,
hideRepliesByLikeCount: 0,
hideReposts: false,
hideQuotePosts: false,
Expand Down Expand Up @@ -566,7 +566,7 @@ describe('agent', () => {
feedViewPrefs: {
home: {
hideReplies: false,
hideRepliesByUnfollowed: false,
hideRepliesByUnfollowed: true,
hideRepliesByLikeCount: 0,
hideReposts: false,
hideQuotePosts: false,
Expand Down Expand Up @@ -598,7 +598,7 @@ describe('agent', () => {
feedViewPrefs: {
home: {
hideReplies: false,
hideRepliesByUnfollowed: false,
hideRepliesByUnfollowed: true,
hideRepliesByLikeCount: 0,
hideReposts: false,
hideQuotePosts: false,
Expand Down Expand Up @@ -630,7 +630,7 @@ describe('agent', () => {
feedViewPrefs: {
home: {
hideReplies: true,
hideRepliesByUnfollowed: false,
hideRepliesByUnfollowed: true,
hideRepliesByLikeCount: 0,
hideReposts: false,
hideQuotePosts: false,
Expand Down Expand Up @@ -662,7 +662,7 @@ describe('agent', () => {
feedViewPrefs: {
home: {
hideReplies: false,
hideRepliesByUnfollowed: false,
hideRepliesByUnfollowed: true,
hideRepliesByLikeCount: 0,
hideReposts: false,
hideQuotePosts: false,
Expand Down Expand Up @@ -694,14 +694,14 @@ describe('agent', () => {
feedViewPrefs: {
home: {
hideReplies: false,
hideRepliesByUnfollowed: false,
hideRepliesByUnfollowed: true,
hideRepliesByLikeCount: 0,
hideReposts: false,
hideQuotePosts: false,
},
other: {
hideReplies: true,
hideRepliesByUnfollowed: false,
hideRepliesByUnfollowed: true,
hideRepliesByLikeCount: 0,
hideReposts: false,
hideQuotePosts: false,
Expand Down Expand Up @@ -733,14 +733,14 @@ describe('agent', () => {
feedViewPrefs: {
home: {
hideReplies: false,
hideRepliesByUnfollowed: false,
hideRepliesByUnfollowed: true,
hideRepliesByLikeCount: 0,
hideReposts: false,
hideQuotePosts: false,
},
other: {
hideReplies: true,
hideRepliesByUnfollowed: false,
hideRepliesByUnfollowed: true,
hideRepliesByLikeCount: 0,
hideReposts: false,
hideQuotePosts: false,
Expand Down Expand Up @@ -772,14 +772,14 @@ describe('agent', () => {
feedViewPrefs: {
home: {
hideReplies: false,
hideRepliesByUnfollowed: false,
hideRepliesByUnfollowed: true,
hideRepliesByLikeCount: 0,
hideReposts: false,
hideQuotePosts: false,
},
other: {
hideReplies: true,
hideRepliesByUnfollowed: false,
hideRepliesByUnfollowed: true,
hideRepliesByLikeCount: 0,
hideReposts: false,
hideQuotePosts: false,
Expand Down Expand Up @@ -811,14 +811,14 @@ describe('agent', () => {
feedViewPrefs: {
home: {
hideReplies: false,
hideRepliesByUnfollowed: false,
hideRepliesByUnfollowed: true,
hideRepliesByLikeCount: 0,
hideReposts: false,
hideQuotePosts: false,
},
other: {
hideReplies: true,
hideRepliesByUnfollowed: false,
hideRepliesByUnfollowed: true,
hideRepliesByLikeCount: 0,
hideReposts: false,
hideQuotePosts: false,
Expand Down Expand Up @@ -907,7 +907,7 @@ describe('agent', () => {
$type: 'app.bsky.actor.defs#feedViewPref',
feed: 'home',
hideReplies: false,
hideRepliesByUnfollowed: false,
hideRepliesByUnfollowed: true,
hideRepliesByLikeCount: 0,
hideReposts: false,
hideQuotePosts: false,
Expand All @@ -916,7 +916,7 @@ describe('agent', () => {
$type: 'app.bsky.actor.defs#feedViewPref',
feed: 'home',
hideReplies: true,
hideRepliesByUnfollowed: true,
hideRepliesByUnfollowed: false,
hideRepliesByLikeCount: 10,
hideReposts: true,
hideQuotePosts: true,
Expand Down Expand Up @@ -946,7 +946,7 @@ describe('agent', () => {
feedViewPrefs: {
home: {
hideReplies: true,
hideRepliesByUnfollowed: true,
hideRepliesByUnfollowed: false,
hideRepliesByLikeCount: 10,
hideReposts: true,
hideQuotePosts: true,
Expand Down Expand Up @@ -977,7 +977,7 @@ describe('agent', () => {
feedViewPrefs: {
home: {
hideReplies: true,
hideRepliesByUnfollowed: true,
hideRepliesByUnfollowed: false,
hideRepliesByLikeCount: 10,
hideReposts: true,
hideQuotePosts: true,
Expand Down Expand Up @@ -1008,7 +1008,7 @@ describe('agent', () => {
feedViewPrefs: {
home: {
hideReplies: true,
hideRepliesByUnfollowed: true,
hideRepliesByUnfollowed: false,
hideRepliesByLikeCount: 10,
hideReposts: true,
hideQuotePosts: true,
Expand Down Expand Up @@ -1039,7 +1039,7 @@ describe('agent', () => {
feedViewPrefs: {
home: {
hideReplies: true,
hideRepliesByUnfollowed: true,
hideRepliesByUnfollowed: false,
hideRepliesByLikeCount: 10,
hideReposts: true,
hideQuotePosts: true,
Expand Down Expand Up @@ -1070,7 +1070,7 @@ describe('agent', () => {
feedViewPrefs: {
home: {
hideReplies: true,
hideRepliesByUnfollowed: true,
hideRepliesByUnfollowed: false,
hideRepliesByLikeCount: 10,
hideReposts: true,
hideQuotePosts: true,
Expand All @@ -1089,7 +1089,7 @@ describe('agent', () => {

await agent.setFeedViewPrefs('home', {
hideReplies: false,
hideRepliesByUnfollowed: false,
hideRepliesByUnfollowed: true,
hideRepliesByLikeCount: 0,
hideReposts: false,
hideQuotePosts: false,
Expand All @@ -1112,7 +1112,7 @@ describe('agent', () => {
feedViewPrefs: {
home: {
hideReplies: false,
hideRepliesByUnfollowed: false,
hideRepliesByUnfollowed: true,
hideRepliesByLikeCount: 0,
hideReposts: false,
hideQuotePosts: false,
Expand Down Expand Up @@ -1155,7 +1155,7 @@ describe('agent', () => {
$type: 'app.bsky.actor.defs#feedViewPref',
feed: 'home',
hideReplies: false,
hideRepliesByUnfollowed: false,
hideRepliesByUnfollowed: true,
hideRepliesByLikeCount: 0,
hideReposts: false,
hideQuotePosts: false,
Expand Down
1 change: 1 addition & 0 deletions packages/bsky/src/lexicon/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5184,6 +5184,7 @@ export const schemaDict = {
type: 'boolean',
description:
'Hide replies in the feed if they are not by followed users.',
default: true,
},
hideRepliesByLikeCount: {
type: 'integer',
Expand Down
2 changes: 1 addition & 1 deletion packages/bsky/src/lexicon/types/app/bsky/actor/defs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export interface FeedViewPref {
/** Hide replies in the feed. */
hideReplies?: boolean
/** Hide replies in the feed if they are not by followed users. */
hideRepliesByUnfollowed?: boolean
hideRepliesByUnfollowed: boolean
/** Hide replies in the feed if they do not have this number of likes. */
hideRepliesByLikeCount?: number
/** Hide reposts in the feed. */
Expand Down
1 change: 1 addition & 0 deletions packages/ozone/src/lexicon/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5184,6 +5184,7 @@ export const schemaDict = {
type: 'boolean',
description:
'Hide replies in the feed if they are not by followed users.',
default: true,
},
hideRepliesByLikeCount: {
type: 'integer',
Expand Down
2 changes: 1 addition & 1 deletion packages/ozone/src/lexicon/types/app/bsky/actor/defs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export interface FeedViewPref {
/** Hide replies in the feed. */
hideReplies?: boolean
/** Hide replies in the feed if they are not by followed users. */
hideRepliesByUnfollowed?: boolean
hideRepliesByUnfollowed: boolean
/** Hide replies in the feed if they do not have this number of likes. */
hideRepliesByLikeCount?: number
/** Hide reposts in the feed. */
Expand Down
1 change: 1 addition & 0 deletions packages/pds/src/lexicon/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5184,6 +5184,7 @@ export const schemaDict = {
type: 'boolean',
description:
'Hide replies in the feed if they are not by followed users.',
default: true,
},
hideRepliesByLikeCount: {
type: 'integer',
Expand Down
2 changes: 1 addition & 1 deletion packages/pds/src/lexicon/types/app/bsky/actor/defs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export interface FeedViewPref {
/** Hide replies in the feed. */
hideReplies?: boolean
/** Hide replies in the feed if they are not by followed users. */
hideRepliesByUnfollowed?: boolean
hideRepliesByUnfollowed: boolean
/** Hide replies in the feed if they do not have this number of likes. */
hideRepliesByLikeCount?: number
/** Hide reposts in the feed. */
Expand Down
Loading