Compare commits

...

4 Commits

Author SHA1 Message Date
Eric Bailey fb15fbad46 Merge remote-tracking branch 'origin/main' into hailey/mod-metrics
* origin/main: (108 commits)
  tweak ci (#7916)
  Merge #7903 (#7917)
  fixing moderation blur gap when replying via the thread feed (#7783)
  fix cancel button on search posts screen (#7912)
  Add context for toast messages (#7902)
  Filter searchable people list by accepted (#7915)
  Nightly source-language update
  Add report dialog e2e tests (#7913)
  ota helper in dev mode (#7911)
  Add language: Esperanto (#7863)
  Add language: Scottish Gaelic (#7864)
  Add language: Welsh (#7866)
  Add initial test for post report flow
  mark label for translation (#7908)
  skeletons for chat list (#7907)
  fix layout shift in profile feed header (#7906)
  Add dark mode option to in-app embed snippet dialog (#7377)
  enhance(embed): add ability to pin color mode (#7186)
  Nightly source-language update
  use latest macos/xcode (#7893)
  ...
2025-03-06 13:57:28 -06:00
Hailey 1f6a7d3e9a Update src/screens/Profile/Header/ProfileHeaderLabeler.tsx 2025-02-14 13:55:04 -08:00
Hailey 3e7a679eaf add label pref switch metric 2025-02-14 12:16:19 -08:00
Hailey ed67b6b6a3 add some metrics 2025-02-14 11:56:24 -08:00
4 changed files with 37 additions and 0 deletions
+13
View File
@@ -306,6 +306,19 @@ export type MetricEvents = {
'progressGuide:hide': {}
'progressGuide:followDialog:open': {}
'moderation:subscribedToLabeler': {}
'moderation:unsubscribedFromLabeler': {}
'moderation:changeLabelPreference': {
preference: string
}
'moderation:subscribedToList': {
type: 'mute' | 'block'
}
'moderation:unsubscribedFromList': {
type: 'mute' | 'block'
}
'reportDialog:open': {
subjectType: string
}
@@ -14,6 +14,7 @@ import {useLingui} from '@lingui/react'
import {MAX_LABELERS} from '#/lib/constants'
import {useHaptics} from '#/lib/haptics'
import {isAppLabeler} from '#/lib/moderation'
import {logEvent} from '#/lib/statsig/statsig'
import {logger} from '#/logger'
import {isIOS, isWeb} from '#/platform/detection'
import {useProfileShadow} from '#/state/cache/profile-shadow'
@@ -134,6 +135,7 @@ let ProfileHeaderLabeler = ({
const onPressSubscribe = React.useCallback(
() =>
requireAuth(async (): Promise<void> => {
const willSubscribe = !isSubscribed
try {
await toggleSubscription({
did: profile.did,
@@ -146,6 +148,13 @@ let ProfileHeaderLabeler = ({
return
}
logger.error(`Failed to subscribe to labeler`, {message: e.message})
return
}
if (willSubscribe) {
logEvent('moderation:subscribedToLabeler', {})
} else {
logEvent('moderation:unsubscribedFromLabeler', {})
}
}),
[
+2
View File
@@ -7,6 +7,7 @@ import {useMutation, useQuery, useQueryClient} from '@tanstack/react-query'
import {PROD_DEFAULT_FEED} from '#/lib/constants'
import {replaceEqualDeep} from '#/lib/functions'
import {logEvent} from '#/lib/statsig/statsig'
import {getAge} from '#/lib/strings/time'
import {STALE} from '#/state/queries'
import {
@@ -96,6 +97,7 @@ export function usePreferencesSetContentLabelMutation() {
>({
mutationFn: async ({label, visibility, labelerDid}) => {
await agent.setContentLabelPref(label, visibility, labelerDid)
logEvent('moderation:changeLabelPreference', {preference: visibility})
// triggers a refetch
await queryClient.invalidateQueries({
queryKey: preferencesQueryKey,
+13
View File
@@ -24,6 +24,7 @@ import {makeListLink} from '#/lib/routes/links'
import {CommonNavigatorParams, NativeStackScreenProps} from '#/lib/routes/types'
import {NavigationProp} from '#/lib/routes/types'
import {shareUrl} from '#/lib/sharing'
import {logEvent} from '#/lib/statsig/statsig'
import {cleanError} from '#/lib/strings/errors'
import {toShareUrl} from '#/lib/strings/url-helpers'
import {s} from '#/lib/styles'
@@ -399,7 +400,10 @@ function Header({
msg`There was an issue. Please check your internet connection and try again.`,
),
)
return
}
Toast.show(_(msg`List muted`))
logEvent('moderation:subscribedToList', {type: 'mute'})
}, [list, listMuteMutation, _])
const onUnsubscribeMute = useCallback(async () => {
@@ -412,7 +416,10 @@ function Header({
msg`There was an issue. Please check your internet connection and try again.`,
),
)
return
}
Toast.show(_(msg`List unmuted`))
logEvent('moderation:unsubscribedFromList', {type: 'mute'})
}, [list, listMuteMutation, _])
const onSubscribeBlock = useCallback(async () => {
@@ -425,7 +432,10 @@ function Header({
msg`There was an issue. Please check your internet connection and try again.`,
),
)
return
}
Toast.show(_(msg`List blocked`))
logEvent('moderation:subscribedToList', {type: 'block'})
}, [list, listBlockMutation, _])
const onUnsubscribeBlock = useCallback(async () => {
@@ -438,7 +448,10 @@ function Header({
msg`There was an issue. Please check your internet connection and try again.`,
),
)
return
}
Toast.show(_(msg`List unblocked`))
logEvent('moderation:unsubscribedFromList', {type: 'block'})
}, [list, listBlockMutation, _])
const onPressEdit = useCallback(() => {