From 261b94b79104e0f0330bf672d0e58a1066ed1e8e Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Wed, 6 Mar 2024 14:54:28 +0000 Subject: [PATCH 1/2] Show only replies from people you follow by default in Following --- .changeset/ten-tools-exercise.md | 8 +++ lexicons/app/bsky/actor/defs.json | 3 +- packages/api/src/bsky-agent.ts | 2 +- packages/api/src/client/lexicons.ts | 1 + .../src/client/types/app/bsky/actor/defs.ts | 2 +- packages/api/tests/bsky-agent.test.ts | 66 +++++++++---------- packages/bsky/src/lexicon/lexicons.ts | 1 + .../src/lexicon/types/app/bsky/actor/defs.ts | 2 +- packages/ozone/src/lexicon/lexicons.ts | 1 + .../src/lexicon/types/app/bsky/actor/defs.ts | 2 +- packages/pds/src/lexicon/lexicons.ts | 1 + .../src/lexicon/types/app/bsky/actor/defs.ts | 2 +- 12 files changed, 52 insertions(+), 39 deletions(-) create mode 100644 .changeset/ten-tools-exercise.md diff --git a/.changeset/ten-tools-exercise.md b/.changeset/ten-tools-exercise.md new file mode 100644 index 00000000000..b92b62dae54 --- /dev/null +++ b/.changeset/ten-tools-exercise.md @@ -0,0 +1,8 @@ +--- +'@atproto/ozone': minor +'@atproto/bsky': minor +'@atproto/api': minor +'@atproto/pds': minor +--- + +Change Following feed prefs to only show replies from people you follow by default diff --git a/lexicons/app/bsky/actor/defs.json b/lexicons/app/bsky/actor/defs.json index 4764c7c14ae..ee501c28251 100644 --- a/lexicons/app/bsky/actor/defs.json +++ b/lexicons/app/bsky/actor/defs.json @@ -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", diff --git a/packages/api/src/bsky-agent.ts b/packages/api/src/bsky-agent.ts index ae504f90b8d..ba625d690c1 100644 --- a/packages/api/src/bsky-agent.ts +++ b/packages/api/src/bsky-agent.ts @@ -17,7 +17,7 @@ import { sanitizeMutedWordValue } from './util' const FEED_VIEW_PREF_DEFAULTS = { hideReplies: false, - hideRepliesByUnfollowed: false, + hideRepliesByUnfollowed: true, hideRepliesByLikeCount: 0, hideReposts: false, hideQuotePosts: false, diff --git a/packages/api/src/client/lexicons.ts b/packages/api/src/client/lexicons.ts index 72ac23230f4..11c99bcc799 100644 --- a/packages/api/src/client/lexicons.ts +++ b/packages/api/src/client/lexicons.ts @@ -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', diff --git a/packages/api/src/client/types/app/bsky/actor/defs.ts b/packages/api/src/client/types/app/bsky/actor/defs.ts index 630f2454056..45b3826d5cd 100644 --- a/packages/api/src/client/types/app/bsky/actor/defs.ts +++ b/packages/api/src/client/types/app/bsky/actor/defs.ts @@ -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. */ diff --git a/packages/api/tests/bsky-agent.test.ts b/packages/api/tests/bsky-agent.test.ts index 273308625a0..6f77be38e51 100644 --- a/packages/api/tests/bsky-agent.test.ts +++ b/packages/api/tests/bsky-agent.test.ts @@ -226,7 +226,7 @@ describe('agent', () => { feedViewPrefs: { home: { hideReplies: false, - hideRepliesByUnfollowed: false, + hideRepliesByUnfollowed: true, hideRepliesByLikeCount: 0, hideReposts: false, hideQuotePosts: false, @@ -252,7 +252,7 @@ describe('agent', () => { feedViewPrefs: { home: { hideReplies: false, - hideRepliesByUnfollowed: false, + hideRepliesByUnfollowed: true, hideRepliesByLikeCount: 0, hideReposts: false, hideQuotePosts: false, @@ -278,7 +278,7 @@ describe('agent', () => { feedViewPrefs: { home: { hideReplies: false, - hideRepliesByUnfollowed: false, + hideRepliesByUnfollowed: true, hideRepliesByLikeCount: 0, hideReposts: false, hideQuotePosts: false, @@ -306,7 +306,7 @@ describe('agent', () => { feedViewPrefs: { home: { hideReplies: false, - hideRepliesByUnfollowed: false, + hideRepliesByUnfollowed: true, hideRepliesByLikeCount: 0, hideReposts: false, hideQuotePosts: false, @@ -336,7 +336,7 @@ describe('agent', () => { feedViewPrefs: { home: { hideReplies: false, - hideRepliesByUnfollowed: false, + hideRepliesByUnfollowed: true, hideRepliesByLikeCount: 0, hideReposts: false, hideQuotePosts: false, @@ -368,7 +368,7 @@ describe('agent', () => { feedViewPrefs: { home: { hideReplies: false, - hideRepliesByUnfollowed: false, + hideRepliesByUnfollowed: true, hideRepliesByLikeCount: 0, hideReposts: false, hideQuotePosts: false, @@ -400,7 +400,7 @@ describe('agent', () => { feedViewPrefs: { home: { hideReplies: false, - hideRepliesByUnfollowed: false, + hideRepliesByUnfollowed: true, hideRepliesByLikeCount: 0, hideReposts: false, hideQuotePosts: false, @@ -432,7 +432,7 @@ describe('agent', () => { feedViewPrefs: { home: { hideReplies: false, - hideRepliesByUnfollowed: false, + hideRepliesByUnfollowed: true, hideRepliesByLikeCount: 0, hideReposts: false, hideQuotePosts: false, @@ -464,7 +464,7 @@ describe('agent', () => { feedViewPrefs: { home: { hideReplies: false, - hideRepliesByUnfollowed: false, + hideRepliesByUnfollowed: true, hideRepliesByLikeCount: 0, hideReposts: false, hideQuotePosts: false, @@ -496,7 +496,7 @@ describe('agent', () => { feedViewPrefs: { home: { hideReplies: false, - hideRepliesByUnfollowed: false, + hideRepliesByUnfollowed: true, hideRepliesByLikeCount: 0, hideReposts: false, hideQuotePosts: false, @@ -534,7 +534,7 @@ describe('agent', () => { feedViewPrefs: { home: { hideReplies: false, - hideRepliesByUnfollowed: false, + hideRepliesByUnfollowed: true, hideRepliesByLikeCount: 0, hideReposts: false, hideQuotePosts: false, @@ -566,7 +566,7 @@ describe('agent', () => { feedViewPrefs: { home: { hideReplies: false, - hideRepliesByUnfollowed: false, + hideRepliesByUnfollowed: true, hideRepliesByLikeCount: 0, hideReposts: false, hideQuotePosts: false, @@ -598,7 +598,7 @@ describe('agent', () => { feedViewPrefs: { home: { hideReplies: false, - hideRepliesByUnfollowed: false, + hideRepliesByUnfollowed: true, hideRepliesByLikeCount: 0, hideReposts: false, hideQuotePosts: false, @@ -630,7 +630,7 @@ describe('agent', () => { feedViewPrefs: { home: { hideReplies: true, - hideRepliesByUnfollowed: false, + hideRepliesByUnfollowed: true, hideRepliesByLikeCount: 0, hideReposts: false, hideQuotePosts: false, @@ -662,7 +662,7 @@ describe('agent', () => { feedViewPrefs: { home: { hideReplies: false, - hideRepliesByUnfollowed: false, + hideRepliesByUnfollowed: true, hideRepliesByLikeCount: 0, hideReposts: false, hideQuotePosts: false, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -946,7 +946,7 @@ describe('agent', () => { feedViewPrefs: { home: { hideReplies: true, - hideRepliesByUnfollowed: true, + hideRepliesByUnfollowed: false, hideRepliesByLikeCount: 10, hideReposts: true, hideQuotePosts: true, @@ -977,7 +977,7 @@ describe('agent', () => { feedViewPrefs: { home: { hideReplies: true, - hideRepliesByUnfollowed: true, + hideRepliesByUnfollowed: false, hideRepliesByLikeCount: 10, hideReposts: true, hideQuotePosts: true, @@ -1008,7 +1008,7 @@ describe('agent', () => { feedViewPrefs: { home: { hideReplies: true, - hideRepliesByUnfollowed: true, + hideRepliesByUnfollowed: false, hideRepliesByLikeCount: 10, hideReposts: true, hideQuotePosts: true, @@ -1039,7 +1039,7 @@ describe('agent', () => { feedViewPrefs: { home: { hideReplies: true, - hideRepliesByUnfollowed: true, + hideRepliesByUnfollowed: false, hideRepliesByLikeCount: 10, hideReposts: true, hideQuotePosts: true, @@ -1070,7 +1070,7 @@ describe('agent', () => { feedViewPrefs: { home: { hideReplies: true, - hideRepliesByUnfollowed: true, + hideRepliesByUnfollowed: false, hideRepliesByLikeCount: 10, hideReposts: true, hideQuotePosts: true, @@ -1089,7 +1089,7 @@ describe('agent', () => { await agent.setFeedViewPrefs('home', { hideReplies: false, - hideRepliesByUnfollowed: false, + hideRepliesByUnfollowed: true, hideRepliesByLikeCount: 0, hideReposts: false, hideQuotePosts: false, @@ -1112,7 +1112,7 @@ describe('agent', () => { feedViewPrefs: { home: { hideReplies: false, - hideRepliesByUnfollowed: false, + hideRepliesByUnfollowed: true, hideRepliesByLikeCount: 0, hideReposts: false, hideQuotePosts: false, @@ -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, diff --git a/packages/bsky/src/lexicon/lexicons.ts b/packages/bsky/src/lexicon/lexicons.ts index 72ac23230f4..11c99bcc799 100644 --- a/packages/bsky/src/lexicon/lexicons.ts +++ b/packages/bsky/src/lexicon/lexicons.ts @@ -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', diff --git a/packages/bsky/src/lexicon/types/app/bsky/actor/defs.ts b/packages/bsky/src/lexicon/types/app/bsky/actor/defs.ts index 6836fa7e516..e219c846821 100644 --- a/packages/bsky/src/lexicon/types/app/bsky/actor/defs.ts +++ b/packages/bsky/src/lexicon/types/app/bsky/actor/defs.ts @@ -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. */ diff --git a/packages/ozone/src/lexicon/lexicons.ts b/packages/ozone/src/lexicon/lexicons.ts index 72ac23230f4..11c99bcc799 100644 --- a/packages/ozone/src/lexicon/lexicons.ts +++ b/packages/ozone/src/lexicon/lexicons.ts @@ -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', diff --git a/packages/ozone/src/lexicon/types/app/bsky/actor/defs.ts b/packages/ozone/src/lexicon/types/app/bsky/actor/defs.ts index 6836fa7e516..e219c846821 100644 --- a/packages/ozone/src/lexicon/types/app/bsky/actor/defs.ts +++ b/packages/ozone/src/lexicon/types/app/bsky/actor/defs.ts @@ -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. */ diff --git a/packages/pds/src/lexicon/lexicons.ts b/packages/pds/src/lexicon/lexicons.ts index 72ac23230f4..11c99bcc799 100644 --- a/packages/pds/src/lexicon/lexicons.ts +++ b/packages/pds/src/lexicon/lexicons.ts @@ -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', diff --git a/packages/pds/src/lexicon/types/app/bsky/actor/defs.ts b/packages/pds/src/lexicon/types/app/bsky/actor/defs.ts index 6836fa7e516..e219c846821 100644 --- a/packages/pds/src/lexicon/types/app/bsky/actor/defs.ts +++ b/packages/pds/src/lexicon/types/app/bsky/actor/defs.ts @@ -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. */ From a727822adf8a6b466fc6686e9993b76f716afa4c Mon Sep 17 00:00:00 2001 From: dan Date: Wed, 6 Mar 2024 16:55:04 +0000 Subject: [PATCH 2/2] Patch --- .changeset/ten-tools-exercise.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.changeset/ten-tools-exercise.md b/.changeset/ten-tools-exercise.md index b92b62dae54..5b8584e18fb 100644 --- a/.changeset/ten-tools-exercise.md +++ b/.changeset/ten-tools-exercise.md @@ -1,8 +1,8 @@ --- -'@atproto/ozone': minor -'@atproto/bsky': minor -'@atproto/api': minor -'@atproto/pds': minor +'@atproto/ozone': patch +'@atproto/bsky': patch +'@atproto/api': patch +'@atproto/pds': patch --- Change Following feed prefs to only show replies from people you follow by default