mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-22 21:11:14 +00:00
* feat(ios): unify chat and voice experience * refactor(ios): finish unified chat ownership * fix(ios): unify chat and voice capture ownership * fix(ios): serialize Talk permission hydration * fix(ios): clear voice CI regressions * fix(ios): clear remaining unified chat CI failures * chore(i18n): sync native source inventory * refactor(ios): defer provider-only realtime voice * fix(ios): clean unified chat voice PR * fix(ios): localize unified voice controls * fix(ios): serialize composer audio controls * fix(ios): isolate dictation preparation lifecycle * fix(ios): key chat tab icons by appearance * fix(ios): preserve talk upgrade handshakes * fix(ios): refresh native i18n inventory * fix(ios): reconcile shared locale artifacts * fix(ios): satisfy chat view lint limit * fix(ios): reconcile shared composer implementation * test(apple): avoid XCTest actor deinit crash * fix(ios): satisfy SwiftFormat scope spacing * fix(ios): remove duplicate merged helper declarations
39 lines
1.2 KiB
Swift
39 lines
1.2 KiB
Swift
public struct OpenClawChatDictationControl {
|
|
public var isActive: Bool
|
|
public var isAvailable: Bool
|
|
public var start: @MainActor () async throws -> String?
|
|
public var finish: @MainActor () -> Void
|
|
public var cancel: @MainActor () -> Void
|
|
|
|
public init(
|
|
isActive: Bool,
|
|
isAvailable: Bool,
|
|
start: @escaping @MainActor () async throws -> String?,
|
|
finish: @escaping @MainActor () -> Void,
|
|
cancel: @escaping @MainActor () -> Void)
|
|
{
|
|
self.isActive = isActive
|
|
self.isAvailable = isAvailable
|
|
self.start = start
|
|
self.finish = finish
|
|
self.cancel = cancel
|
|
}
|
|
}
|
|
|
|
extension OpenClawChatViewModel {
|
|
func appendDictationTranscript(_ transcript: String, for session: SessionSnapshot) {
|
|
guard self.isCurrentSession(session) else { return }
|
|
if self.input.isEmpty {
|
|
self.input = transcript
|
|
} else {
|
|
let separator = self.input.last?.isWhitespace == true ? "" : " "
|
|
self.input += separator + transcript
|
|
}
|
|
}
|
|
|
|
func setDictationError(_ error: Error, for session: SessionSnapshot) {
|
|
guard self.isCurrentSession(session) else { return }
|
|
self.errorText = error.localizedDescription
|
|
}
|
|
}
|