Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove ungroup_follow_backs gate (#4893)

authored by

Eric Bailey and committed by
GitHub
f3a9f874 4b71950d

+4 -18
-1
src/lib/statsig/gates.ts
··· 10 10 | 'show_avi_follow_button' 11 11 | 'show_follow_back_label_v2' 12 12 | 'suggested_feeds_interstitial' 13 - | 'ungroup_follow_backs' 14 13 | 'video_debug' 15 14 | 'videos'
-3
src/state/queries/notifications/feed.ts
··· 26 26 useQueryClient, 27 27 } from '@tanstack/react-query' 28 28 29 - import {useGate} from '#/lib/statsig/statsig' 30 29 import {useAgent} from '#/state/session' 31 30 import {useModerationOpts} from '../../preferences/moderation-opts' 32 31 import {STALE} from '..' ··· 59 58 const moderationOpts = useModerationOpts() 60 59 const unreads = useUnreadNotificationsApi() 61 60 const enabled = opts?.enabled !== false 62 - const gate = useGate() 63 61 64 62 // false: force showing all notifications 65 63 // undefined: let the server decide ··· 88 86 queryClient, 89 87 moderationOpts, 90 88 fetchAdditionalData: true, 91 - shouldUngroupFollowBacks: () => gate('ungroup_follow_backs'), 92 89 priority, 93 90 }) 94 91 page = fetchedPage
+1 -4
src/state/queries/notifications/unread.tsx
··· 8 8 import EventEmitter from 'eventemitter3' 9 9 10 10 import BroadcastChannel from '#/lib/broadcast' 11 - import {useGate} from '#/lib/statsig/statsig' 12 11 import {logger} from '#/logger' 13 12 import {useAgent, useSession} from '#/state/session' 14 13 import {resetBadgeCount} from 'lib/notifications/notifications' ··· 48 47 const agent = useAgent() 49 48 const queryClient = useQueryClient() 50 49 const moderationOpts = useModerationOpts() 51 - const gate = useGate() 52 50 53 51 const [numUnread, setNumUnread] = React.useState('') 54 52 ··· 151 149 // only fetch subjects when the page is going to be used 152 150 // in the notifications query, otherwise skip it 153 151 fetchAdditionalData: !!invalidate, 154 - shouldUngroupFollowBacks: () => gate('ungroup_follow_backs'), 155 152 }) 156 153 const unreadCount = countUnread(page) 157 154 const unreadCountStr = ··· 192 189 } 193 190 }, 194 191 } 195 - }, [setNumUnread, queryClient, moderationOpts, agent, gate]) 192 + }, [setNumUnread, queryClient, moderationOpts, agent]) 196 193 checkUnreadRef.current = api.checkUnread 197 194 198 195 return (
+2 -7
src/state/queries/notifications/util.ts
··· 30 30 queryClient, 31 31 moderationOpts, 32 32 fetchAdditionalData, 33 - shouldUngroupFollowBacks, 34 33 }: { 35 34 agent: BskyAgent 36 35 cursor: string | undefined ··· 38 37 queryClient: QueryClient 39 38 moderationOpts: ModerationOpts | undefined 40 39 fetchAdditionalData: boolean 41 - shouldUngroupFollowBacks?: () => boolean 42 40 priority?: boolean 43 41 }): Promise<{ 44 42 page: FeedPage ··· 58 56 ) 59 57 60 58 // group notifications which are essentially similar (follows, likes on a post) 61 - let notifsGrouped = groupNotifications(notifs, {shouldUngroupFollowBacks}) 59 + let notifsGrouped = groupNotifications(notifs) 62 60 63 61 // we fetch subjects of notifications (usually posts) now instead of lazily 64 62 // in the UI to avoid relayouts ··· 117 115 118 116 export function groupNotifications( 119 117 notifs: AppBskyNotificationListNotifications.Notification[], 120 - options?: {shouldUngroupFollowBacks?: () => boolean}, 121 118 ): FeedNotification[] { 122 119 const groupedNotifs: FeedNotification[] = [] 123 120 for (const notif of notifs) { ··· 137 134 const prevIsFollowBack = 138 135 groupedNotif.notification.reason === 'follow' && 139 136 groupedNotif.notification.author.viewer?.following 140 - const shouldUngroup = 141 - (nextIsFollowBack || prevIsFollowBack) && 142 - options?.shouldUngroupFollowBacks?.() 137 + const shouldUngroup = nextIsFollowBack || prevIsFollowBack 143 138 if (!shouldUngroup) { 144 139 groupedNotif.additional = groupedNotif.additional || [] 145 140 groupedNotif.additional.push(notif)
+1 -3
src/view/com/notifications/FeedItem.tsx
··· 25 25 import {useNavigation} from '@react-navigation/native' 26 26 import {useQueryClient} from '@tanstack/react-query' 27 27 28 - import {useGate} from '#/lib/statsig/statsig' 29 28 import {parseTenorGif} from '#/lib/strings/embed-player' 30 29 import {logger} from '#/logger' 31 30 import {FeedNotification} from '#/state/queries/notifications/feed' ··· 87 86 const pal = usePalette('default') 88 87 const {_} = useLingui() 89 88 const t = useTheme() 90 - const gate = useGate() 91 89 const [isAuthorsExpanded, setAuthorsExpanded] = useState<boolean>(false) 92 90 const itemHref = useMemo(() => { 93 91 if (item.type === 'post-like' || item.type === 'repost') { ··· 207 205 } 208 206 } 209 207 210 - if (isFollowBack && gate('ungroup_follow_backs')) { 208 + if (isFollowBack) { 211 209 action = _(msg`followed you back`) 212 210 } else { 213 211 action = _(msg`followed you`)