feat: flow session reliability, keyboard UX, and audio pre-roll fix

Renew voice sessions while the host app stays foreground, auto-start flow from the keyboard with a Start action, and prevent leading audio loss via pre-roll buffering and faster signal polling.
This commit is contained in:
Rocky
2026-06-20 00:57:16 +08:00
parent 38a36ed504
commit db5151ad9a
12 changed files with 196 additions and 77 deletions
+4
View File
@@ -35,6 +35,9 @@ struct OSGKeyboardApp: App {
}
}
.environmentObject(flowManager)
.onAppear {
flowManager.setAppForeground(scenePhase == .active)
}
.onOpenURL { url in
guard url.scheme == "osgkeyboard" else { return }
switch url.host {
@@ -56,6 +59,7 @@ struct OSGKeyboardApp: App {
if done { flowManager.autoStartIfNeeded() }
}
.onChange(of: scenePhase) { _, phase in
flowManager.setAppForeground(phase == .active)
guard phase == .active, AppGroup.isAvailable, config.hasCompletedOnboarding else { return }
if flowManager.isActive {
flowManager.extendSession()