Bluesky app fork with some witchin' additions 💫 witchsky.app
bluesky fork client
122
fork

Configure Feed

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

Add logging of selected feed preference when displaying the following feed (#4789)

authored by

Hailey and committed by
GitHub
b3092413 1b02f81c

+34 -2
+6
src/lib/statsig/events.ts
··· 211 211 'feed:interstitial:profileCard:press': {} 212 212 'feed:interstitial:feedCard:press': {} 213 213 214 + 'debug:followingPrefs': { 215 + followingShowRepliesFromPref: 'all' | 'following' | 'off' 216 + followingRepliesMinLikePref: number 217 + } 218 + 'debug:followingDisplayed': {} 219 + 214 220 'test:all:always': {} 215 221 'test:all:sometimes': {} 216 222 'test:all:boosted_by_gate1': {reason: 'base' | 'gate1'}
+28 -2
src/view/screens/Home.tsx
··· 9 9 import {logEvent, LogEvents} from '#/lib/statsig/statsig' 10 10 import {emitSoftReset} from '#/state/events' 11 11 import {SavedFeedSourceInfo, usePinnedFeedsInfos} from '#/state/queries/feed' 12 - import {FeedParams} from '#/state/queries/post-feed' 12 + import {FeedDescriptor, FeedParams} from '#/state/queries/post-feed' 13 13 import {usePreferencesQuery} from '#/state/queries/preferences' 14 14 import {UsePreferencesQueryResponse} from '#/state/queries/preferences/types' 15 15 import {useSession} from '#/state/session' ··· 108 108 } 109 109 }, [selectedIndex]) 110 110 111 + // Temporary, remove when finished debugging 112 + const debugHasLoggedFollowingPrefs = React.useRef(false) 113 + const debugLogFollowingPrefs = React.useCallback( 114 + (feed: FeedDescriptor) => { 115 + if (debugHasLoggedFollowingPrefs.current) return 116 + if (feed !== 'following') return 117 + logEvent('debug:followingPrefs', { 118 + followingShowRepliesFromPref: preferences.feedViewPrefs.hideReplies 119 + ? 'off' 120 + : preferences.feedViewPrefs.hideRepliesByUnfollowed 121 + ? 'following' 122 + : 'all', 123 + followingRepliesMinLikePref: 124 + preferences.feedViewPrefs.hideRepliesByLikeCount, 125 + }) 126 + debugHasLoggedFollowingPrefs.current = true 127 + }, 128 + [ 129 + preferences.feedViewPrefs.hideReplies, 130 + preferences.feedViewPrefs.hideRepliesByLikeCount, 131 + preferences.feedViewPrefs.hideRepliesByUnfollowed, 132 + ], 133 + ) 134 + 111 135 const {hasSession} = useSession() 112 136 const setMinimalShellMode = useSetMinimalShellMode() 113 137 const setDrawerSwipeDisabled = useSetDrawerSwipeDisabled() ··· 136 160 feedUrl: selectedFeed, 137 161 reason: 'focus', 138 162 }) 163 + debugLogFollowingPrefs(selectedFeed) 139 164 } 140 165 }), 141 166 ) ··· 182 207 feedUrl: feed, 183 208 reason, 184 209 }) 210 + debugLogFollowingPrefs(feed) 185 211 }, 186 - [allFeeds], 212 + [allFeeds, debugLogFollowingPrefs], 187 213 ) 188 214 189 215 const onPressSelected = React.useCallback(() => {