diff options
author | Eric Bailey <git@esb.lol> | 2025-08-06 15:15:52 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-06 15:15:52 -0500 |
commit | 328aa2be9482f77cb1cf86c5d227fdcee9981b16 (patch) | |
tree | 27174f10e0fe80288c0cd6907f8686486131d082 /src/screens/Settings/Settings.tsx | |
parent | fd37d92f85ddf0f075a67c4e9b2d85bef38f1835 (diff) | |
download | voidsky-328aa2be9482f77cb1cf86c5d227fdcee9981b16.tar.zst |
[APP-1356] Policy update dialog (#8782)
* Add blocking announcement dialog feature * WIP custom dialog * Rework dialog and add native FocusScope * Lock scroll on web, fix backdrop * Add web FocusScope * Create custom Outlet for these announcements * Clean up FocusScope native impl * Comments * Some styling fixes * Handle screen reader specifically * Clean up state, remove Portal edits * Reorg, rename * Add syncing, tests * Revert dialog updates * Revert formatting * Delete unused file * Format * Add FullWindowOverlay * remove mmkv storage in debug btn * Add debug code * fix taps passing through on iOS * Reorg * Reorg, rename everything * Complete policy update after signup * Add logger * Move context around, unmount portals on native * Move a11y prop into FocusScope * Remove useMemo * Update dates * Move debug to dev settings * Unmount web portals until policy update completed * UPdate dates --------- Co-authored-by: Samuel Newman <mozzius@protonmail.com>
Diffstat (limited to 'src/screens/Settings/Settings.tsx')
-rw-r--r-- | src/screens/Settings/Settings.tsx | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/screens/Settings/Settings.tsx b/src/screens/Settings/Settings.tsx index 719bbf9a2..5023982eb 100644 --- a/src/screens/Settings/Settings.tsx +++ b/src/screens/Settings/Settings.tsx @@ -25,6 +25,7 @@ import {clearStorage} from '#/state/persisted' import {useModerationOpts} from '#/state/preferences/moderation-opts' import {useDeleteActorDeclaration} from '#/state/queries/messages/actor-declaration' import {useProfileQuery, useProfilesQuery} from '#/state/queries/profile' +import {useAgent} from '#/state/session' import {type SessionAccount, useSession, useSessionApi} from '#/state/session' import {useOnboardingDispatch} from '#/state/shell' import {useLoggedOutViewControls} from '#/state/shell/logged-out' @@ -35,6 +36,7 @@ import * as SettingsList from '#/screens/Settings/components/SettingsList' import {atoms as a, platform, tokens, useBreakpoints, useTheme} from '#/alf' import {AgeAssuranceDismissibleNotice} from '#/components/ageAssurance/AgeAssuranceDismissibleNotice' import {AvatarStackWithFetch} from '#/components/AvatarStack' +import {Button, ButtonText} from '#/components/Button' import {useDialogControl} from '#/components/Dialog' import {SwitchAccountDialog} from '#/components/dialogs/SwitchAccount' import {Accessibility_Stroke2_Corner2_Rounded as AccessibilityIcon} from '#/components/icons/Accessibility' @@ -58,6 +60,7 @@ import {Window_Stroke2_Corner2_Rounded as WindowIcon} from '#/components/icons/W import * as Layout from '#/components/Layout' import {Loader} from '#/components/Loader' import * as Menu from '#/components/Menu' +import {ID as PolicyUpdate202508} from '#/components/PolicyUpdateOverlay/updates/202508/config' import * as Prompt from '#/components/Prompt' import {Text} from '#/components/Typography' import {useFullVerificationState} from '#/components/verification' @@ -66,6 +69,7 @@ import { VerificationCheckButton, } from '#/components/verification/VerificationCheckButton' import {IS_INTERNAL} from '#/env' +import {device, useStorage} from '#/storage' import {useActivitySubscriptionsNudged} from '#/storage/hooks/activity-subscriptions-nudged' type Props = NativeStackScreenProps<CommonNavigatorParams, 'Settings'> @@ -363,6 +367,10 @@ function ProfilePreview({ function DevOptions() { const {_} = useLingui() + const agent = useAgent() + const [override, setOverride] = useStorage(device, [ + 'policyUpdateDebugOverride', + ]) const onboardingDispatch = useOnboardingDispatch() const navigation = useNavigation<NavigationProp>() const {mutate: deleteChatDeclarationRecord} = useDeleteActorDeclaration() @@ -502,6 +510,40 @@ function DevOptions() { </SettingsList.ItemText> </SettingsList.PressableItem> ) : null} + + <SettingsList.Divider /> + <View style={[a.p_xl, a.gap_md]}> + <Text style={[a.text_lg, a.font_bold]}>PolicyUpdate202508 Debug</Text> + + <View style={[a.flex_row, a.align_center, a.justify_between, a.gap_md]}> + <Button + onPress={() => { + setOverride(!override) + }} + label="Toggle" + color={override ? 'primary' : 'secondary'} + size="small" + style={[a.flex_1]}> + <ButtonText> + {override ? 'Disable debug mode' : 'Enable debug mode'} + </ButtonText> + </Button> + + <Button + onPress={() => { + device.set([PolicyUpdate202508], false) + agent.bskyAppRemoveNuxs([PolicyUpdate202508]) + Toast.show(`Done`, 'info') + }} + label="Reset policy update nux" + color="secondary" + size="small" + disabled={!override}> + <ButtonText>Reset state</ButtonText> + </Button> + </View> + </View> + <SettingsList.Divider /> </> ) } |