Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

allow disabling app labelers

commit 278c11542fc422643b881d2ca9493b005c549aee
Author: Aviva Ruben <aviva@rubenfamily.com>
Date: Thu Apr 10 16:49:56 2025 -0500

allow disabling app labelers

+130 -30
+46 -3
src/screens/Settings/DeerSettings.tsx
··· 23 23 useDirectFetchRecords, 24 24 useSetDirectFetchRecords, 25 25 } from '#/state/preferences/direct-fetch-records' 26 + import { 27 + useNoAppLabelers, 28 + useSetNoAppLabelers, 29 + } from '#/state/preferences/no-app-labelers' 26 30 import {TextInput} from '#/view/com/modals/util' 27 31 import * as SettingsList from '#/screens/Settings/components/SettingsList' 28 32 import {atoms as a} from '#/alf' ··· 35 39 import {Earth_Stroke2_Corner2_Rounded as GlobeIcon} from '#/components/icons/Globe' 36 40 import {Lab_Stroke2_Corner0_Rounded as BeakerIcon} from '#/components/icons/Lab' 37 41 import {PaintRoller_Stroke2_Corner2_Rounded as PaintRollerIcon} from '#/components/icons/PaintRoller' 42 + import {RaisingHand4Finger_Stroke2_Corner0_Rounded as RaisingHandIcon} from '#/components/icons/RaisingHand' 38 43 import * as Layout from '#/components/Layout' 39 44 import {Text} from '#/components/Typography' 40 45 ··· 117 122 const directFetchRecords = useDirectFetchRecords() 118 123 const setDirectFetchRecords = useSetDirectFetchRecords() 119 124 125 + const noAppLabelers = useNoAppLabelers() 126 + const setNoAppLabelers = useSetNoAppLabelers() 127 + 120 128 const location = useGeolocation() 121 129 const setLocationControl = Dialog.useDialogControl() 122 130 ··· 176 184 style={[a.w_full]}> 177 185 <Toggle.LabelText style={[a.flex_1]}> 178 186 <Trans> 179 - Fetch records directly from PDS to see through quote blocks 187 + Fetch records directly from PDS to see contents of blocked and 188 + detatched quotes 180 189 </Trans> 181 190 </Toggle.LabelText> 182 191 <Toggle.Platform /> ··· 214 223 <SettingsList.Item> 215 224 <Admonition type="info" style={[a.flex_1]}> 216 225 <Trans> 217 - Geolocation country code informs required regional labelers and 218 - currency behavior. 226 + Geolocation country code informs required regional app labelers 227 + and currency behavior. 219 228 </Trans> 220 229 </Admonition> 221 230 </SettingsList.Item> 231 + 232 + <SettingsList.Group contentContainerStyle={[a.gap_sm]}> 233 + <SettingsList.ItemIcon icon={RaisingHandIcon} /> 234 + <SettingsList.ItemText> 235 + <Trans>Labelers</Trans> 236 + </SettingsList.ItemText> 237 + <Toggle.Item 238 + name="no_app_labelers" 239 + label={_(msg`Do not declare any app labelers`)} 240 + value={noAppLabelers} 241 + onChange={value => setNoAppLabelers(value)} 242 + style={[a.w_full]}> 243 + <Toggle.LabelText style={[a.flex_1]}> 244 + <Trans>Do not declare any default app labelers</Trans> 245 + </Toggle.LabelText> 246 + <Toggle.Platform /> 247 + </Toggle.Item> 248 + <Admonition type="warning" style={[a.flex_1]}> 249 + <Trans>Restart app after changing this setting.</Trans> 250 + </Admonition> 251 + <Admonition type="tip" style={[a.flex_1]}> 252 + <Trans> 253 + Some appviews will default to using an app labeler if you have 254 + no labelers, so consider subscribing to at least one labeler. 255 + </Trans> 256 + </Admonition> 257 + <Admonition type="info" style={[a.flex_1]}> 258 + <Trans> 259 + App labelers are mandatory top-level labelers that can perform 260 + "takedowns". This setting does not influence geolocation based 261 + labelers. 262 + </Trans> 263 + </Admonition> 264 + </SettingsList.Group> 222 265 223 266 <SettingsList.Group contentContainerStyle={[a.gap_sm]}> 224 267 <SettingsList.ItemIcon icon={PaintRollerIcon} />
+2 -2
src/state/persisted/schema.ts
··· 128 128 goLinksEnabled: z.boolean().optional(), 129 129 constellationEnabled: z.boolean().optional(), 130 130 directFetchRecords: z.boolean().optional(), 131 - unfollowConfirm: z.boolean().optional(), 131 + noAppLabelers: z.boolean().optional(), 132 132 133 133 /** @deprecated */ 134 134 mutedThreads: z.array(z.string()), ··· 186 186 goLinksEnabled: true, 187 187 constellationEnabled: false, 188 188 directFetchRecords: false, 189 - unfollowConfirm: false, 189 + noAppLabelers: false, 190 190 } 191 191 192 192 export function tryParse(rawData: string): Schema | undefined {
+26 -23
src/state/preferences/index.tsx
··· 12 12 import {Provider as KawaiiProvider} from './kawaii' 13 13 import {Provider as LanguagesProvider} from './languages' 14 14 import {Provider as LargeAltBadgeProvider} from './large-alt-badge' 15 + import {Provider as NoAppLabelersProvider} from './no-app-labelers' 15 16 import {Provider as SubtitlesProvider} from './subtitles' 16 17 import {Provider as TrendingSettingsProvider} from './trending' 17 18 import {Provider as UsedStarterPacksProvider} from './used-starter-packs' ··· 37 38 <LanguagesProvider> 38 39 <AltTextRequiredProvider> 39 40 <GoLinksProvider> 40 - <DirectFetchRecordsProvider> 41 - <ConstellationProvider> 42 - <LargeAltBadgeProvider> 43 - <ExternalEmbedsProvider> 44 - <HiddenPostsProvider> 45 - <InAppBrowserProvider> 46 - <DisableHapticsProvider> 47 - <AutoplayProvider> 48 - <UsedStarterPacksProvider> 49 - <SubtitlesProvider> 50 - <TrendingSettingsProvider> 51 - <KawaiiProvider>{children}</KawaiiProvider> 52 - </TrendingSettingsProvider> 53 - </SubtitlesProvider> 54 - </UsedStarterPacksProvider> 55 - </AutoplayProvider> 56 - </DisableHapticsProvider> 57 - </InAppBrowserProvider> 58 - </HiddenPostsProvider> 59 - </ExternalEmbedsProvider> 60 - </LargeAltBadgeProvider> 61 - </ConstellationProvider> 62 - </DirectFetchRecordsProvider> 41 + <NoAppLabelersProvider> 42 + <DirectFetchRecordsProvider> 43 + <ConstellationProvider> 44 + <LargeAltBadgeProvider> 45 + <ExternalEmbedsProvider> 46 + <HiddenPostsProvider> 47 + <InAppBrowserProvider> 48 + <DisableHapticsProvider> 49 + <AutoplayProvider> 50 + <UsedStarterPacksProvider> 51 + <SubtitlesProvider> 52 + <TrendingSettingsProvider> 53 + <KawaiiProvider>{children}</KawaiiProvider> 54 + </TrendingSettingsProvider> 55 + </SubtitlesProvider> 56 + </UsedStarterPacksProvider> 57 + </AutoplayProvider> 58 + </DisableHapticsProvider> 59 + </InAppBrowserProvider> 60 + </HiddenPostsProvider> 61 + </ExternalEmbedsProvider> 62 + </LargeAltBadgeProvider> 63 + </ConstellationProvider> 64 + </DirectFetchRecordsProvider> 65 + </NoAppLabelersProvider> 63 66 </GoLinksProvider> 64 67 </AltTextRequiredProvider> 65 68 </LanguagesProvider>
+51
src/state/preferences/no-app-labelers.tsx
··· 1 + import React from 'react' 2 + 3 + import * as persisted from '#/state/persisted' 4 + 5 + type StateContext = persisted.Schema['noAppLabelers'] 6 + type SetContext = (v: persisted.Schema['noAppLabelers']) => void 7 + 8 + const stateContext = React.createContext<StateContext>( 9 + persisted.defaults.noAppLabelers, 10 + ) 11 + const setContext = React.createContext<SetContext>( 12 + (_: persisted.Schema['noAppLabelers']) => {}, 13 + ) 14 + 15 + export function Provider({children}: React.PropsWithChildren<{}>) { 16 + const [state, setState] = React.useState(persisted.get('noAppLabelers')) 17 + 18 + const setStateWrapped = React.useCallback( 19 + (noAppLabelers: persisted.Schema['noAppLabelers']) => { 20 + setState(noAppLabelers) 21 + persisted.write('noAppLabelers', noAppLabelers) 22 + }, 23 + [setState], 24 + ) 25 + 26 + React.useEffect(() => { 27 + return persisted.onUpdate('noAppLabelers', nextNoAppLabelers => { 28 + setState(nextNoAppLabelers) 29 + }) 30 + }, [setStateWrapped]) 31 + 32 + return ( 33 + <stateContext.Provider value={state}> 34 + <setContext.Provider value={setStateWrapped}> 35 + {children} 36 + </setContext.Provider> 37 + </stateContext.Provider> 38 + ) 39 + } 40 + 41 + export function useNoAppLabelers() { 42 + return React.useContext(stateContext) 43 + } 44 + 45 + export function useSetNoAppLabelers() { 46 + return React.useContext(setContext) 47 + } 48 + 49 + export function getNoAppLabelers() { 50 + return persisted.get('noAppLabelers') || persisted.defaults.noAppLabelers! 51 + }
+5 -2
src/state/session/moderation.ts
··· 1 1 import {BSKY_LABELER_DID, BskyAgent} from '@atproto/api' 2 2 3 3 import {IS_TEST_USER} from '#/lib/constants' 4 + import {getNoAppLabelers} from '../preferences/no-app-labelers' 4 5 import {configureAdditionalModerationAuthorities} from './additional-moderation-authorities' 5 6 import {readLabelers} from './agent-config' 6 - import {SessionAccount} from './types' 7 + import {type SessionAccount} from './types' 7 8 8 9 export function configureModerationForGuest() { 9 10 // This global mutation is *only* OK because this code is only relevant for testing. ··· 38 39 } 39 40 40 41 function switchToBskyAppLabeler() { 41 - BskyAgent.configure({appLabelers: [BSKY_LABELER_DID]}) 42 + BskyAgent.configure({ 43 + appLabelers: getNoAppLabelers() ? [] : [BSKY_LABELER_DID], 44 + }) 42 45 } 43 46 44 47 async function trySwitchToTestAppLabeler(agent: BskyAgent) {