feat: polish first-launch onboarding and post-setup permission guidance

Streamline the five-step flow with smarter skip logic, a centered welcome intro, clearer zh copy, keyboard setup detection via the extension, and home tips when permissions are still missing after onboarding completes.
This commit is contained in:
Rocky
2026-06-21 16:14:13 +08:00
parent 642c97c540
commit 993784d223
11 changed files with 591 additions and 276 deletions
+28
View File
@@ -76,4 +76,32 @@ enum AppPermissions {
guard let url = URL(string: UIApplication.openSettingsURLString) else { return }
UIApplication.shared.open(url)
}
/// Home-screen guidance when Flow permissions are missing after onboarding.
static var homePermissionGuidanceMessage: String {
let micMissing = micStatus != .granted
let speechMissing = speechStatus != .granted
if micMissing && speechMissing {
return NSLocalizedString("home.setup.permission.both", comment: "")
}
if micMissing {
return NSLocalizedString("home.setup.permission.mic", comment: "")
}
return NSLocalizedString("home.setup.permission.speech", comment: "")
}
/// True when at least one permission can still be requested in-app.
static var canRequestPermissionsInApp: Bool {
micStatus == .undetermined || speechStatus == .undetermined
}
/// Requests any still-undetermined Flow permissions in order.
static func requestFlowPermissionsIfNeeded() async {
if micStatus == .undetermined {
_ = await requestMicrophone()
}
if speechStatus == .undetermined {
_ = await requestSpeechRecognition()
}
}
}