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:
@@ -0,0 +1,17 @@
|
||||
// DictationTextComposer.swift
|
||||
// OSGKeyboard · Shared
|
||||
//
|
||||
// Merges pre-dictation anchor text with a live cumulative transcript.
|
||||
|
||||
import Foundation
|
||||
|
||||
public enum DictationTextComposer {
|
||||
/// Combine text that existed before dictation with the current live transcript.
|
||||
public static func compose(anchor: String, live: String) -> String {
|
||||
let trimmed = live.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
guard !trimmed.isEmpty else { return anchor }
|
||||
if anchor.isEmpty { return trimmed }
|
||||
if anchor.last == " " || anchor.last == "\n" { return anchor + trimmed }
|
||||
return anchor + " " + trimmed
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user