From 589553c0e37d0c29ed77ceea4aeba2d991bc0364 Mon Sep 17 00:00:00 2001 From: LemonNeko Date: Thu, 12 Mar 2026 14:49:39 +0800 Subject: [PATCH] feat(stage-pocket): request permissions onboarding (#1292) Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- .../ios/App/CapApp-SPM/Package.swift | 6 +- apps/stage-pocket/package.json | 1 + apps/stage-pocket/src/App.vue | 18 +++- .../onboarding/step-permissions.vue | 90 +++++++++++++++++++ .../src/renderer/pages/index.vue | 8 +- apps/stage-web/src/App.vue | 8 +- packages/i18n/src/locales/en/settings.yaml | 13 +++ packages/stage-ui/src/stores/onboarding.ts | 50 ++--------- pnpm-lock.yaml | 15 ++++ pnpm-workspace.yaml | 3 +- 10 files changed, 155 insertions(+), 57 deletions(-) create mode 100644 apps/stage-pocket/src/components/onboarding/step-permissions.vue diff --git a/apps/stage-pocket/ios/App/CapApp-SPM/Package.swift b/apps/stage-pocket/ios/App/CapApp-SPM/Package.swift index 731277dbb..95a3eb184 100644 --- a/apps/stage-pocket/ios/App/CapApp-SPM/Package.swift +++ b/apps/stage-pocket/ios/App/CapApp-SPM/Package.swift @@ -12,7 +12,8 @@ let package = Package( ], dependencies: [ .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", exact: "8.1.0"), - .package(name: "CapacitorLocalNotifications", path: "../../../../../node_modules/.pnpm/@capacitor+local-notifications@8.0.1_@capacitor+core@8.1.0/node_modules/@capacitor/local-notifications") + .package(name: "CapacitorLocalNotifications", path: "../../../../../node_modules/.pnpm/@capacitor+local-notifications@8.0.1_@capacitor+core@8.1.0/node_modules/@capacitor/local-notifications"), + .package(name: "CapacitorNativeSettings", path: "../../../../../node_modules/.pnpm/capacitor-native-settings@8.0.0_@capacitor+core@8.1.0/node_modules/capacitor-native-settings") ], targets: [ .target( @@ -20,7 +21,8 @@ let package = Package( dependencies: [ .product(name: "Capacitor", package: "capacitor-swift-pm"), .product(name: "Cordova", package: "capacitor-swift-pm"), - .product(name: "CapacitorLocalNotifications", package: "CapacitorLocalNotifications") + .product(name: "CapacitorLocalNotifications", package: "CapacitorLocalNotifications"), + .product(name: "CapacitorNativeSettings", package: "CapacitorNativeSettings") ] ) ] diff --git a/apps/stage-pocket/package.json b/apps/stage-pocket/package.json index 0635649d4..22903c52b 100644 --- a/apps/stage-pocket/package.json +++ b/apps/stage-pocket/package.json @@ -58,6 +58,7 @@ "@xsai/stream-transcription": "0.4.0-beta.8", "@xsai/utils-chat": "catalog:", "animejs": "^4.3.6", + "capacitor-native-settings": "catalog:", "colorjs.io": "^0.6.1", "culori": "^4.0.2", "date-fns": "^4.1.0", diff --git a/apps/stage-pocket/src/App.vue b/apps/stage-pocket/src/App.vue index 43e4c642b..b08708bf7 100644 --- a/apps/stage-pocket/src/App.vue +++ b/apps/stage-pocket/src/App.vue @@ -16,6 +16,8 @@ import { useI18n } from 'vue-i18n' import { RouterView } from 'vue-router' import { toast, Toaster } from 'vue-sonner' +import OnboardingPermissionsStep from './components/onboarding/step-permissions.vue' + const contextBridgeStore = useContextBridgeStore() const i18n = useI18n() const displayModelsStore = useDisplayModelsStore() @@ -24,7 +26,7 @@ const settings = storeToRefs(settingsStore) const onboardingStore = useOnboardingStore() const serverChannelStore = useModsServerChannelStore() const characterOrchestratorStore = useCharacterOrchestratorStore() -const { shouldShowSetup } = storeToRefs(onboardingStore) +const { showingSetup } = storeToRefs(onboardingStore) const { isDark } = useTheme() const cardStore = useAiriCardStore() const analyticsStore = useSharedAnalyticsStore() @@ -68,7 +70,9 @@ onMounted(async () => { analyticsStore.initialize() cardStore.initialize() - onboardingStore.initializeSetupCheck() + if (onboardingStore.needsOnboarding) { + onboardingStore.showingSetup = true + } await serverChannelStore.initialize({ possibleEvents: ['ui:configure'] }).catch(err => console.error('Failed to initialize Mods Server Channel in App.vue:', err)) await contextBridgeStore.initialize() @@ -90,6 +94,13 @@ function handleSetupConfigured() { function handleSetupSkipped() { onboardingStore.markSetupSkipped() } + +const extraSteps = computed(() => [ + { + id: 'step-permissions', + component: OnboardingPermissionsStep, + }, +])