feat: TypeWhisper Flow sessions, Phase 4 UX, and GitHub Pages privacy site
Migrate keyboard dictation to continuous Flow sessions with auto-start, tap-to-toggle recording, 60s countdown, five-step onboarding, and App Group IPC. Add docs/ GitHub Pages site with en/zh privacy policy for App Store compliance.
This commit is contained in:
@@ -6,14 +6,19 @@ import OSGKeyboardShared
|
||||
|
||||
@main
|
||||
struct OSGKeyboardApp: App {
|
||||
@Environment(\.scenePhase) private var scenePhase
|
||||
|
||||
@StateObject private var config = ProviderConfig.shared
|
||||
@StateObject private var dictationCoordinator = DictationSessionCoordinator()
|
||||
@StateObject private var flowManager = FlowSessionManager()
|
||||
|
||||
var body: some Scene {
|
||||
WindowGroup {
|
||||
ThemedRoot {
|
||||
if AppGroup.isAvailable {
|
||||
if config.isConfigured {
|
||||
if config.hasCompletedOnboarding {
|
||||
HomeView()
|
||||
.onAppear { flowManager.autoStartIfNeeded() }
|
||||
} else {
|
||||
OnboardingView(config: config)
|
||||
}
|
||||
@@ -21,6 +26,32 @@ struct OSGKeyboardApp: App {
|
||||
AppGroupErrorView()
|
||||
}
|
||||
}
|
||||
.environmentObject(flowManager)
|
||||
.onOpenURL { url in
|
||||
guard url.scheme == "osgkeyboard" else { return }
|
||||
switch url.host {
|
||||
case "dictate":
|
||||
dictationCoordinator.present()
|
||||
case "startflow":
|
||||
flowManager.startSession()
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
.fullScreenCover(isPresented: $dictationCoordinator.isPresenting) {
|
||||
DictationCaptureView(
|
||||
config: config,
|
||||
coordinator: dictationCoordinator
|
||||
)
|
||||
}
|
||||
.onChange(of: scenePhase) { _, phase in
|
||||
guard phase == .active, AppGroup.isAvailable, config.hasCompletedOnboarding else { return }
|
||||
if flowManager.isActive {
|
||||
flowManager.extendSession()
|
||||
} else {
|
||||
flowManager.autoStartIfNeeded()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user