mirror of
https://github.com/sky-systems/sky_phone.git
synced 2026-08-29 01:08:59 +00:00
ENH - add development setup skip
Add a development-only setup assistant control that skips the wizard for the current frontend session without persisting setup completion or changing backend state. Localize the control through the phone locale fallback and resource locale.
This commit is contained in:
+15
-4
@@ -323,6 +323,7 @@ const passcodeRetrySeconds = ref(0)
|
||||
const passcodeVisible = ref(false)
|
||||
const passcodeRequired = ref(false)
|
||||
const setupPreviewDismissed = ref(false)
|
||||
const setupDevelopmentSkipped = ref(false)
|
||||
const pendingUnlockRoute = ref<string | null>(null)
|
||||
const unlockedServicesLoaded = ref(false)
|
||||
const controlCenterOpened = ref(false)
|
||||
@@ -330,10 +331,13 @@ const activitySuspended = ref(false)
|
||||
const simPicker = ref<SimPickerPayload | null>(null)
|
||||
const setupRequired = computed(
|
||||
() =>
|
||||
!phone.preferences.settings.setupCompleted ||
|
||||
(isDevelopment &&
|
||||
developmentParameters.has('setupPreview') &&
|
||||
!setupPreviewDismissed.value),
|
||||
!(
|
||||
isDevelopment && setupDevelopmentSkipped.value
|
||||
) &&
|
||||
(!phone.preferences.settings.setupCompleted ||
|
||||
(isDevelopment &&
|
||||
developmentParameters.has('setupPreview') &&
|
||||
!setupPreviewDismissed.value)),
|
||||
)
|
||||
const systemColorScheme = window.matchMedia('(prefers-color-scheme: dark)')
|
||||
const viewportScale = ref(getViewportScale())
|
||||
@@ -528,6 +532,12 @@ function completePhoneSetup(): void {
|
||||
loadUnlockedPhoneData()
|
||||
}
|
||||
|
||||
function skipPhoneSetupForDevelopment(): void {
|
||||
if (!isDevelopment) return
|
||||
setupDevelopmentSkipped.value = true
|
||||
completePhoneSetup()
|
||||
}
|
||||
|
||||
async function hydrateDevelopmentPhone(): Promise<void> {
|
||||
const response = await nuiCall<PhoneOpenPayload>('development:bootstrap')
|
||||
if (response.success && response.data) {
|
||||
@@ -1542,6 +1552,7 @@ onBeforeUnmount(() => {
|
||||
<PhoneSetupAssistant
|
||||
v-if="setupRequired"
|
||||
@complete="completePhoneSetup"
|
||||
@skip="skipPhoneSetupForDevelopment"
|
||||
/>
|
||||
<PhoneNotifications
|
||||
:notification="notifications.current"
|
||||
|
||||
@@ -30,7 +30,7 @@ import {
|
||||
type WallpaperId,
|
||||
} from '@/utils/preferences'
|
||||
|
||||
const emit = defineEmits<{ complete: [] }>()
|
||||
const emit = defineEmits<{ complete: []; skip: [] }>()
|
||||
|
||||
const phone = usePhoneStore()
|
||||
const account = useAccountStore()
|
||||
@@ -86,6 +86,7 @@ const passwordStrength = computed(() => {
|
||||
const currentWallpaperStyle = computed(() => ({
|
||||
'--setup-wallpaper': `var(--phone-wallpaper-${phone.preferences.settings.wallpaper})`,
|
||||
}))
|
||||
const showDevelopmentSkip = import.meta.env.DEV
|
||||
|
||||
function moveTo(nextStep: number): void {
|
||||
direction.value = nextStep < step.value ? 'back' : 'forward'
|
||||
@@ -207,6 +208,10 @@ function finish(): void {
|
||||
phone.completeSetup()
|
||||
emit('complete')
|
||||
}
|
||||
|
||||
function skipSetupForDevelopment(): void {
|
||||
emit('skip')
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -217,6 +222,14 @@ function finish(): void {
|
||||
:aria-label="phone.t('Setup.title')"
|
||||
>
|
||||
<div class="setup-assistant__aurora" aria-hidden="true"></div>
|
||||
<button
|
||||
v-if="showDevelopmentSkip"
|
||||
type="button"
|
||||
class="setup-assistant__development-skip"
|
||||
@click="skipSetupForDevelopment"
|
||||
>
|
||||
{{ phone.t('Setup.development.skip') }}
|
||||
</button>
|
||||
<header v-if="step > 0 && step < 9" class="setup-assistant__chrome">
|
||||
<button
|
||||
type="button"
|
||||
@@ -841,6 +854,24 @@ function finish(): void {
|
||||
filter: blur(28px);
|
||||
animation: setup-aurora 12s ease-in-out infinite alternate;
|
||||
}
|
||||
.setup-assistant__development-skip {
|
||||
position: absolute;
|
||||
z-index: 3;
|
||||
top: 20px;
|
||||
right: 18px;
|
||||
min-height: 44px;
|
||||
padding: 0 12px;
|
||||
border: 1px solid rgb(255 255 255 / 16%);
|
||||
border-radius: 12px;
|
||||
color: rgb(255 255 255 / 82%);
|
||||
background: rgb(10 16 31 / 72%);
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
}
|
||||
.setup-assistant__development-skip:focus-visible {
|
||||
outline: 2px solid #72b5ff;
|
||||
outline-offset: 2px;
|
||||
}
|
||||
.setup-assistant__chrome {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
|
||||
@@ -4143,6 +4143,7 @@ const defaultLocales: LocaleTree = {
|
||||
ownerFallback: 'Sky Phone Owner',
|
||||
getStarted: 'Get Started',
|
||||
setUpLater: 'Set Up Later',
|
||||
development: { skip: 'Skip setup' },
|
||||
welcome: {
|
||||
title: 'Welcome to Sky Phone',
|
||||
eyebrow: 'Designed around you',
|
||||
|
||||
@@ -72,6 +72,7 @@ Locales["en"] = {
|
||||
},
|
||||
Setup = {
|
||||
title = "Sky Phone Setup Assistant", ownerFallback = "Sky Phone Owner", getStarted = "Get Started", setUpLater = "Set Up Later",
|
||||
development = { skip = "Skip setup" },
|
||||
welcome = { title = "Welcome to Sky Phone", eyebrow = "Designed around you", hello = "hello", hallo = "hallo", bonjour = "bonjour", body = "Hello, {name}. Let's make this phone unmistakably yours.", private = "Private by design", personal = "Made for you" },
|
||||
connection = {
|
||||
eyebrow = "Mobile Connection", title = "Your connection is ready", body = "Sky Phone automatically detects the SIM installed in this device.",
|
||||
|
||||
Reference in New Issue
Block a user