Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

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

env var tweaks (#7457)

* add new events

* Discard changes to package.json

* Discard changes to src/lib/constants.ts

* Discard changes to src/state/feed-feedback.tsx

* Discard changes to yarn.lock

* remove unused event

authored by

Hailey and committed by
GitHub
ebb6d5cc 355c50fc

+76 -6
+23 -2
src/components/FeedInterstitials.tsx
··· 196 196 <ProfileGrid 197 197 isSuggestionsLoading={isSuggestionsLoading} 198 198 profiles={data?.suggestions ?? []} 199 + recId={data?.recId} 199 200 error={error} 200 201 viewContext="profile" 201 202 /> ··· 222 223 isSuggestionsLoading, 223 224 error, 224 225 profiles, 226 + recId, 225 227 viewContext = 'feed', 226 228 }: { 227 229 isSuggestionsLoading: boolean 228 230 profiles: AppBskyActorDefs.ProfileViewDetailed[] 231 + recId?: number 229 232 error: Error | null 230 233 viewContext: 'profile' | 'feed' 231 234 }) { ··· 249 252 )) 250 253 ) : error || !profiles.length ? null : ( 251 254 <> 252 - {profiles.slice(0, maxLength).map(profile => ( 255 + {profiles.slice(0, maxLength).map((profile, index) => ( 253 256 <ProfileCard.Link 254 257 key={profile.did} 255 258 profile={profile} 256 259 onPress={() => { 257 - logEvent('feed:interstitial:profileCard:press', {}) 260 + logEvent('suggestedUser:press', { 261 + logContext: 262 + viewContext === 'feed' 263 + ? 'InterstitialDiscover' 264 + : 'InterstitialProfile', 265 + recId, 266 + position: index, 267 + }) 258 268 }} 259 269 style={[ 260 270 a.flex_1, ··· 282 292 logContext="FeedInterstitial" 283 293 shape="round" 284 294 colorInverted 295 + onFollow={() => { 296 + logEvent('suggestedUser:follow', { 297 + logContext: 298 + viewContext === 'feed' 299 + ? 'InterstitialDiscover' 300 + : 'InterstitialProfile', 301 + location: 'Card', 302 + recId, 303 + position: index, 304 + }) 305 + }} 285 306 /> 286 307 </ProfileCard.Header> 287 308 <ProfileCard.Description profile={profile} numberOfLines={2} />
+3
src/components/ProfileCard.tsx
··· 286 286 logContext: LogEvents['profile:follow']['logContext'] & 287 287 LogEvents['profile:unfollow']['logContext'] 288 288 colorInverted?: boolean 289 + onFollow?: () => void 289 290 } & Partial<ButtonProps> 290 291 291 292 export function FollowButton(props: FollowButtonProps) { ··· 299 300 moderationOpts, 300 301 logContext, 301 302 onPress: onPressProp, 303 + onFollow, 302 304 colorInverted, 303 305 ...rest 304 306 }: FollowButtonProps) { ··· 325 327 ), 326 328 ) 327 329 onPressProp?.(e) 330 + onFollow?.() 328 331 } catch (err: any) { 329 332 if (err?.name !== 'AbortError') { 330 333 Toast.show(_(msg`An issue occurred, please try again.`), 'xmark')
+20 -1
src/lib/statsig/events.ts
··· 170 170 | 'PostOnboardingFindFollows' 171 171 | 'ImmersiveVideo' 172 172 } 173 + 'suggestedUser:follow': { 174 + logContext: 175 + | 'Explore' 176 + | 'InterstitialDiscover' 177 + | 'InterstitialProfile' 178 + | 'Profile' 179 + location: 'Card' | 'Profile' 180 + recId?: number 181 + position: number 182 + } 183 + 'suggestedUser:press': { 184 + logContext: 'Explore' | 'InterstitialDiscover' | 'InterstitialProfile' 185 + recId?: number 186 + position: number 187 + } 188 + 'suggestedUser:seen': { 189 + logContext: 'Explore' | 'InterstitialDiscover' | 'InterstitialProfile' 190 + recId?: number 191 + position: number 192 + } 173 193 'profile:unfollow': { 174 194 logContext: 175 195 | 'RecommendedFollowsItem' ··· 225 245 domain: string 226 246 } 227 247 228 - 'feed:interstitial:profileCard:press': {} 229 248 'feed:interstitial:feedCard:press': {} 230 249 231 250 'profile:header:suggestedFollowsCard:press': {}
+1 -1
src/state/queries/suggested-follows.ts
··· 120 120 const suggestions = res.data.isFallback 121 121 ? [] 122 122 : res.data.suggestions.filter(profile => !profile.viewer?.following) 123 - return {suggestions} 123 + return {suggestions, recId: res.data.recId} 124 124 }, 125 125 enabled, 126 126 })
+3
src/view/com/profile/FollowButton.tsx
··· 14 14 profile, 15 15 labelStyle, 16 16 logContext, 17 + onFollow, 17 18 }: { 18 19 unfollowedType?: ButtonType 19 20 followedType?: ButtonType 20 21 profile: Shadow<AppBskyActorDefs.ProfileViewBasic> 21 22 labelStyle?: StyleProp<TextStyle> 22 23 logContext: 'ProfileCard' | 'StarterPackProfilesList' 24 + onFollow?: () => void 23 25 }) { 24 26 const [queueFollow, queueUnfollow] = useProfileFollowMutationQueue( 25 27 profile, ··· 30 32 const onPressFollow = async () => { 31 33 try { 32 34 await queueFollow() 35 + onFollow?.() 33 36 } catch (e: any) { 34 37 if (e?.name !== 'AbortError') { 35 38 Toast.show(_(msg`An issue occurred, please try again.`), 'xmark')
+7 -1
src/view/com/profile/ProfileCard.tsx
··· 184 184 noBg, 185 185 noBorder, 186 186 onPress, 187 + onFollow, 187 188 logContext = 'ProfileCard', 188 189 showKnownFollowers, 189 190 }: { ··· 191 192 noBg?: boolean 192 193 noBorder?: boolean 193 194 onPress?: () => void 195 + onFollow?: () => void 194 196 logContext?: 'ProfileCard' | 'StarterPackProfilesList' 195 197 showKnownFollowers?: boolean 196 198 }) { ··· 206 208 isMe 207 209 ? undefined 208 210 : profileShadow => ( 209 - <FollowButton profile={profileShadow} logContext={logContext} /> 211 + <FollowButton 212 + profile={profileShadow} 213 + logContext={logContext} 214 + onFollow={onFollow} 215 + /> 210 216 ) 211 217 } 212 218 onPress={onPress}
+19 -1
src/view/screens/Search/Explore.tsx
··· 10 10 import {msg, Trans} from '@lingui/macro' 11 11 import {useLingui} from '@lingui/react' 12 12 13 + import {logEvent} from '#/lib/statsig/statsig' 13 14 import {cleanError} from '#/lib/strings/errors' 14 15 import {logger} from '#/logger' 15 16 import {isNative, isWeb} from '#/platform/detection' ··· 259 260 type: 'profile' 260 261 key: string 261 262 profile: AppBskyActorDefs.ProfileView 263 + recId?: number 262 264 } 263 265 | { 264 266 type: 'feed' ··· 383 385 type: 'profile', 384 386 key: actor.did, 385 387 profile: actor, 388 + recId: page.recId, 386 389 }) 387 390 } 388 391 } ··· 511 514 ]) 512 515 513 516 const renderItem = React.useCallback( 514 - ({item}: {item: ExploreScreenItems}) => { 517 + ({item, index}: {item: ExploreScreenItems; index: number}) => { 515 518 switch (item.type) { 516 519 case 'header': { 517 520 return ( ··· 540 543 noBg 541 544 noBorder 542 545 showKnownFollowers 546 + onPress={() => { 547 + logEvent('suggestedUser:press', { 548 + logContext: 'Explore', 549 + recId: item.recId, 550 + position: index, 551 + }) 552 + }} 553 + onFollow={() => { 554 + logEvent('suggestedUser:follow', { 555 + logContext: 'Explore', 556 + location: 'Card', 557 + recId: item.recId, 558 + position: index, 559 + }) 560 + }} 543 561 /> 544 562 </View> 545 563 )