Add feed tuner to remove muted threads (#8773)

This commit is contained in:
kindgracekind
2025-08-04 10:27:27 -05:00
committed by GitHub
parent 9aa35e9fbb
commit b32568260f
2 changed files with 22 additions and 2 deletions
+16
View File
@@ -41,6 +41,7 @@ export class FeedViewPostsSlice {
isIncompleteThread: boolean
isFallbackMarker: boolean
isOrphan: boolean
isThreadMuted: boolean
rootUri: string
feedPostUri: string
@@ -50,6 +51,7 @@ export class FeedViewPostsSlice {
this.isIncompleteThread = false
this.isFallbackMarker = false
this.isOrphan = false
this.isThreadMuted = post.viewer?.threadMuted ?? false
this.feedPostUri = post.uri
if (AppBskyFeedDefs.isPostView(reply?.root)) {
this.rootUri = reply.root.uri
@@ -361,6 +363,20 @@ export class FeedTuner {
return slices
}
static removeMutedThreads(
tuner: FeedTuner,
slices: FeedViewPostsSlice[],
_dryRun: boolean,
) {
for (let i = 0; i < slices.length; i++) {
if (slices[i].isThreadMuted) {
slices.splice(i, 1)
i--
}
}
return slices
}
static dedupThreads(
tuner: FeedTuner,
slices: FeedViewPostsSlice[],