From 39c3d0647ef406e8c8decac33439aeafeb370974 Mon Sep 17 00:00:00 2001 From: vineyardbovines Date: Wed, 4 Mar 2026 11:19:31 -0500 Subject: [PATCH] events --- bskyembed/src/components/post.tsx | 10 +++++++++ bskyembed/src/icons/Robot.tsx | 22 +++++++++++++++++++ src/analytics/metrics/types.ts | 3 +++ src/components/BotBadge.tsx | 3 +++ .../Settings/AutomationLabelSettings.tsx | 3 +++ 5 files changed, 41 insertions(+) create mode 100644 bskyembed/src/icons/Robot.tsx diff --git a/bskyembed/src/components/post.tsx b/bskyembed/src/components/post.tsx index be3350485d..fb32250464 100644 --- a/bskyembed/src/components/post.tsx +++ b/bskyembed/src/components/post.tsx @@ -10,6 +10,7 @@ import logo from '../../assets/logo_full_name.svg' import {Like as LikeIcon} from '../icons/Like' import {Reply as ReplyIcon} from '../icons/Reply' import {Repost as RepostIcon} from '../icons/Repost' +import {Robot as RobotIcon} from '../icons/Robot' import {CONTENT_LABELS} from '../labels' import * as bsky from '../types/bsky' import {niceDate} from '../util/nice-date' @@ -43,6 +44,9 @@ export function Post({thread}: Props) { } const verification = getVerificationState({profile: post.author}) + const isBot = post.author.labels?.some( + l => l.val === 'bot' && l.src === post.author.did, + ) const href = `/profile/${post.author.did}/post/${getRkey(post)}` @@ -76,6 +80,12 @@ export function Post({thread}: Props) { size={15} /> )} + {isBot && ( + + )} ( + + + +) diff --git a/src/analytics/metrics/types.ts b/src/analytics/metrics/types.ts index 28c3150c26..d3d5d88f92 100644 --- a/src/analytics/metrics/types.ts +++ b/src/analytics/metrics/types.ts @@ -732,6 +732,9 @@ export type Events = { 'verification:settings:hideBadges': {} 'verification:settings:unHideBadges': {} + 'bot:label:toggle': {state: 'add' | 'remove'} + 'bot:badge:click': {} + 'live:create': {duration: number} 'live:edit': {} 'live:remove': {} diff --git a/src/components/BotBadge.tsx b/src/components/BotBadge.tsx index ae2ac1c6d8..80b84559f6 100644 --- a/src/components/BotBadge.tsx +++ b/src/components/BotBadge.tsx @@ -3,6 +3,7 @@ import {type ComAtprotoLabelDefs} from '@atproto/api' import {msg} from '@lingui/core/macro' import {useLingui} from '@lingui/react' +import {useAnalytics} from '#/analytics' import {isBotAccount} from '#/lib/bots' import {atoms as a, useBreakpoints, useTheme} from '#/alf' import {BotAccountInfoDialog} from '#/components/BotAccountInfoDialog' @@ -40,6 +41,7 @@ export function BotBadgeButton({ size: 'lg' | 'md' | 'sm' }) { const t = useTheme() + const ax = useAnalytics() const {_} = useLingui() const {gtPhone} = useBreakpoints() const control = useDialogControl() @@ -62,6 +64,7 @@ export function BotBadgeButton({ hitSlop={20} onPress={evt => { evt.preventDefault() + ax.metric('bot:badge:click', {}) control.open() }}> {({hovered}) => ( diff --git a/src/screens/Settings/AutomationLabelSettings.tsx b/src/screens/Settings/AutomationLabelSettings.tsx index 806e731a19..89ec0ac273 100644 --- a/src/screens/Settings/AutomationLabelSettings.tsx +++ b/src/screens/Settings/AutomationLabelSettings.tsx @@ -6,6 +6,7 @@ import {useLingui} from '@lingui/react' import {Trans} from '@lingui/react/macro' import {type NativeStackScreenProps} from '@react-navigation/native-stack' +import {useAnalytics} from '#/analytics' import {type CommonNavigatorParams} from '#/lib/routes/types' import { useProfileQuery, @@ -29,6 +30,7 @@ type Props = NativeStackScreenProps< > export function AutomationLabelSettingsScreen({}: Props) { const t = useTheme() + const ax = useAnalytics() const {_} = useLingui() const {currentAccount} = useSession() const {data: profile} = useProfileQuery({did: currentAccount?.did}) @@ -45,6 +47,7 @@ export function AutomationLabelSettingsScreen({}: Props) { return } let wasAdded = false + ax.metric('bot:label:toggle', {state: isBotLabeled ? 'remove' : 'add'}) updateProfile.mutate({ profile, updates: existing => {