Bluesky app fork with some witchin' additions 馃挮
at post-text-option 723 lines 18 kB view raw
1import {type NotificationReason} from '#/lib/hooks/useNotificationHandler' 2import {type FeedDescriptor} from '#/state/queries/post-feed' 3 4export type MetricEvents = { 5 // App events 6 init: { 7 initMs: number 8 } 9 'account:loggedIn': { 10 logContext: 11 | 'LoginForm' 12 | 'SwitchAccount' 13 | 'ChooseAccountForm' 14 | 'Settings' 15 | 'Notification' 16 withPassword: boolean 17 } 18 'account:loggedOut': { 19 logContext: 20 | 'SwitchAccount' 21 | 'Settings' 22 | 'SignupQueued' 23 | 'Deactivated' 24 | 'Takendown' 25 | 'AgeAssuranceNoAccessScreen' 26 scope: 'current' | 'every' 27 } 28 'notifications:openApp': { 29 reason: NotificationReason 30 causedBoot: boolean 31 } 32 'notifications:request': { 33 context: 'StartOnboarding' | 'AfterOnboarding' | 'Login' | 'Home' 34 status: 'granted' | 'denied' | 'undetermined' 35 } 36 'state:background': { 37 secondsActive: number 38 } 39 'state:foreground': {} 40 'router:navigate': { 41 from?: string 42 } 43 'deepLink:referrerReceived': { 44 to: string 45 referrer: string 46 hostname: string 47 } 48 49 // Screen events 50 'splash:signInPressed': {} 51 'splash:createAccountPressed': {} 52 'welcomeModal:signupClicked': {} 53 'welcomeModal:exploreClicked': {} 54 'welcomeModal:signinClicked': {} 55 'welcomeModal:dismissed': {} 56 'welcomeModal:presented': {} 57 'signup:nextPressed': { 58 activeStep: number 59 phoneVerificationRequired?: boolean 60 } 61 'signup:backPressed': { 62 activeStep: number 63 } 64 'signup:captchaSuccess': {} 65 'signup:captchaFailure': {} 66 'signup:fieldError': { 67 field: string 68 errorCount: number 69 errorMessage: string 70 activeStep: number 71 } 72 'signup:backgrounded': { 73 activeStep: number 74 backgroundCount: number 75 } 76 'signup:handleTaken': {typeahead?: boolean} 77 'signup:handleAvailable': {typeahead?: boolean} 78 'signup:handleSuggestionSelected': {method: string} 79 'signin:hostingProviderPressed': { 80 hostingProviderDidChange: boolean 81 } 82 'signin:hostingProviderFailedResolution': {} 83 'signin:success': { 84 failedAttemptsCount: number 85 isUsingCustomProvider: boolean 86 timeTakenSeconds: number 87 } 88 'signin:backPressed': { 89 failedAttemptsCount: number 90 } 91 'signin:forgotPasswordPressed': {} 92 'signin:passwordReset': {} 93 'signin:passwordResetSuccess': {} 94 'signin:passwordResetFailure': {} 95 'onboarding:interests:nextPressed': { 96 selectedInterests: string[] 97 selectedInterestsLength: number 98 } 99 'onboarding:suggestedAccounts:tabPressed': { 100 tab: string 101 } 102 'onboarding:suggestedAccounts:followAllPressed': { 103 tab: string 104 numAccounts: number 105 } 106 'onboarding:suggestedAccounts:nextPressed': { 107 selectedAccountsLength: number 108 skipped: boolean 109 } 110 'onboarding:followingFeed:nextPressed': {} 111 'onboarding:algoFeeds:nextPressed': { 112 selectedPrimaryFeeds: string[] 113 selectedPrimaryFeedsLength: number 114 selectedSecondaryFeeds: string[] 115 selectedSecondaryFeedsLength: number 116 } 117 'onboarding:topicalFeeds:nextPressed': { 118 selectedFeeds: string[] 119 selectedFeedsLength: number 120 } 121 'onboarding:moderation:nextPressed': {} 122 'onboarding:profile:nextPressed': {} 123 'onboarding:finished:nextPressed': { 124 usedStarterPack: boolean 125 starterPackName?: string 126 starterPackCreator?: string 127 starterPackUri?: string 128 profilesFollowed: number 129 feedsPinned: number 130 } 131 'onboarding:finished:avatarResult': { 132 avatarResult: 'default' | 'created' | 'uploaded' 133 } 134 'onboarding:valueProp:stepOne:nextPressed': {} 135 'onboarding:valueProp:stepTwo:nextPressed': {} 136 'onboarding:valueProp:skipPressed': {} 137 'home:feedDisplayed': { 138 feedUrl: string 139 feedType: string 140 index: number 141 } 142 'feed:endReached': { 143 feedUrl: string 144 feedType: string 145 itemCount: number 146 } 147 'feed:refresh': { 148 feedUrl: string 149 feedType: string 150 reason: 'pull-to-refresh' | 'soft-reset' | 'load-latest' 151 } 152 'feed:save': { 153 feedUrl: string 154 } 155 'feed:unsave': { 156 feedUrl: string 157 } 158 'feed:pin': { 159 feedUrl: string 160 } 161 'feed:unpin': { 162 feedUrl: string 163 } 164 'feed:like': { 165 feedUrl: string 166 } 167 'feed:unlike': { 168 feedUrl: string 169 } 170 'feed:share': { 171 feedUrl: string 172 } 173 'feed:suggestion:seen': { 174 feedUrl: string 175 } 176 'feed:suggestion:press': { 177 feedUrl: string 178 } 179 'feed:showMore': { 180 feed: string 181 feedContext: string 182 } 183 'feed:showLess': { 184 feed: string 185 feedContext: string 186 } 187 'feed:clickthrough': { 188 feed: string 189 count: number 190 } 191 'feed:engaged': { 192 feed: string 193 count: number 194 } 195 'feed:seen': { 196 feed: string 197 count: number 198 } 199 200 'feed:discover:emptyError': { 201 userDid: string 202 } 203 204 'composer:gif:open': {} 205 'composer:gif:select': {} 206 'composerPrompt:press': {} 207 'composerPrompt:camera:press': {} 208 'composerPrompt:gallery:press': {} 209 210 'composer:threadgate:open': { 211 nudged: boolean 212 } 213 'composer:threadgate:save': { 214 replyOptions: string 215 quotesEnabled: boolean 216 persist: boolean 217 hasChanged: boolean 218 } 219 220 // Data events 221 'account:create:begin': {} 222 'account:create:success': { 223 signupDuration: number 224 fieldErrorsTotal: number 225 backgroundCount: number 226 } 227 'post:create': { 228 imageCount: number 229 isReply: boolean 230 isPartOfThread: boolean 231 hasLink: boolean 232 hasQuote: boolean 233 langs: string 234 logContext: 'Composer' 235 } 236 'thread:create': { 237 postCount: number 238 isReply: boolean 239 } 240 'post:like': { 241 doesLikerFollowPoster: boolean | undefined 242 doesPosterFollowLiker: boolean | undefined 243 likerClout: number | undefined 244 postClout: number | undefined 245 logContext: 'FeedItem' | 'PostThreadItem' | 'Post' | 'ImmersiveVideo' 246 feedDescriptor?: string 247 } 248 'post:repost': { 249 logContext: 'FeedItem' | 'PostThreadItem' | 'Post' | 'ImmersiveVideo' 250 feedDescriptor?: string 251 } 252 'post:unlike': { 253 logContext: 'FeedItem' | 'PostThreadItem' | 'Post' | 'ImmersiveVideo' 254 feedDescriptor?: string 255 } 256 'post:unrepost': { 257 logContext: 'FeedItem' | 'PostThreadItem' | 'Post' | 'ImmersiveVideo' 258 feedDescriptor?: string 259 } 260 'post:mute': {} 261 'post:unmute': {} 262 'post:pin': {} 263 'post:unpin': {} 264 'post:bookmark': { 265 logContext: 'FeedItem' | 'PostThreadItem' | 'Post' | 'ImmersiveVideo' 266 } 267 'post:unbookmark': { 268 logContext: 'FeedItem' | 'PostThreadItem' | 'Post' | 'ImmersiveVideo' 269 } 270 'post:view': { 271 uri: string 272 authorDid: string 273 logContext: 274 | 'FeedItem' 275 | 'PostThreadItem' 276 | 'Post' 277 | 'ImmersiveVideo' 278 | 'SearchResults' 279 | 'Bookmarks' 280 | 'Notifications' 281 | 'Hashtag' 282 | 'Topic' 283 | 'PostQuotes' 284 feedDescriptor?: string 285 position?: number 286 } 287 'bookmarks:view': {} 288 'bookmarks:post-clicked': {} 289 'profile:follow': { 290 contextProfileDid?: string 291 didBecomeMutual: boolean | undefined 292 followeeClout: number | undefined 293 followeeDid: string 294 followerClout: number | undefined 295 position?: number 296 logContext: 297 | 'RecommendedFollowsItem' 298 | 'PostThreadItem' 299 | 'ProfileCard' 300 | 'ProfileHeader' 301 | 'ProfileHeaderSuggestedFollows' 302 | 'ProfileMenu' 303 | 'ProfileHoverCard' 304 | 'AvatarButton' 305 | 'StarterPackProfilesList' 306 | 'FeedInterstitial' 307 | 'ProfileHeaderSuggestedFollows' 308 | 'PostOnboardingFindFollows' 309 | 'ImmersiveVideo' 310 | 'ExploreSuggestedAccounts' 311 | 'OnboardingSuggestedAccounts' 312 | 'FindContacts' 313 } 314 'profile:followers:view': { 315 contextProfileDid: string 316 isOwnProfile: boolean 317 } 318 'profile:followers:paginate': { 319 contextProfileDid: string 320 itemCount: number 321 page: number 322 } 323 'profile:following:view': { 324 contextProfileDid: string 325 isOwnProfile: boolean 326 } 327 'profile:following:paginate': { 328 contextProfileDid: string 329 itemCount: number 330 page: number 331 } 332 'profileCard:seen': { 333 contextProfileDid?: string 334 profileDid: string 335 position?: number 336 } 337 'suggestedUser:follow': { 338 logContext: 339 | 'Explore' 340 | 'InterstitialDiscover' 341 | 'InterstitialProfile' 342 | 'Profile' 343 | 'Onboarding' 344 location: 'Card' | 'Profile' 345 recId?: number 346 position: number 347 suggestedDid: string 348 category: string | null 349 } 350 'suggestedUser:press': { 351 logContext: 352 | 'Explore' 353 | 'InterstitialDiscover' 354 | 'InterstitialProfile' 355 | 'Onboarding' 356 recId?: number 357 position: number 358 suggestedDid: string 359 category: string | null 360 } 361 'suggestedUser:seen': { 362 logContext: 363 | 'Explore' 364 | 'InterstitialDiscover' 365 | 'InterstitialProfile' 366 | 'Profile' 367 | 'Onboarding' 368 | 'ProgressGuide' 369 recId?: number 370 position: number 371 suggestedDid: string 372 category: string | null 373 } 374 'suggestedUser:seeMore': { 375 logContext: 376 | 'Explore' 377 | 'InterstitialDiscover' 378 | 'InterstitialProfile' 379 | 'Profile' 380 | 'Onboarding' 381 } 382 'suggestedUser:dismiss': { 383 logContext: 'InterstitialDiscover' | 'InterstitialProfile' 384 recId?: number 385 position: number 386 suggestedDid: string 387 } 388 'profile:unfollow': { 389 logContext: 390 | 'RecommendedFollowsItem' 391 | 'PostThreadItem' 392 | 'ProfileCard' 393 | 'ProfileHeader' 394 | 'ProfileHeaderSuggestedFollows' 395 | 'ProfileMenu' 396 | 'ProfileHoverCard' 397 | 'Chat' 398 | 'AvatarButton' 399 | 'StarterPackProfilesList' 400 | 'FeedInterstitial' 401 | 'ProfileHeaderSuggestedFollows' 402 | 'PostOnboardingFindFollows' 403 | 'ImmersiveVideo' 404 | 'ExploreSuggestedAccounts' 405 | 'OnboardingSuggestedAccounts' 406 | 'FindContacts' 407 } 408 'chat:create': { 409 logContext: 'ProfileHeader' | 'NewChatDialog' | 'SendViaChatDialog' 410 } 411 'chat:open': { 412 logContext: 413 | 'ProfileHeader' 414 | 'NewChatDialog' 415 | 'ChatsList' 416 | 'SendViaChatDialog' 417 } 418 'starterPack:addUser': { 419 starterPack?: string 420 } 421 'starterPack:removeUser': { 422 starterPack?: string 423 } 424 'starterPack:share': { 425 starterPack: string 426 shareType: 'link' | 'qrcode' 427 qrShareType?: 'save' | 'copy' | 'share' 428 } 429 'starterPack:followAll': { 430 logContext: 'StarterPackProfilesList' | 'Onboarding' 431 starterPack: string 432 count: number 433 } 434 'starterPack:delete': {} 435 'starterPack:create': { 436 setName: boolean 437 setDescription: boolean 438 profilesCount: number 439 feedsCount: number 440 } 441 'starterPack:ctaPress': { 442 starterPack: string 443 } 444 'starterPack:opened': { 445 starterPack: string 446 } 447 'link:clicked': { 448 url: string 449 domain: string 450 } 451 452 'feed:interstitial:feedCard:press': {} 453 'desktopFeeds:feed:click': { 454 feedUri: string 455 feedDescriptor: string 456 } 457 458 'profile:header:suggestedFollowsCard:press': {} 459 'profile:addToStarterPack': {} 460 461 'test:all:always': {} 462 'test:all:sometimes': {} 463 'test:all:boosted_by_gate1': {reason: 'base' | 'gate1'} 464 'test:all:boosted_by_gate2': {reason: 'base' | 'gate2'} 465 'test:all:boosted_by_both': {reason: 'base' | 'gate1' | 'gate2'} 466 'test:gate1:always': {} 467 'test:gate1:sometimes': {} 468 'test:gate2:always': {} 469 'test:gate2:sometimes': {} 470 471 'tmd:share': {} 472 'tmd:download': {} 473 'tmd:post': {} 474 475 'trendingTopics:show': { 476 context: 'settings' 477 } 478 'trendingTopics:hide': { 479 context: 'settings' | 'sidebar' | 'interstitial' | 'explore:trending' 480 } 481 'trendingTopic:click': { 482 context: 'sidebar' | 'interstitial' | 'explore' 483 } 484 'recommendedTopic:click': { 485 context: 'explore' 486 } 487 'trendingVideos:show': { 488 context: 'settings' 489 } 490 'trendingVideos:hide': { 491 context: 'settings' | 'interstitial:discover' | 'interstitial:explore' 492 } 493 'videoCard:click': { 494 context: 'interstitial:discover' | 'interstitial:explore' | 'feed' 495 } 496 497 'explore:module:seen': { 498 module: 499 | 'trendingTopics' 500 | 'trendingVideos' 501 | 'suggestedAccounts' 502 | 'suggestedFeeds' 503 | 'suggestedStarterPacks' 504 | `feed:${FeedDescriptor}` 505 } 506 'explore:module:searchButtonPress': { 507 module: 'suggestedAccounts' | 'suggestedFeeds' 508 } 509 'explore:suggestedAccounts:tabPressed': { 510 tab: string 511 } 512 513 'progressGuide:hide': {} 514 'progressGuide:followDialog:open': {} 515 516 'moderation:subscribedToLabeler': {} 517 'moderation:unsubscribedFromLabeler': {} 518 'moderation:changeLabelPreference': { 519 preference: string 520 } 521 522 'moderation:subscribedToList': { 523 listType: 'mute' | 'block' 524 } 525 'moderation:unsubscribedFromList': { 526 listType: 'mute' | 'block' 527 } 528 529 'reportDialog:open': { 530 subjectType: string 531 } 532 'reportDialog:close': {} 533 'reportDialog:success': { 534 reason: string 535 labeler: string 536 details: boolean 537 } 538 'reportDialog:failure': {} 539 540 translate: { 541 sourceLanguages: string[] 542 targetLanguage: string 543 textLength: number 544 } 545 546 'verification:create': {} 547 'verification:revoke': {} 548 'verification:badge:click': {} 549 'verification:learn-more': { 550 location: 551 | 'initialAnnouncementeNux' 552 | 'verificationsDialog' 553 | 'verifierDialog' 554 | 'verificationSettings' 555 } 556 'verification:settings:hideBadges': {} 557 'verification:settings:unHideBadges': {} 558 559 'live:create': {duration: number} 560 'live:edit': {} 561 'live:remove': {} 562 'live:card:open': {subject: string; from: 'post' | 'profile'} 563 'live:card:watch': {subject: string} 564 'live:card:openProfile': {subject: string} 565 'live:view:profile': {subject: string} 566 'live:view:post': {subject: string; feed?: string} 567 568 'share:open': {context: 'feed' | 'thread'} 569 'share:press:copyLink': {} 570 'share:press:nativeShare': {} 571 'share:press:openDmSearch': {} 572 'share:press:dmSelected': {} 573 'share:press:recentDm': {} 574 'share:press:embed': {} 575 576 'thread:click:showOtherReplies': {} 577 'thread:click:hideReplyForMe': {} 578 'thread:click:hideReplyForEveryone': {} 579 'thread:preferences:load': { 580 [key: string]: any 581 } 582 'thread:preferences:update': { 583 [key: string]: any 584 } 585 'thread:click:headerMenuOpen': {} 586 'thread:click:editOwnThreadgate': {} 587 'thread:click:viewSomeoneElsesThreadgate': {} 588 'activitySubscription:enable': { 589 setting: 'posts' | 'posts_and_replies' 590 } 591 'activitySubscription:disable': {} 592 'activityPreference:changeChannels': { 593 name: string 594 push: boolean 595 list: boolean 596 } 597 'activityPreference:changeFilter': { 598 name: string 599 value: string 600 } 601 602 'ageAssurance:navigateToSettings': {} 603 'ageAssurance:dismissFeedBanner': {} 604 'ageAssurance:dismissSettingsNotice': {} 605 'ageAssurance:initDialogOpen': { 606 hasInitiatedPreviously: boolean 607 } 608 'ageAssurance:initDialogSubmit': {} 609 'ageAssurance:api:begin': { 610 platform: string 611 countryCode: string 612 regionCode?: string 613 } 614 'ageAssurance:initDialogError': { 615 code: string 616 } 617 'ageAssurance:redirectDialogOpen': {} 618 'ageAssurance:redirectDialogSuccess': {} 619 'ageAssurance:redirectDialogFail': {} 620 'ageAssurance:appealDialogOpen': {} 621 'ageAssurance:appealDialogSubmit': {} 622 'ageAssurance:noAccessScreen:shown': { 623 accountCreatedAt: string 624 isAARegion: boolean 625 hasDeclaredAge: boolean 626 canUpdateBirthday: boolean 627 } 628 'ageAssurance:noAccessScreen:openBirthdateDialog': {} 629 630 /* 631 * Specifically for the `BlockedGeoOverlay` 632 */ 633 'blockedGeoOverlay:shown': {} 634 635 'geo:debug': {} 636 637 /* 638 * Find Contacts stuff 639 */ 640 641 // user presses the button on the new feature NUX 642 'contacts:nux:ctaPressed': {} 643 // user presses the banner NUX 644 'contacts:nux:bannerPressed': {} 645 // user dismisses the banner 646 'contacts:nux:bannerDismissed': {} 647 648 // user lands on the contacts step 649 'onboarding:contacts:presented': {} 650 // user pressed "Import Contacts" button to begin flow 651 'onboarding:contacts:begin': {} 652 // skips the step entirely 653 'onboarding:contacts:skipPressed': {} 654 // user shared their contacts 655 'onboarding:contacts:contactsShared': {} 656 // user leaves the matches page 657 'onboarding:contacts:nextPressed': { 658 matchCount: number 659 followCount: number 660 dismissedMatchCount: number 661 } 662 663 // user entered a number 664 'contacts:phone:phoneEntered': { 665 entryPoint: 'Onboarding' | 'Standalone' 666 } 667 // user entered the correct one-time-code 668 'contacts:phone:phoneVerified': { 669 entryPoint: 'Onboarding' | 'Standalone' 670 } 671 // user responded to the contacts permission prompt 672 'contacts:permission:request': { 673 status: 'granted' | 'denied' 674 accessLevelIOS?: 'all' | 'limited' | 'none' 675 } 676 // contacts were successfully imported and matched 677 'contacts:import:success': { 678 contactCount: number 679 matchCount: number 680 entryPoint: 'Onboarding' | 'Standalone' 681 } 682 // contacts import failed 683 'contacts:import:failure': { 684 reason: 'noValidNumbers' | 'networkError' | 'unknown' 685 entryPoint: 'Onboarding' | 'Standalone' 686 } 687 // user followed a single match 688 'contacts:matches:follow': { 689 entryPoint: 'Onboarding' | 'Standalone' 690 } 691 // user pressed "Follow All" on matches 692 'contacts:matches:followAll': { 693 followCount: number 694 entryPoint: 'Onboarding' | 'Standalone' 695 } 696 // user dismissed a match 697 'contacts:matches:dismiss': { 698 entryPoint: 'Onboarding' | 'Standalone' 699 } 700 // user pressed invite to send an SMS to a non-match 701 'contacts:matches:invite': { 702 entryPoint: 'Onboarding' | 'Standalone' 703 } 704 // user opened the Find Contacts settings screen 705 'contacts:settings:presented': { 706 hasPreviouslySynced: boolean 707 matchCount?: number 708 } 709 // user followed a single match from settings 710 'contacts:settings:follow': {} 711 // user pressed "Follow All" from settings 712 'contacts:settings:followAll': { 713 followCount: number 714 } 715 // user dismissed a match from settings 716 'contacts:settings:dismiss': {} 717 // user re-entered the flow via the resync button 718 'contacts:settings:resync': { 719 daysSinceLastSync: number 720 } 721 // user pressed the remove all data button 722 'contacts:settings:removeData': {} 723}