Rename moderation link in settings to "Moderation and content filters" (#10192)

This commit is contained in:
Samuel Newman
2026-04-10 09:50:30 -07:00
committed by GitHub
parent ff68e4036d
commit 2c717dc1e7
+49 -55
View File
@@ -2,9 +2,7 @@ import {useState} from 'react'
import {Alert, LayoutAnimation, Linking, Pressable, View} from 'react-native' import {Alert, LayoutAnimation, Linking, Pressable, View} from 'react-native'
import {useReducedMotion} from 'react-native-reanimated' import {useReducedMotion} from 'react-native-reanimated'
import {type AppBskyActorDefs, moderateProfile} from '@atproto/api' import {type AppBskyActorDefs, moderateProfile} from '@atproto/api'
import {msg} from '@lingui/core/macro' import {Trans, useLingui} from '@lingui/react/macro'
import {useLingui} from '@lingui/react'
import {Trans} from '@lingui/react/macro'
import {useNavigation} from '@react-navigation/native' import {useNavigation} from '@react-navigation/native'
import {type NativeStackScreenProps} from '@react-navigation/native-stack' import {type NativeStackScreenProps} from '@react-navigation/native-stack'
@@ -73,7 +71,7 @@ import {useActivitySubscriptionsNudged} from '#/storage/hooks/activity-subscript
type Props = NativeStackScreenProps<CommonNavigatorParams, 'Settings'> type Props = NativeStackScreenProps<CommonNavigatorParams, 'Settings'>
export function SettingsScreen({}: Props) { export function SettingsScreen({}: Props) {
const ax = useAnalytics() const ax = useAnalytics()
const {_} = useLingui() const {t: l} = useLingui()
const reducedMotion = useReducedMotion() const reducedMotion = useReducedMotion()
const {logoutEveryAccount} = useSessionApi() const {logoutEveryAccount} = useSessionApi()
const {accounts, currentAccount} = useSession() const {accounts, currentAccount} = useSession()
@@ -121,10 +119,8 @@ export function SettingsScreen({}: Props) {
{accounts.length > 1 ? ( {accounts.length > 1 ? (
<> <>
<SettingsList.PressableItem <SettingsList.PressableItem
label={_(msg`Switch account`)} label={l`Switch account`}
accessibilityHint={_( accessibilityHint={l`Shows other accounts you can switch to`}
msg`Shows other accounts you can switch to`,
)}
onPress={() => { onPress={() => {
if (!reducedMotion) { if (!reducedMotion) {
LayoutAnimation.configureNext( LayoutAnimation.configureNext(
@@ -174,7 +170,7 @@ export function SettingsScreen({}: Props) {
<AddAccountRow /> <AddAccountRow />
)} )}
<SettingsList.Divider /> <SettingsList.Divider />
<SettingsList.LinkItem to="/settings/account" label={_(msg`Account`)}> <SettingsList.LinkItem to="/settings/account" label={l`Account`}>
<SettingsList.ItemIcon icon={PersonIcon} /> <SettingsList.ItemIcon icon={PersonIcon} />
<SettingsList.ItemText> <SettingsList.ItemText>
<Trans>Account</Trans> <Trans>Account</Trans>
@@ -182,21 +178,23 @@ export function SettingsScreen({}: Props) {
</SettingsList.LinkItem> </SettingsList.LinkItem>
<SettingsList.LinkItem <SettingsList.LinkItem
to="/settings/privacy-and-security" to="/settings/privacy-and-security"
label={_(msg`Privacy and security`)}> label={l`Privacy and security`}>
<SettingsList.ItemIcon icon={LockIcon} /> <SettingsList.ItemIcon icon={LockIcon} />
<SettingsList.ItemText> <SettingsList.ItemText>
<Trans>Privacy and security</Trans> <Trans>Privacy and security</Trans>
</SettingsList.ItemText> </SettingsList.ItemText>
</SettingsList.LinkItem> </SettingsList.LinkItem>
<SettingsList.LinkItem to="/moderation" label={_(msg`Moderation`)}> <SettingsList.LinkItem
to="/moderation"
label={l`Moderation and content filters`}>
<SettingsList.ItemIcon icon={HandIcon} /> <SettingsList.ItemIcon icon={HandIcon} />
<SettingsList.ItemText> <SettingsList.ItemText>
<Trans>Moderation</Trans> <Trans>Moderation and content filters</Trans>
</SettingsList.ItemText> </SettingsList.ItemText>
</SettingsList.LinkItem> </SettingsList.LinkItem>
<SettingsList.LinkItem <SettingsList.LinkItem
to="/settings/notifications" to="/settings/notifications"
label={_(msg`Notifications`)}> label={l`Notifications`}>
<SettingsList.ItemIcon icon={NotificationIcon} /> <SettingsList.ItemIcon icon={NotificationIcon} />
<SettingsList.ItemText> <SettingsList.ItemText>
<Trans>Notifications</Trans> <Trans>Notifications</Trans>
@@ -204,7 +202,7 @@ export function SettingsScreen({}: Props) {
</SettingsList.LinkItem> </SettingsList.LinkItem>
<SettingsList.LinkItem <SettingsList.LinkItem
to="/settings/content-and-media" to="/settings/content-and-media"
label={_(msg`Content and media`)}> label={l`Content and media`}>
<SettingsList.ItemIcon icon={WindowIcon} /> <SettingsList.ItemIcon icon={WindowIcon} />
<SettingsList.ItemText> <SettingsList.ItemText>
<Trans>Content and media</Trans> <Trans>Content and media</Trans>
@@ -215,7 +213,7 @@ export function SettingsScreen({}: Props) {
!ax.features.enabled(ax.features.ImportContactsSettingsDisable) && ( !ax.features.enabled(ax.features.ImportContactsSettingsDisable) && (
<SettingsList.LinkItem <SettingsList.LinkItem
to="/settings/find-contacts" to="/settings/find-contacts"
label={_(msg`Find friends from contacts`)}> label={l`Find friends from contacts`}>
<SettingsList.ItemIcon icon={ContactsIcon} /> <SettingsList.ItemIcon icon={ContactsIcon} />
<SettingsList.ItemText> <SettingsList.ItemText>
<Trans>Find friends from contacts</Trans> <Trans>Find friends from contacts</Trans>
@@ -224,7 +222,7 @@ export function SettingsScreen({}: Props) {
)} )}
<SettingsList.LinkItem <SettingsList.LinkItem
to="/settings/appearance" to="/settings/appearance"
label={_(msg`Appearance`)}> label={l`Appearance`}>
<SettingsList.ItemIcon icon={PaintRollerIcon} /> <SettingsList.ItemIcon icon={PaintRollerIcon} />
<SettingsList.ItemText> <SettingsList.ItemText>
<Trans>Appearance</Trans> <Trans>Appearance</Trans>
@@ -232,15 +230,13 @@ export function SettingsScreen({}: Props) {
</SettingsList.LinkItem> </SettingsList.LinkItem>
<SettingsList.LinkItem <SettingsList.LinkItem
to="/settings/accessibility" to="/settings/accessibility"
label={_(msg`Accessibility`)}> label={l`Accessibility`}>
<SettingsList.ItemIcon icon={AccessibilityIcon} /> <SettingsList.ItemIcon icon={AccessibilityIcon} />
<SettingsList.ItemText> <SettingsList.ItemText>
<Trans>Accessibility</Trans> <Trans>Accessibility</Trans>
</SettingsList.ItemText> </SettingsList.ItemText>
</SettingsList.LinkItem> </SettingsList.LinkItem>
<SettingsList.LinkItem <SettingsList.LinkItem to="/settings/language" label={l`Languages`}>
to="/settings/language"
label={_(msg`Languages`)}>
<SettingsList.ItemIcon icon={EarthIcon} /> <SettingsList.ItemIcon icon={EarthIcon} />
<SettingsList.ItemText> <SettingsList.ItemText>
<Trans>Languages</Trans> <Trans>Languages</Trans>
@@ -248,15 +244,15 @@ export function SettingsScreen({}: Props) {
</SettingsList.LinkItem> </SettingsList.LinkItem>
<SettingsList.PressableItem <SettingsList.PressableItem
onPress={() => void Linking.openURL(HELP_DESK_URL)} onPress={() => void Linking.openURL(HELP_DESK_URL)}
label={_(msg`Help`)} label={l`Help`}
accessibilityHint={_(msg`Opens helpdesk in browser`)}> accessibilityHint={l`Opens helpdesk in browser`}>
<SettingsList.ItemIcon icon={CircleQuestionIcon} /> <SettingsList.ItemIcon icon={CircleQuestionIcon} />
<SettingsList.ItemText> <SettingsList.ItemText>
<Trans>Help</Trans> <Trans>Help</Trans>
</SettingsList.ItemText> </SettingsList.ItemText>
<SettingsList.Chevron /> <SettingsList.Chevron />
</SettingsList.PressableItem> </SettingsList.PressableItem>
<SettingsList.LinkItem to="/settings/about" label={_(msg`About`)}> <SettingsList.LinkItem to="/settings/about" label={l`About`}>
<SettingsList.ItemIcon icon={BubbleInfoIcon} /> <SettingsList.ItemIcon icon={BubbleInfoIcon} />
<SettingsList.ItemText> <SettingsList.ItemText>
<Trans>About</Trans> <Trans>About</Trans>
@@ -266,7 +262,7 @@ export function SettingsScreen({}: Props) {
<SettingsList.PressableItem <SettingsList.PressableItem
destructive destructive
onPress={() => signOutPromptControl.open()} onPress={() => signOutPromptControl.open()}
label={_(msg`Sign out`)}> label={l`Sign out`}>
<SettingsList.ItemText> <SettingsList.ItemText>
<Trans>Sign out</Trans> <Trans>Sign out</Trans>
</SettingsList.ItemText> </SettingsList.ItemText>
@@ -283,7 +279,7 @@ export function SettingsScreen({}: Props) {
} }
setShowDevOptions(d => !d) setShowDevOptions(d => !d)
}} }}
label={_(msg`Developer options`)}> label={l`Developer options`}>
<SettingsList.ItemIcon icon={CodeBracketsIcon} /> <SettingsList.ItemIcon icon={CodeBracketsIcon} />
<SettingsList.ItemText> <SettingsList.ItemText>
<Trans>Developer options</Trans> <Trans>Developer options</Trans>
@@ -297,11 +293,11 @@ export function SettingsScreen({}: Props) {
<Prompt.Basic <Prompt.Basic
control={signOutPromptControl} control={signOutPromptControl}
title={_(msg`Sign out?`)} title={l`Sign out?`}
description={_(msg`You will be signed out of all your accounts.`)} description={l`You will be signed out of all your accounts.`}
onConfirm={() => logoutEveryAccount('Settings')} onConfirm={() => logoutEveryAccount('Settings')}
confirmButtonCta={_(msg`Sign out`)} confirmButtonCta={l`Sign out`}
cancelButtonCta={_(msg`Cancel`)} cancelButtonCta={l`Cancel`}
confirmButtonColor="negative" confirmButtonColor="negative"
/> />
@@ -378,7 +374,7 @@ function ProfilePreview({
} }
function DevOptions() { function DevOptions() {
const {_} = useLingui() const {t: l} = useLingui()
const agent = useAgent() const agent = useAgent()
const [override, setOverride] = useStorage(device, [ const [override, setOverride] = useStorage(device, [
'policyUpdateDebugOverride', 'policyUpdateDebugOverride',
@@ -397,12 +393,12 @@ function DevOptions() {
const resetOnboarding = () => { const resetOnboarding = () => {
navigation.navigate('Home') navigation.navigate('Home')
onboardingDispatch({type: 'start'}) onboardingDispatch({type: 'start'})
Toast.show(_(msg`Onboarding reset`)) Toast.show(l`Onboarding reset`)
} }
const clearAllStorage = async () => { const clearAllStorage = async () => {
await clearStorage() await clearStorage()
Toast.show(_(msg`Storage cleared, you need to restart the app now.`)) Toast.show(l`Storage cleared, you need to restart the app now.`)
} }
const onPressUnsnoozeReminder = () => { const onPressUnsnoozeReminder = () => {
@@ -413,7 +409,7 @@ function DevOptions() {
...persisted.get('reminders'), ...persisted.get('reminders'),
lastEmailConfirm: lastEmailConfirm.toISOString(), lastEmailConfirm: lastEmailConfirm.toISOString(),
}) })
Toast.show(_(msg`You probably want to restart the app now.`)) Toast.show(l`You probably want to restart the app now.`)
} }
const onPressActySubsUnNudge = () => { const onPressActySubsUnNudge = () => {
@@ -448,42 +444,42 @@ function DevOptions() {
<> <>
<SettingsList.PressableItem <SettingsList.PressableItem
onPress={() => navigation.navigate('Log')} onPress={() => navigation.navigate('Log')}
label={_(msg`Open system log`)}> label={l`Open system log`}>
<SettingsList.ItemText> <SettingsList.ItemText>
<Trans>System log</Trans> <Trans>System log</Trans>
</SettingsList.ItemText> </SettingsList.ItemText>
</SettingsList.PressableItem> </SettingsList.PressableItem>
<SettingsList.PressableItem <SettingsList.PressableItem
onPress={() => navigation.navigate('Debug')} onPress={() => navigation.navigate('Debug')}
label={_(msg`Open storybook page`)}> label={l`Open storybook page`}>
<SettingsList.ItemText> <SettingsList.ItemText>
<Trans>Storybook</Trans> <Trans>Storybook</Trans>
</SettingsList.ItemText> </SettingsList.ItemText>
</SettingsList.PressableItem> </SettingsList.PressableItem>
<SettingsList.PressableItem <SettingsList.PressableItem
onPress={() => navigation.navigate('DebugMod')} onPress={() => navigation.navigate('DebugMod')}
label={_(msg`Open moderation debug page`)}> label={l`Open moderation debug page`}>
<SettingsList.ItemText> <SettingsList.ItemText>
<Trans>Debug Moderation</Trans> <Trans>Debug Moderation</Trans>
</SettingsList.ItemText> </SettingsList.ItemText>
</SettingsList.PressableItem> </SettingsList.PressableItem>
<SettingsList.PressableItem <SettingsList.PressableItem
onPress={() => deleteChatDeclarationRecord()} onPress={() => deleteChatDeclarationRecord()}
label={_(msg`Open storybook page`)}> label={l`Open storybook page`}>
<SettingsList.ItemText> <SettingsList.ItemText>
<Trans>Delete chat declaration record</Trans> <Trans>Delete chat declaration record</Trans>
</SettingsList.ItemText> </SettingsList.ItemText>
</SettingsList.PressableItem> </SettingsList.PressableItem>
<SettingsList.PressableItem <SettingsList.PressableItem
onPress={() => void resetOnboarding()} onPress={() => void resetOnboarding()}
label={_(msg`Reset onboarding state`)}> label={l`Reset onboarding state`}>
<SettingsList.ItemText> <SettingsList.ItemText>
<Trans>Reset onboarding state</Trans> <Trans>Reset onboarding state</Trans>
</SettingsList.ItemText> </SettingsList.ItemText>
</SettingsList.PressableItem> </SettingsList.PressableItem>
<SettingsList.PressableItem <SettingsList.PressableItem
onPress={onPressUnsnoozeReminder} onPress={onPressUnsnoozeReminder}
label={_(msg`Unsnooze email reminder`)}> label={l`Unsnooze email reminder`}>
<SettingsList.ItemText> <SettingsList.ItemText>
<Trans>Unsnooze email reminder</Trans> <Trans>Unsnooze email reminder</Trans>
</SettingsList.ItemText> </SettingsList.ItemText>
@@ -491,7 +487,7 @@ function DevOptions() {
{actyNotifNudged && ( {actyNotifNudged && (
<SettingsList.PressableItem <SettingsList.PressableItem
onPress={onPressActySubsUnNudge} onPress={onPressActySubsUnNudge}
label={_(msg`Reset activity subscription nudge`)}> label={l`Reset activity subscription nudge`}>
<SettingsList.ItemText> <SettingsList.ItemText>
<Trans>Reset activity subscription nudge</Trans> <Trans>Reset activity subscription nudge</Trans>
</SettingsList.ItemText> </SettingsList.ItemText>
@@ -499,7 +495,7 @@ function DevOptions() {
)} )}
<SettingsList.PressableItem <SettingsList.PressableItem
onPress={() => void clearAllStorage()} onPress={() => void clearAllStorage()}
label={_(msg`Clear all storage data`)}> label={l`Clear all storage data`}>
<SettingsList.ItemText> <SettingsList.ItemText>
<Trans>Clear all storage data (restart after this)</Trans> <Trans>Clear all storage data (restart after this)</Trans>
</SettingsList.ItemText> </SettingsList.ItemText>
@@ -507,7 +503,7 @@ function DevOptions() {
{IS_IOS ? ( {IS_IOS ? (
<SettingsList.PressableItem <SettingsList.PressableItem
onPress={onPressApplyOta} onPress={onPressApplyOta}
label={_(msg`Apply Pull Request`)}> label={l`Apply Pull Request`}>
<SettingsList.ItemText> <SettingsList.ItemText>
<Trans>Apply Pull Request</Trans> <Trans>Apply Pull Request</Trans>
</SettingsList.ItemText> </SettingsList.ItemText>
@@ -516,7 +512,7 @@ function DevOptions() {
{IS_NATIVE && isCurrentlyRunningPullRequestDeployment ? ( {IS_NATIVE && isCurrentlyRunningPullRequestDeployment ? (
<SettingsList.PressableItem <SettingsList.PressableItem
onPress={() => void revertToEmbedded()} onPress={() => void revertToEmbedded()}
label={_(msg`Unapply Pull Request`)}> label={l`Unapply Pull Request`}>
<SettingsList.ItemText> <SettingsList.ItemText>
<Trans>Unapply Pull Request {currentChannel}</Trans> <Trans>Unapply Pull Request {currentChannel}</Trans>
</SettingsList.ItemText> </SettingsList.ItemText>
@@ -564,7 +560,7 @@ function DevOptions() {
} }
function AddAccountRow() { function AddAccountRow() {
const {_} = useLingui() const {t: l} = useLingui()
const {setShowLoggedOut} = useLoggedOutViewControls() const {setShowLoggedOut} = useLoggedOutViewControls()
const closeEverything = useCloseAllActiveElements() const closeEverything = useCloseAllActiveElements()
@@ -576,7 +572,7 @@ function AddAccountRow() {
return ( return (
<SettingsList.PressableItem <SettingsList.PressableItem
onPress={onAddAnotherAccount} onPress={onAddAnotherAccount}
label={_(msg`Add another account`)}> label={l`Add another account`}>
<SettingsList.ItemIcon icon={PersonPlusIcon} /> <SettingsList.ItemIcon icon={PersonPlusIcon} />
<SettingsList.ItemText> <SettingsList.ItemText>
<Trans>Add another account</Trans> <Trans>Add another account</Trans>
@@ -599,7 +595,7 @@ function AccountRow({
logContext: 'Settings', logContext: 'Settings',
) => void ) => void
}) { }) {
const {_} = useLingui() const {t: l} = useLingui()
const t = useTheme() const t = useTheme()
const moderationOpts = useModerationOpts() const moderationOpts = useModerationOpts()
@@ -616,7 +612,7 @@ function AccountRow({
<View style={[a.relative]}> <View style={[a.relative]}>
<SettingsList.PressableItem <SettingsList.PressableItem
onPress={onSwitchAccount} onPress={onSwitchAccount}
label={_(msg`Switch account`)}> label={l`Switch account`}>
{moderationOpts && profile ? ( {moderationOpts && profile ? (
<UserAvatar <UserAvatar
size={28} size={28}
@@ -638,7 +634,7 @@ function AccountRow({
</SettingsList.PressableItem> </SettingsList.PressableItem>
{!pendingDid && ( {!pendingDid && (
<Menu.Root> <Menu.Root>
<Menu.Trigger label={_(msg`Account options`)}> <Menu.Trigger label={l`Account options`}>
{({props, state}) => ( {({props, state}) => (
<Pressable <Pressable
{...props} {...props}
@@ -655,7 +651,7 @@ function AccountRow({
</Menu.Trigger> </Menu.Trigger>
<Menu.Outer showCancel> <Menu.Outer showCancel>
<Menu.Item <Menu.Item
label={_(msg`Remove account`)} label={l`Remove account`}
onPress={() => removePromptControl.open()}> onPress={() => removePromptControl.open()}>
<Menu.ItemText> <Menu.ItemText>
<Trans>Remove account</Trans> <Trans>Remove account</Trans>
@@ -668,15 +664,13 @@ function AccountRow({
<Prompt.Basic <Prompt.Basic
control={removePromptControl} control={removePromptControl}
title={_(msg`Remove from quick access?`)} title={l`Remove from quick access?`}
description={_( description={l`This will remove @${account.handle} from the quick access list.`}
msg`This will remove @${account.handle} from the quick access list.`,
)}
onConfirm={() => { onConfirm={() => {
removeAccount(account) removeAccount(account)
Toast.show(_(msg`Account removed from quick access`)) Toast.show(l`Account removed from quick access`)
}} }}
confirmButtonCta={_(msg`Remove`)} confirmButtonCta={l`Remove`}
confirmButtonColor="negative" confirmButtonColor="negative"
/> />
</View> </View>