From b3235e5afd2760506b72b181e3ef2ed08e208c99 Mon Sep 17 00:00:00 2001 From: "xan.lol" Date: Sat, 25 Apr 2026 02:29:55 -0700 Subject: [PATCH] refactor: Runes settings and replace Other Additions with Extra - updated toggles in Appearance, Display, Extra, and Impressions settings to use (updated) icons - update custom post phrase dialog inputs to use defaultValue so editing is easier - move around some settings - automatically reload the app when toggling the declaration of default app labelers --- src/Navigation.tsx | 8 +- src/lib/routes/types.ts | 2 +- src/routes.ts | 2 +- src/screens/Settings/AppearanceSettings.tsx | 78 ++++--- .../Settings/RunesSettings/BadgesSettings.tsx | 34 ++-- .../RunesSettings/DisplaySettings.tsx | 33 ++- ...dditionsSettings.tsx => ExtraSettings.tsx} | 95 +++++---- .../RunesSettings/ImpressionsSettings.tsx | 29 +-- .../RunesSettings/InfrastructureSettings.tsx | 2 +- .../RunesSettings/UsabilitySettings.tsx | 191 ++++++++++-------- src/screens/Settings/RunesSettings/index.tsx | 6 +- src/state/preferences/no-app-labelers.tsx | 8 + 12 files changed, 261 insertions(+), 227 deletions(-) rename src/screens/Settings/RunesSettings/{OtherAdditionsSettings.tsx => ExtraSettings.tsx} (51%) diff --git a/src/Navigation.tsx b/src/Navigation.tsx index 3f127d751..7587cf34c 100644 --- a/src/Navigation.tsx +++ b/src/Navigation.tsx @@ -131,10 +131,10 @@ import {PrivacyAndSecuritySettingsScreen} from '#/screens/Settings/PrivacyAndSec import {RunesSettingsScreen} from '#/screens/Settings/RunesSettings' import {RunesBadgesSettingsScreen} from '#/screens/Settings/RunesSettings/BadgesSettings' import {RunesDisplaySettingsScreen} from '#/screens/Settings/RunesSettings/DisplaySettings' +import {RunesExtraSettingsScreen} from '#/screens/Settings/RunesSettings/ExtraSettings' import {RunesImpressionsSettingsScreen} from '#/screens/Settings/RunesSettings/ImpressionsSettings' import {RunesInfrastructureSettingsScreen} from '#/screens/Settings/RunesSettings/InfrastructureSettings' import {RunesMenusSettingsScreen} from '#/screens/Settings/RunesSettings/MenusSettings' -import {RunesOtherAdditionsSettingsScreen} from '#/screens/Settings/RunesSettings/OtherAdditionsSettings' import {RunesUsabilitySettingsScreen} from '#/screens/Settings/RunesSettings/UsabilitySettings' import {SettingsScreen} from '#/screens/Settings/Settings' import {ThreadPreferencesScreen} from '#/screens/Settings/ThreadPreferences' @@ -463,9 +463,9 @@ function commonScreens(Stack: typeof Flat, unreadCountLabel?: string) { options={{title: title(msg`Infrastructure`), requireAuth: true}} /> RunesOtherAdditionsSettingsScreen} - options={{title: title(msg`Other additions`), requireAuth: true}} + name="RunesExtraSettings" + getComponent={() => RunesExtraSettingsScreen} + options={{title: title(msg`Extra settings`), requireAuth: true}} /> ({ RunesUsabilitySettings: '/settings/runes/usability', RunesDisplaySettings: '/settings/runes/display', RunesInfrastructureSettings: '/settings/runes/infrastructure', - RunesOtherAdditionsSettings: '/settings/runes/other-additions', + RunesExtraSettings: '/settings/runes/extra', AppearanceSettings: '/settings/appearance', AppearanceColorThemeSettings: '/settings/appearance/color-theme', SavedFeeds: '/settings/saved-feeds', diff --git a/src/screens/Settings/AppearanceSettings.tsx b/src/screens/Settings/AppearanceSettings.tsx index 05b32647f..4149f5f5c 100644 --- a/src/screens/Settings/AppearanceSettings.tsx +++ b/src/screens/Settings/AppearanceSettings.tsx @@ -28,14 +28,15 @@ import {ItemTextWithSubtitle} from '#/screens/Settings/NotificationSettings/comp import {type Alf, atoms as a, native, useAlf, useTheme} from '#/alf' import * as SegmentedControl from '#/components/forms/SegmentedControl' import * as Toggle from '#/components/forms/Toggle' -import {Circle_And_Square_Stroke1_Corner0_Rounded_Filled as SquareIcon} from '#/components/icons/CircleAndSquare' import {ColorPalette_Stroke2_Corner0_Rounded as ColorPaletteIcon} from '#/components/icons/ColorPalette' import {type Props as SVGIconProps} from '#/components/icons/common' import {Moon_Stroke2_Corner0_Rounded as MoonIcon} from '#/components/icons/Moon' +import {Person_Stroke2_Corner0_Rounded as PersonIcon} from '#/components/icons/Person' import {Phone_Stroke2_Corner0_Rounded as PhoneIcon} from '#/components/icons/Phone' import {Sparkle_Stroke2_Corner0_Rounded as SparkleIcon} from '#/components/icons/Sparkle' import {TextSize_Stroke2_Corner0_Rounded as TextSize} from '#/components/icons/TextSize' import {TitleCase_Stroke2_Corner0_Rounded as Aa} from '#/components/icons/TitleCase' +import {Window_Stroke2_Corner2_Rounded as SquareIcon} from '#/components/icons/Window' import * as Layout from '#/components/Layout' import {Text} from '#/components/Typography' import {IS_ANDROID, IS_INTERNAL, IS_NATIVE} from '#/env' @@ -214,53 +215,46 @@ export function AppearanceSettingsScreen({}: Props) { - - - - Logo - - setKawaiiMode(value)} - style={[a.w_full]}> - + setKawaiiMode(value)}> + + + Enable kawaii logo - + - - - - - - - Shapes - - setEnableSquareAvatars(value)} - style={[a.w_full]}> - + + + setEnableSquareAvatars(value)}> + + + Enable square avatars - + - - - setEnableSquareButtons(value)} - style={[a.w_full]}> - + + + setEnableSquareButtons(value)}> + + + Enable square buttons - + - - + + + {IS_NATIVE && IS_INTERNAL && ( <> diff --git a/src/screens/Settings/RunesSettings/BadgesSettings.tsx b/src/screens/Settings/RunesSettings/BadgesSettings.tsx index bee2ea366..96e381886 100644 --- a/src/screens/Settings/RunesSettings/BadgesSettings.tsx +++ b/src/screens/Settings/RunesSettings/BadgesSettings.tsx @@ -51,27 +51,19 @@ export function RunesBadgesSettingsScreen() { return ( - - - - Verification - - setDeerVerificationEnabled(value)} - style={[a.w_full]}> - - - Select your own set of trusted verifiers, and operate as a - verifier - - + setDeerVerificationEnabled(value)}> + + + + Select trusted verifiers and act as one + - - - + + @@ -84,7 +76,6 @@ export function RunesBadgesSettingsScreen() { - @@ -128,7 +119,6 @@ export function RunesBadgesSettingsScreen() { )} - {pdsLabelEnabled && ( diff --git a/src/screens/Settings/RunesSettings/DisplaySettings.tsx b/src/screens/Settings/RunesSettings/DisplaySettings.tsx index 7d211419d..d2f904b76 100644 --- a/src/screens/Settings/RunesSettings/DisplaySettings.tsx +++ b/src/screens/Settings/RunesSettings/DisplaySettings.tsx @@ -107,6 +107,20 @@ function PostReplacementDialog({ const [singular, setSingular] = useState(postReplacement.postName) const [plural, setPlural] = useState(postReplacement.postsName) const [pluralManuallyEdited, setPluralManuallyEdited] = useState(false) + const [singularInputVersion, setSingularInputVersion] = useState(0) + const [pluralInputVersion, setPluralInputVersion] = useState(0) + + const syncInputValues = ( + nextSingular: string, + nextPlural: string, + manuallyEdited = false, + ) => { + setSingular(nextSingular) + setPlural(nextPlural) + setPluralManuallyEdited(manuallyEdited) + setSingularInputVersion(version => version + 1) + setPluralInputVersion(version => version + 1) + } const submit = async () => { setPostReplacement({ @@ -127,6 +141,7 @@ function PostReplacementDialog({ setSingular(value) if (!pluralManuallyEdited) { setPlural(`${value}s`) + setPluralInputVersion(version => version + 1) } } @@ -136,20 +151,16 @@ function PostReplacementDialog({ } const handlePresetSelect = (singularForm: string, pluralForm: string) => { - setSingular(singularForm) - setPlural(pluralForm) - setPluralManuallyEdited(false) + syncInputValues(singularForm, pluralForm) } return ( { - setSingular(postReplacement.postName) - setPlural(postReplacement.postsName) - setPluralManuallyEdited(false) - }}> + onClose={() => + syncInputValues(postReplacement.postName, postReplacement.postsName) + }> @@ -158,6 +169,7 @@ function PostReplacementDialog({ {[ @@ -190,13 +202,14 @@ function PostReplacementDialog({ ))} diff --git a/src/screens/Settings/RunesSettings/OtherAdditionsSettings.tsx b/src/screens/Settings/RunesSettings/ExtraSettings.tsx similarity index 51% rename from src/screens/Settings/RunesSettings/OtherAdditionsSettings.tsx rename to src/screens/Settings/RunesSettings/ExtraSettings.tsx index 6338ee191..fd156d71d 100644 --- a/src/screens/Settings/RunesSettings/OtherAdditionsSettings.tsx +++ b/src/screens/Settings/RunesSettings/ExtraSettings.tsx @@ -20,10 +20,13 @@ import * as SettingsList from '#/screens/Settings/components/SettingsList' import {atoms as a} from '#/alf' import {Admonition} from '#/components/Admonition' import * as Toggle from '#/components/forms/Toggle' +import {BellRinging_Stroke2_Corner0_Rounded as BellRingingIcon} from '#/components/icons/BellRinging' import {Eye_Stroke2_Corner0_Rounded as VisibilityIcon} from '#/components/icons/Eye' +import {LikeRepost_Stroke2_Corner2_Rounded as LikeRepostIcon} from '#/components/icons/Heart2' +import {Lab_Stroke2_Corner0_Rounded as BeakerIcon} from '#/components/icons/Lab' import {RunesScreenLayout} from './components/RunesScreenLayout' -export function RunesOtherAdditionsSettingsScreen() { +export function RunesExtraSettingsScreen() { const {t: l} = useLingui() const directFetchRecords = useDirectFetchRecords() @@ -39,66 +42,70 @@ export function RunesOtherAdditionsSettingsScreen() { const setDiscoverContextEnabled = useSetDiscoverContextEnabled() return ( - - - - - Extras - - setDirectFetchRecords(value)} - style={[a.w_full]}> - + + setDirectFetchRecords(value)}> + + + Fetch records directly from PDS to see contents of blocked and detached quotes - + - - setAutoLikeOnRepost(value)} - style={[a.w_full]}> - + + + setAutoLikeOnRepost(value)}> + + + Auto-like what you repost - + - - setDisableViaRepostNotification(value)} - style={[a.w_full]}> - + + + setDisableViaRepostNotification(value)}> + + + Disable via repost notifications - + - + + + Forcefully disables the notifications other people receive when you like/repost a post someone else has reposted for privacy. - setDiscoverContextEnabled(value)} - style={[a.w_full]}> - + + setDiscoverContextEnabled(value)}> + + + Show debug context for posts in Discover feed - + - - + + ) } diff --git a/src/screens/Settings/RunesSettings/ImpressionsSettings.tsx b/src/screens/Settings/RunesSettings/ImpressionsSettings.tsx index 7a90adac0..5c1c255ef 100644 --- a/src/screens/Settings/RunesSettings/ImpressionsSettings.tsx +++ b/src/screens/Settings/RunesSettings/ImpressionsSettings.tsx @@ -43,7 +43,8 @@ import { import * as SettingsList from '#/screens/Settings/components/SettingsList' import {atoms as a} from '#/alf' import * as Toggle from '#/components/forms/Toggle' -import {Eye_Stroke2_Corner0_Rounded as VisibilityIcon} from '#/components/icons/Eye' +import {Person_Stroke2_Corner0_Rounded as PersonIcon} from '#/components/icons/Person' +import {Reply as ReplyIcon} from '#/components/icons/Reply' import {RunesScreenLayout} from './components/RunesScreenLayout' export function RunesImpressionsSettingsScreen() { @@ -73,7 +74,7 @@ export function RunesImpressionsSettingsScreen() { return ( - + Posts @@ -134,7 +135,7 @@ export function RunesImpressionsSettingsScreen() { - + Profiles @@ -160,6 +161,17 @@ export function RunesImpressionsSettingsScreen() { + setDisablePostsMetrics(value)} + style={[a.w_full]}> + + Remove post counts + + + - setDisablePostsMetrics(value)} - style={[a.w_full]}> - - Remove post counts - - - ) diff --git a/src/screens/Settings/RunesSettings/InfrastructureSettings.tsx b/src/screens/Settings/RunesSettings/InfrastructureSettings.tsx index ec2706e03..678b05454 100644 --- a/src/screens/Settings/RunesSettings/InfrastructureSettings.tsx +++ b/src/screens/Settings/RunesSettings/InfrastructureSettings.tsx @@ -236,7 +236,7 @@ export function RunesInfrastructureSettingsScreen() { - Restart the app after changing this setting. + Toggling this will reload the app. diff --git a/src/screens/Settings/RunesSettings/UsabilitySettings.tsx b/src/screens/Settings/RunesSettings/UsabilitySettings.tsx index e2204d1a3..630aff249 100644 --- a/src/screens/Settings/RunesSettings/UsabilitySettings.tsx +++ b/src/screens/Settings/RunesSettings/UsabilitySettings.tsx @@ -33,7 +33,14 @@ import * as SettingsList from '#/screens/Settings/components/SettingsList' import {atoms as a} from '#/alf' import {Admonition} from '#/components/Admonition' import * as Toggle from '#/components/forms/Toggle' -import {PaintRoller_Stroke2_Corner2_Rounded as PaintRollerIcon} from '#/components/icons/PaintRoller' +import {ArrowShareRight_Stroke2_Corner2_Rounded as ArrowShareRightIcon} from '#/components/icons/ArrowShareRight' +import {ArrowTopCircle_Stroke2_Corner0_Rounded as ArrowTopIcon} from '#/components/icons/ArrowTopCircle' +import {Envelope_Stroke2_Corner2_Rounded as EnvelopeIcon} from '#/components/icons/Envelope' +import {Eye_Stroke2_Corner2_Rounded as EyeIcon} from '#/components/icons/Eye' +import {EyeSlash_Stroke2_Corner0_Rounded as EyeSlashIcon} from '#/components/icons/EyeSlash' +import {PencilLine_Stroke2_Corner2_Rounded as PencilIcon} from '#/components/icons/Pencil' +import {PersonGroup_Stroke2_Corner2_Rounded as PersonGroupIcon} from '#/components/icons/Person' +import {Reply as ReplyIcon} from '#/components/icons/Reply' import {RunesScreenLayout} from './components/RunesScreenLayout' export function RunesUsabilitySettingsScreen() { @@ -65,113 +72,127 @@ export function RunesUsabilitySettingsScreen() { return ( - - - - Debloating - - setGoLinksEnabled(value)} - style={[a.w_full]}> - + setGoLinksEnabled(value)}> + + + Redirect through go.bsky.app - + - - setNoDiscoverFallback(value)} - style={[a.w_full]}> - + + + setNoDiscoverFallback(value)}> + + + Do not fall back to discover feed - + - - setHideFeedsPromoTab(value)} - style={[a.w_full]}> - + + + setHideFeedsPromoTab(value)}> + + + Hide "Feeds ✨" tab when only one feed is selected - + - - setHideSimilarAccountsRecomm(value)} - style={[a.w_full]}> - - Hide similar accounts recommendations - + + + setHideSimilarAccountsRecomm(value)}> + + + + Disable similar accounts recommendations + - - setHideUnreplyablePosts(value)} - style={[a.w_full]}> - + + + setDisableComposerPrompt(value)}> + + + + Disable composer prompt + + + + + setDisableTopOfFeedButton(value)}> + + + + Disable top-of-feed button + + + + + setHideUnreplyablePosts(value)}> + + + Hide posts that cannot be replied to from feeds - + - + + + Hides posts from feeds where replies are disabled (e.g. due to postgates or other restrictions). Does not affect thread views. - setDisableComposerPrompt(value)} - style={[a.w_full]}> - - Disable composer prompt - - - - setDisableTopOfFeedButton(value)} - style={[a.w_full]}> - - Disable top-of-feed button - - - - setDisableVerifyEmailReminder(value)} - style={[a.w_full]}> - + + setDisableVerifyEmailReminder(value)}> + + + Disable verify email reminder - + - + + + This only gets rid of the reminder on app launch, useful if your PDS - does not have email verification setup.  This does NOT give + does not have email verification setup. This does NOT give access to features locked behind email verification. - + ) } diff --git a/src/screens/Settings/RunesSettings/index.tsx b/src/screens/Settings/RunesSettings/index.tsx index ec654e25c..6764440b0 100644 --- a/src/screens/Settings/RunesSettings/index.tsx +++ b/src/screens/Settings/RunesSettings/index.tsx @@ -62,11 +62,11 @@ export function RunesSettingsScreen({}: Props) { + to="/settings/runes/extra" + label={l`Extra settings `}> - Other additions + Extra diff --git a/src/state/preferences/no-app-labelers.tsx b/src/state/preferences/no-app-labelers.tsx index 2cddf1955..94ad4f552 100644 --- a/src/state/preferences/no-app-labelers.tsx +++ b/src/state/preferences/no-app-labelers.tsx @@ -6,8 +6,10 @@ import { useEffect, useState, } from 'react' +import {reloadAppAsync} from 'expo' import * as persisted from '#/state/persisted' +import {IS_WEB} from '#/env' type StateContext = persisted.Schema['noAppLabelers'] type SetContext = (v: persisted.Schema['noAppLabelers']) => void @@ -26,6 +28,12 @@ export function Provider({children}: PropsWithChildren<{}>) { (noAppLabelers: persisted.Schema['noAppLabelers']) => { setState(noAppLabelers) persisted.write('noAppLabelers', noAppLabelers) + + if (IS_WEB) { + window.location.reload() + } else { + void reloadAppAsync() + } }, [setState], ) -- 2.51.2