Skip to content

VoiceStudio is the open-source, fully-local ElevenLabs alternative — voice cloning, voice design, video dubbing, dictation, transcription & audiobook creation in 646 languages.

fix(ios): simplify creation screens and support older SDKs

debpalashfd351ce84914
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 654c268c0..3a5b9178d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -22,7 +22,7 @@ metadata and the backend fallback mirror it.
- Contributor guides and the pull request template explain how to sign the CLA before opening a first pull request (#2676)
### Fixed
-- Refined iOS navigation, creation workspaces and licence sheets with native controls, accessible text and explicit cancellation. (#2969)
+- Refined iOS navigation, voice libraries, grouped creation forms and licence sheets with native controls, accessible text and explicit cancellation. (#2969)
- Phone apps open on an Electron-style Home dashboard with shared artwork, workspace shortcuts, recent audio, saved voices and resumable dubbing projects (#2969)
diff --git a/mobile/ios/README.md b/mobile/ios/README.md
index 8fcbe09d4..55aa7f12e 100644
--- a/mobile/ios/README.md
+++ b/mobile/ios/README.md
@@ -121,7 +121,7 @@ inference runs below and do not establish physical-phone memory or thermal limit
Local validation on 2026-10-18 passes the Swift 6 package suite (optional inference tests run separately), resource checks, pinned iOS xcframework builds, SwiftUI compilation, the simulator app build, and the unsigned iPhone Release build. Shared contract, theme-token and contact-email checks also pass. Separate opt-in runs exercise all three actual native libraries, Kitten/Whisper/Zipformer inference, phone reference creation and cloned Speak, and the complete audio dub workflow with native translation/cloning and checkpoint reuse. The complete native audio dub smoke passes its French-output, marked export and checkpoint-reuse assertions. Standalone translation, voice creation and cloned Speak pass. The tiny Whisper model can misrecognize the short synthetic source; these tests verify execution and pipeline completion rather than transcription accuracy. The tiny Zipformer recognizes the ending phrase of the synthetic smoke sentence; this is an inference check, not a transcription-accuracy claim.
-`VoiceStudioUITests/PhoneScreens.swift` covers unpaired screens, compact download cards, product names, licence consent, picker selection, dictation action placement and collapsed details; `ScreenshotTour` captures phone and computer screens plus palette/language pickers as retained Xcode test attachments. Validation on 2026-10-19 under full Xcode passes all 18 existing UI scenarios together on the iPhone Duo simulator with iOS 27.1, including Home navigation and dark/light screenshots; the added destructive phone-history scenario passes separately. The 116-test Kit suite also passes, with five opt-in inference scenarios skipped in that run. The tests cover consent, optional pairing, generation/playback, phone download and licence gates, voice/dub screens, keyboard handling, search, and theme selection. They support both bottom tabs and adaptive side navigation. Download cards preserve separate accessibility identities for opening Models and starting a download. Physical-device model RAM/thermal behavior, download/cellular transitions, microphone/local-network/QR permissions, VoiceOver across all screens, background uploads and real-host end-to-end workflows still require device validation. A signed development Release build was installed and launched on the connected iPhone running iOS 27.0.1 on 2026-10-19, with compact leading tab titles and Settings/Dictate visually checked. macOS inference does not prove iOS execution.
+`VoiceStudioUITests/PhoneScreens.swift` covers unpaired screens, compact download cards, product names, licence consent, picker selection, dictation action placement and collapsed details; `ScreenshotTour` captures phone and computer screens plus palette/language pickers as retained Xcode test attachments. Validation on 2026-10-19 under full Xcode exercises 20 UI scenarios on the iPhone 17 Pro simulator with iOS 26.5 across a full run and targeted reruns, including Home navigation, collapsed-tab expansion, dark/light screenshots, destructive phone-history actions and remembered Clone routing. Targeted presentation checks also pass on iOS 27.1. The 116-test Kit suite also passes, with five opt-in inference scenarios skipped in that run. The tests cover consent, optional pairing, generation/playback, phone download and licence gates, voice/dub screens, keyboard handling, search, and theme selection. They support both bottom tabs and adaptive side navigation. Download cards preserve separate accessibility identities for opening Models and starting a download. Physical-device model RAM/thermal behavior, download/cellular transitions, microphone/local-network/QR permissions, VoiceOver across all screens, background uploads and real-host end-to-end workflows still require device validation. A signed development Release build was installed and launched on the connected iPhone running iOS 27.0.1 on 2026-10-19, with compact leading tab titles and Settings/Dictate visually checked. macOS inference does not prove iOS execution.
Contract interpretations: Get starts a queue with separate per-model acceptance; declining or dismissing stops the unstarted remainder while already authorized transfers continue. The compact card links to Models through its label. The optional catalogue `licence.terms` contains the full disclosure and is displayed when supplied; the fingerprint remains catalogue-authoritative. HF's signed delivery CDNs are allowed only within its HF-owned delivery domains, because normal model resolve URLs redirect there. Downloads resume at verified range boundaries rather than URLSession opaque resume blobs. The pinned llama prebuilt lacks a simulator slice, so that slice is built from the same pinned source. Missing transitive SHA-256 fields in shared pins are documented in the native README. For dubbing, “segments + timestamps” means one timed speech envelope per bounded Whisper window, matching Android; it does not imply diarization. A remembered computer route falls back while unpaired because its segmented control is hidden. A cancelled dub stays resumable; deletion is explicit. iOS background resume is a user-started Resume after foregrounding, not guaranteed background compute. The real iOS video regression verifies AVC/AAC muxing and compressed-source extraction; physical-device codec behavior remains a separate check.
@@ -148,6 +148,17 @@ Projects, and a smaller, Dynamic Type-aware Home wordmark.
Speak and Dictate keep their main actions inside the bottom safe area. Clone
creation and QR scanning use full-screen workspaces.
+Voices presents the library with one creation action; search appears when voices
+exist, and model setup belongs to the creation flow. Clone groups related inputs into
+native form sections. Dub uses one source picker and a compact group for target
+languages, voice and permission, with advanced settings collapsed and one standard
+native Start dubbing action. Speak uses labeled voice/model/language rows with
+readable values and an overlaid editor placeholder, and Dictate groups recording,
+copying and sharing in one bottom control row. Model download notices use compact
+name/size summaries. Clone remembers its phone/computer choice between presentations.
+Newer native toolbar and tab-bar APIs are guarded at both compiler and runtime
+boundaries so older supported Xcode SDKs can still build the app.
+
Model licence review keeps the exact terms readable in a large sheet. Technical
fingerprints are expandable, confirmation starts unchecked and Accept stays
visible but disabled until confirmation. Close never accepts or starts a download.
diff --git a/mobile/ios/VoiceStudio/App/ThemeUI.swift b/mobile/ios/VoiceStudio/App/ThemeUI.swift
index 0638d2558..3b2a325e0 100644
--- a/mobile/ios/VoiceStudio/App/ThemeUI.swift
+++ b/mobile/ios/VoiceStudio/App/ThemeUI.swift
@@ -54,12 +54,16 @@ extension View {
private struct StudioLeadingTitle: ToolbarContent {
let title: String
@ToolbarContentBuilder var body: some ToolbarContent {
+ #if compiler(>=6.2)
if #available(iOS 26.0, *) {
ToolbarItem(placement: .topBarLeading) { label }
.sharedBackgroundVisibility(.hidden)
} else {
ToolbarItem(placement: .topBarLeading) { label }
}
+ #else
+ ToolbarItem(placement: .topBarLeading) { label }
+ #endif
}
private var label: some View {
Text(title).font(.headline).fixedSize(horizontal: true, vertical: false)
@@ -79,16 +83,22 @@ struct Page<Content: View>: View {
@Environment(AppModel.self) private var model
let content: Content
let backgroundRole: String
- init(backgroundRole: String = "canvas", @ViewBuilder content: () -> Content) { self.backgroundRole = backgroundRole; self.content = content() }
+ let fill: Bool
+ init(backgroundRole: String = "canvas", fill: Bool = false, @ViewBuilder content: () -> Content) {
+ self.backgroundRole = backgroundRole; self.fill = fill; self.content = content()
+ }
var body: some View {
- ScrollView {
- VStack(alignment: .leading, spacing: VSTokens.spacingGap) {
- if model.loading {
- ProgressView(model.t("common.loading")).frame(minHeight: 44).accessibilityIdentifier("page.loading")
+ GeometryReader { geometry in
+ ScrollView {
+ VStack(alignment: .leading, spacing: VSTokens.spacingGap) {
+ if model.loading {
+ ProgressView(model.t("common.loading")).frame(minHeight: 44).accessibilityIdentifier("page.loading")
+ }
+ content
}
- content
+ .frame(minHeight: fill ? max(0, geometry.size.height - Theme.compactInset * 2) : nil)
+ .padding(Theme.compactInset).frame(maxWidth: .infinity, alignment: .leading)
}
- .padding(Theme.compactInset).frame(maxWidth: .infinity, alignment: .leading)
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(theme.color(backgroundRole).ignoresSafeArea())
@@ -210,7 +220,11 @@ struct ConsentView: View {
private struct StudioTabBehavior: ViewModifier {
@ViewBuilder func body(content: Content) -> some View {
+ #if compiler(>=6.2)
if #available(iOS 26.0, *) { content.tabBarMinimizeBehavior(.onScrollDown) }
else { content }
+ #else
+ content
+ #endif
}
}
diff --git a/mobile/ios/VoiceStudio/Features/DictateView.swift b/mobile/ios/VoiceStudio/Features/DictateView.swift
index 26f28d5ac..ba1055e2c 100644
--- a/mobile/ios/VoiceStudio/Features/DictateView.swift
+++ b/mobile/ios/VoiceStudio/Features/DictateView.swift
@@ -24,9 +24,8 @@ struct DictateView: View {
@State private var audio = DictationAudio()
@State private var stream = DictationStream()
var body: some View {
- Page {
+ Page(fill: true) {
RunOnPicker(preference: $preference, task: "dictate", installed: localReady).disabled(listening || finalizing)
- if route == .download { LocalDownloadPrompt(items: phoneModel.map { [$0] } ?? [], feature: "mobile.tabs.dictate") }
if route == .connect { NavigationLink(model.t("mobile.settings.connection")) { ConnectView() } }
if checking { ProgressView(model.t("common.loading")) }
else if !ready && route == .computer {
@@ -34,11 +33,13 @@ struct DictateView: View {
Button(model.t("mobile.simple.retry")) { Task { await readiness() } }
}
if text.isEmpty {
+ Spacer(minLength: 0)
ContentUnavailableView {
- Label(model.t("mobile.tabs.dictate"), systemImage: "waveform")
+ Label(model.t("mobile.ios.transcript"), systemImage: "waveform")
} description: {
Text(model.t("mobile.dictate.tap_to_start"))
- }.frame(minHeight: 240)
+ }
+ Spacer(minLength: 0)
} else {
Text(text).font(.title3).frame(maxWidth: .infinity, minHeight: 240, alignment: .topLeading)
.textSelection(.enabled).accessibilityLabel(model.t("mobile.ios.transcript"))
@@ -46,15 +47,20 @@ struct DictateView: View {
}.studioNavigationTitle(model.t("mobile.tabs.dictate"))
.safeAreaInset(edge: .bottom, spacing: 0) {
VStack(spacing: VSTokens.spacingGap) {
- recordControl
- HStack(spacing: VSTokens.spacingGap) {
- Button(model.t("mobile.dictate.copy"), systemImage: "doc.on.doc") { UIPasteboard.general.string = text }
- .accessibilityIdentifier("dictate.copy")
- ShareLink(item: text) { Label(model.t("mobile.speak.share"), systemImage: "square.and.arrow.up") }
- .accessibilityIdentifier("dictate.share")
- }.labelStyle(.iconOnly).studioButton(.tertiary).disabled(text.isEmpty)
- .frame(maxWidth: .infinity).padding(Theme.compactInset).background(.bar)
- }
+ if route == .download {
+ LocalDownloadPrompt(items: phoneModel.map { [$0] } ?? [], feature: "mobile.tabs.dictate")
+ .padding(.horizontal, Theme.compactInset)
+ }
+ HStack(spacing: VSTokens.spacingGap) {
+ Button(model.t("mobile.dictate.copy"), systemImage: "doc.on.doc") { UIPasteboard.general.string = text }
+ .labelStyle(.iconOnly).studioButton(.tertiary).disabled(text.isEmpty)
+ .frame(maxWidth: .infinity).accessibilityIdentifier("dictate.copy")
+ recordControl
+ ShareLink(item: text) { Label(model.t("mobile.speak.share"), systemImage: "square.and.arrow.up") }
+ .labelStyle(.iconOnly).studioButton(.tertiary).disabled(text.isEmpty)
+ .frame(maxWidth: .infinity).accessibilityIdentifier("dictate.share")
+ }.padding(.horizontal, Theme.compactInset).padding(.vertical, VSTokens.spacingGap / 2)
+ }.background(.bar)
}
.task { preference = model.phone.preference("dictate"); await model.phone.refresh(); await readiness() }
.onChange(of: preference) { _, _ in Task { await readiness() } }
diff --git a/mobile/ios/VoiceStudio/Features/DubView.swift b/mobile/ios/VoiceStudio/Features/DubView.swift
index 1532126e2..741eb185e 100644
--- a/mobile/ios/VoiceStudio/Features/DubView.swift
+++ b/mobile/ios/VoiceStudio/Features/DubView.swift
@@ -36,31 +36,15 @@ struct ComputerDubView: View {
var body: some View {
Page {
if model.connection.client == nil { NavigationLink(model.t("mobile.settings.connection")) { ConnectView() } }
- Card {
- Label(model.t("mobile.simple.source"), systemImage: "doc")
- Button(model.t("mobile.dub.pick_media"), systemImage: "doc.badge.plus") { importing = true }
- if let selectedFile { SelectedFileRow(name: selectedFile.name) { self.selectedFile = nil } }
- TextField(model.t("mobile.dub.paste_url"), text: $sourceURL).keyboardType(.URL).textInputAutocapitalization(.never).autocorrectionDisabled().accessibilityIdentifier("dub.source_url")
- Label(model.t("mobile.simple.languages"), systemImage: "globe")
+ DubSourceButton { importing = true }
+ if let selectedFile { SelectedFileRow(name: selectedFile.name) { self.selectedFile = nil } }
+ TextField(model.t("mobile.dub.paste_url"), text: $sourceURL).keyboardType(.URL).textInputAutocapitalization(.never).autocorrectionDisabled().accessibilityIdentifier("dub.source_url")
+ DubSetupCard {
Button { selectingLanguages = true } label: {
- HStack(spacing: VSTokens.spacingGap) {
- Image(systemName: "globe").accessibilityHidden(true)
- SelectionRow(label: model.t("mobile.dub.target_languages"), value: ListFormatter.localizedString(byJoining: languages.filter { selected.contains($0.code) }.map(\.name)))
- }
+ SelectionRow(label: model.t("mobile.dub.target_languages"), value: ListFormatter.localizedString(byJoining: languages.filter { selected.contains($0.code) }.map(\.name)))
}.studioButton(.tertiary).accessibilityIdentifier("dub.languages")
- ScrollView(.horizontal) {
- HStack(spacing: VSTokens.spacingGap) {
- ForEach(languages.filter { selected.contains($0.code) }) { language in
- Button { selected.remove(language.code) } label: {
- HStack(spacing: VSTokens.spacingGap) { Text(language.name); Image(systemName: "xmark") }
- }.accessibilityLabel(model.t("mobile.dub.remove_language", ["language": language.name]))
- }
- }
- }
- Label(model.t("mobile.simple.voice"), systemImage: "person")
+ Divider()
VoicePicker(selection: $profile, dubbing: true)
- Button(model.t("mobile.simple.dub"), systemImage: "film") { Task { await start() } }
- .studioButton(.primary).disabled(model.connection.client == nil || profile == DubVoiceChoice.unselected || model.busy || upload.pending != nil || selected.isEmpty || (selectedFile == nil && sourceURL.isEmpty) || model.dub.monitoring)
}
if let pending = upload.pending {
Card {
@@ -93,9 +77,8 @@ struct ComputerDubView: View {
}
}
}
- Text(model.t("mobile.dub.history"))
- if model.dubHistory.isEmpty && !model.loading { EmptyState(key: "mobile.simple.empty_dubs", icon: "film") }
if !model.dubHistory.isEmpty {
+ Text(model.t("mobile.dub.history")).font(.headline)
Card {
ForEach(model.dubHistory) { item in
ViewThatFits(in: .horizontal) {
@@ -112,7 +95,12 @@ struct ComputerDubView: View {
}
}
}
- }.navigationTitle(model.t("mobile.tabs.dub")).navigationBarTitleDisplayMode(.inline)
+ }
+ .navigationTitle(model.t("mobile.tabs.dub")).navigationBarTitleDisplayMode(.inline)
+ .safeAreaInset(edge: .bottom, spacing: 0) {
+ DubStartButton { Task { await start() } }
+ .disabled(model.connection.client == nil || profile == DubVoiceChoice.unselected || model.busy || upload.pending != nil || selected.isEmpty || (selectedFile == nil && sourceURL.isEmpty) || model.dub.monitoring)
+ }
.fileImporter(isPresented: $importing, allowedContentTypes: [.movie, .audio]) { result in
switch result { case .success(let url): selectedFile = SelectedMedia(url: url); sourceURL = ""; case .failure: model.error = ClientError("mobile.errors.file") }
}
@@ -200,3 +188,43 @@ struct ShareSheet: UIViewControllerRepresentable {
func makeUIViewController(context: Context) -> UIActivityViewController { UIActivityViewController(activityItems: items, applicationActivities: nil) }
func updateUIViewController(_ uiViewController: UIActivityViewController, context: Context) {}
}
+
+/// Keep both processing routes in the same compact creation layout.
+struct DubSourceButton: View {
+ @Environment(AppModel.self) private var model
+ @Environment(\.vsTheme) private var theme
+ let action: () -> Void
+ var body: some View {
+ Button(action: action) {
+ HStack(spacing: VSTokens.spacingGap) {
+ Image(systemName: "doc.badge.plus").font(.title2).foregroundStyle(theme.color("messageAction"))
+ .accessibilityHidden(true)
+ Text(model.t("mobile.dub.pick_media")).font(.headline).frame(maxWidth: .infinity, alignment: .leading)
+ Image(systemName: "chevron.right").font(.subheadline).foregroundStyle(theme.color("iconMuted"))
+ .accessibilityHidden(true)
+ }.frame(minHeight: 44).padding(Theme.compactInset)
+ .background(theme.color("surface"), in: RoundedRectangle(cornerRadius: VSTokens.iosCardRadius))
+ .contentShape(Rectangle())
+ }.buttonStyle(.plain)
+ }
+}
+struct DubSetupCard<Content: View>: View {
+ @Environment(\.vsTheme) private var theme
+ let content: Content
+ init(@ViewBuilder content: () -> Content) { self.content = content() }
+ var body: some View {
+ VStack(spacing: 0) { content }
+ .padding(.horizontal, Theme.compactInset).padding(.vertical, VSTokens.spacingGap / 2)
+ .background(theme.color("surface"), in: RoundedRectangle(cornerRadius: VSTokens.iosCardRadius))
+ }
+}
+struct DubStartButton: View {
+ @Environment(AppModel.self) private var model
+ let action: () -> Void
+ var body: some View {
+ Button(action: action) {
+ Text(model.t("mobile.dub.start")).font(.headline).frame(maxWidth: .infinity)
+ }.studioButton(.primary).accessibilityIdentifier("dub.start")
+ .padding(.horizontal, Theme.compactInset).padding(.vertical, VSTokens.spacingGap / 2)
+ }
+}
diff --git a/mobile/ios/VoiceStudio/Features/ModelsView.swift b/mobile/ios/VoiceStudio/Features/ModelsView.swift
index ab0eeaf14..b4c50dd2e 100644
--- a/mobile/ios/VoiceStudio/Features/ModelsView.swift
+++ b/mobile/ios/VoiceStudio/Features/ModelsView.swift
@@ -139,6 +139,7 @@ struct ModelDownloadButton: View {
queue = ModelDownloadQueue(items); advance()
}
}.disabled(items.isEmpty || !items.allSatisfy { $0.fits() })
+ .studioButton(.tertiary)
.accessibilityIdentifier("models.get")
.sheet(item: $reviewing, onDismiss: {
if continueDownloads { continueDownloads = false; advance() }
@@ -178,8 +179,10 @@ struct RunOnPicker: View {
}
struct LocalDownloadPrompt: View {
@Environment(AppModel.self) private var model
+ @Environment(\.vsTheme) private var theme
let items: [PhoneModel]
let feature: String
+ var compact = false
private var needed: [PhoneModel] { items.filter { !model.phone.ready($0) } }
private var progress: Double? {
guard needed.contains(where: { model.phone.progress[$0.id] != nil }) else { return nil }
@@ -195,26 +198,34 @@ struct LocalDownloadPrompt: View {
}
var body: some View {
if !needed.isEmpty {
- Card {
+ Group {
+ if compact { summary.padding(.horizontal, Theme.compactInset) }
+ else { Card { summary } }
+ }.accessibilityElement(children: .contain).accessibilityIdentifier("models.prompt")
+ }
+ }
+ private var summary: some View {
+ VStack(alignment: .leading, spacing: VSTokens.spacingGap / 2) {
HStack(spacing: VSTokens.spacingGap) {
NavigationLink { ModelsView() } label: {
HStack(spacing: VSTokens.spacingGap) {
Image(systemName: "arrow.down.circle").accessibilityHidden(true)
VStack(alignment: .leading, spacing: 4) {
- Text(title)
if let item = needed.first, needed.count == 1 {
- Text(model.t("mobile.simple." + item.capability.rawValue)).font(.caption)
+ Text(item.name).font(.subheadline.weight(.medium))
+ Text(size).font(.caption).foregroundStyle(theme.color("textMuted"))
+ } else {
+ Text(title).font(.subheadline.weight(.medium))
}
}.frame(maxWidth: .infinity, alignment: .leading)
}
- }.studioButton(.tertiary).accessibilityIdentifier("models.open")
+ }.studioButton(.tertiary).accessibilityIdentifier("models.open").accessibilityLabel(title)
ModelDownloadButton(items: needed)
}
if let progress { ProgressView(value: progress).accessibilityLabel(model.t("mobile.local.download")) }
if let item = needed.first(where: { !$0.fits() }) {
Text(model.t("mobile.simple.ram", ["ram": String(item.min_ram_gb)])).font(.caption)
}
- }.accessibilityElement(children: .contain).accessibilityIdentifier("models.prompt")
}
}
}
diff --git a/mobile/ios/VoiceStudio/Features/PhoneDubView.swift b/mobile/ios/VoiceStudio/Features/PhoneDubView.swift
index f1ee49576..fe1b7f824 100644
--- a/mobile/ios/VoiceStudio/Features/PhoneDubView.swift
+++ b/mobile/ios/VoiceStudio/Features/PhoneDubView.swift
@@ -27,74 +27,76 @@ struct PhoneDubView: View {
var body: some View {
Page {
if projectID == nil && !libraryOnly {
- if connect { NavigationLink(model.t("mobile.simple.reconnect")) { ConnectView() } }
- Label(model.t("mobile.simple.source"),systemImage: "doc")
- Button(model.t("mobile.dub.pick_media"),systemImage: "doc.badge.plus") { importing = true }.disabled(copying)
- if let source { SelectedFileRow(name: source.name) { self.source = nil } }
- Label(model.t("mobile.simple.languages"),systemImage: "globe")
- Button { languages = true } label: {
- HStack(spacing: VSTokens.spacingGap) {
- Image(systemName: "globe").accessibilityHidden(true)
- SelectionRow(label: model.t("mobile.dub.target_languages"),value: ListFormatter.localizedString(byJoining: choices.filter { targets.contains($0.code) }.map(\.name)))
+ if connect { NavigationLink(model.t("mobile.simple.reconnect")) { ConnectView() } }
+ DubSourceButton { importing = true }.disabled(copying)
+ if let source { SelectedFileRow(name: source.name) { self.source = nil } }
+ DubSetupCard {
+ Button { languages = true } label: {
+ SelectionRow(label: model.t("mobile.dub.target_languages"), value: ListFormatter.localizedString(byJoining: choices.filter { targets.contains($0.code) }.map(\.name)))
+ }.studioButton(.tertiary).accessibilityIdentifier("dub.languages")
+ Divider()
+ ChoicePicker(label: model.t("mobile.speak.voice"), selection: $voice, options: [SelectionOption(id: "", title: model.t("mobile.simple.reference"))] + model.phone.voices.map { SelectionOption(id: $0.id.uuidString, title: $0.name) })
+ Divider()
+ HStack {
+ Toggle(model.t("mobile.simple.voice_consent"), isOn: $consent).font(.subheadline).frame(minHeight: 44)
+ InfoButton(title: model.t("mobile.voices.consent_title"), detail: model.t("mobile.voices.consent_body"))
+ }
}
- }.studioButton(.tertiary).accessibilityIdentifier("dub.languages")
- ScrollView(.horizontal) {
- HStack { ForEach(choices.filter { targets.contains($0.code) }) { language in
- Button(language.name,systemImage: "xmark") { targets.remove(language.code) }.accessibilityLabel(model.t("mobile.dub.remove_language",["language": language.name]))
- } }
- }
- Label(model.t("mobile.simple.voice"),systemImage: "person")
- ChoicePicker(label: model.t("mobile.speak.voice"),selection: $voice,options: [SelectionOption(id: "",title: model.t("mobile.simple.reference"))]+model.phone.voices.map { SelectionOption(id: $0.id.uuidString,title: $0.name) },compact: true)
- HStack {
- Toggle(model.t("mobile.simple.voice_consent"),isOn: $consent).frame(minHeight: 44)
- InfoButton(title: model.t("mobile.voices.consent_title"),detail: model.t("mobile.voices.consent_body"))
+ DisclosureGroup(model.t("mobile.simple.more")) {
+ Toggle(model.t("mobile.simple.audio_only"), isOn: $audioOnly).frame(minHeight: 44)
+ phoneModel("dub-asr", .asr)
+ phoneModel("dub-translate", .translate)
+ phoneModel("dub", .clone)
+ }.padding(.horizontal, Theme.compactInset)
+ .disabled(copying || model.phone.activeDub != nil)
+ if !ready { LocalDownloadPrompt(items: model.phone.dubModels, feature: "mobile.tabs.dub", compact: true) }
+ if copying { ProgressView().accessibilityLabel(model.t("mobile.ios.progress")) }
}
- DisclosureGroup(model.t("mobile.simple.more")) {
- Toggle(model.t("mobile.simple.audio_only"),isOn: $audioOnly).frame(minHeight: 44)
- phoneModel("dub-asr",.asr)
- phoneModel("dub-translate",.translate)
- phoneModel("dub",.clone)
- }.disabled(copying || model.phone.activeDub != nil)
- LocalDownloadPrompt(items: model.phone.dubModels, feature: "mobile.tabs.dub")
- Button(model.t("mobile.simple.dub"),systemImage: "film") { start() }.studioButton(.primary)
- .disabled(!ready || !consent || source == nil || targets.isEmpty || model.busy || copying || model.phone.activeDub != nil)
- .accessibilityIdentifier("dub.start")
- if copying { ProgressView().accessibilityLabel(model.t("mobile.ios.progress")) }
- }
- ForEach(records.filter { !$0.checkpoint.done }) { record in
- Card {
- Text(record.request.title).lineLimit(1)
- let progress = model.phone.activeDub == record.id ? model.phone.dubProgress : nil
- let percent = progress?.percent ?? record.checkpoint.percent
- HStack {
- Text(model.t(progress?.stage ?? record.checkpoint.stage)).frame(maxWidth: .infinity,alignment: .leading)
- Text(model.t("mobile.simple.percent",["percent": String(percent)]))
+ if !records.isEmpty || libraryOnly || projectID != nil {
+ Text(model.t("mobile.dub.history")).font(.headline)
+ Group {
+ ForEach(records.filter { !$0.checkpoint.done }) { record in
+ Card {
+ Text(record.request.title).lineLimit(1)
+ let progress = model.phone.activeDub == record.id ? model.phone.dubProgress : nil
+ let percent = progress?.percent ?? record.checkpoint.percent
+ HStack {
+ Text(model.t(progress?.stage ?? record.checkpoint.stage)).frame(maxWidth: .infinity,alignment: .leading)
+ Text(model.t("mobile.simple.percent",["percent": String(percent)]))
+ }
+ ProgressView(value: Double(percent)/100).accessibilityLabel(model.t("mobile.ios.progress"))
+ if model.phone.activeDub == record.id {
+ Button(model.t("common.cancel"),systemImage: "xmark") { model.phone.cancelDub() }
+ } else {
+ HStack {
+ Button(model.t("mobile.simple.resume"),systemImage: "play.fill") { model.phone.startDub(record.id) }.disabled(model.phone.activeDub != nil || model.busy)
+ Button(model.t("mobile.simple.remove_job"),systemImage: "trash",role: .destructive) { remove(record) }.labelStyle(.iconOnly)
+ }
+ }
+ }
}
- ProgressView(value: Double(percent)/100).accessibilityLabel(model.t("mobile.ios.progress"))
- if model.phone.activeDub == record.id {
- Button(model.t("common.cancel"),systemImage: "xmark") { model.phone.cancelDub() }
- } else {
- HStack {
- Button(model.t("mobile.simple.resume"),systemImage: "play.fill") { model.phone.startDub(record.id) }.disabled(model.phone.activeDub != nil || model.busy)
- Button(model.t("mobile.simple.remove_job"),systemImage: "trash",role: .destructive) { remove(record) }.labelStyle(.iconOnly)
+ if records.isEmpty { EmptyState(key: "mobile.simple.empty_dubs",icon: "film") }
+ ForEach(records) { record in
+ ForEach(record.checkpoint.outputs) { output in
+ HStack {
+ VStack(alignment: .leading) { Text(record.request.title).lineLimit(1); Text(output.name).font(.caption).foregroundStyle(theme.color("textMuted")) }.frame(maxWidth: .infinity,alignment: .leading)
+ Button(model.t("common.play"),systemImage: "play.fill") { open(record,output,action: .play) }
+ Button(model.t("mobile.speak.share"),systemImage: "square.and.arrow.up") { open(record,output,action: .share) }
+ Button(model.t("common.save"),systemImage: "arrow.down.to.line") { open(record,output,action: .save) }
+ if record.checkpoint.done { Button(model.t("mobile.simple.remove_job"),systemImage: "trash",role: .destructive) { remove(record) } }
+ }.labelStyle(.iconOnly).studioButton(.tertiary)
}
}
}
}
- Text(model.t("mobile.dub.history"))
- if records.allSatisfy({ $0.checkpoint.outputs.isEmpty }) { EmptyState(key: "mobile.simple.empty_dubs",icon: "film") }
- ForEach(records) { record in
- ForEach(record.checkpoint.outputs) { output in
- HStack {
- VStack(alignment: .leading) { Text(record.request.title).lineLimit(1); Text(output.name).font(.caption).foregroundStyle(theme.color("textMuted")) }.frame(maxWidth: .infinity,alignment: .leading)
- Button(model.t("common.play"),systemImage: "play.fill") { open(record,output,action: .play) }
- Button(model.t("mobile.speak.share"),systemImage: "square.and.arrow.up") { open(record,output,action: .share) }
- Button(model.t("common.save"),systemImage: "arrow.down.to.line") { open(record,output,action: .save) }
- if record.checkpoint.done { Button(model.t("mobile.simple.remove_job"),systemImage: "trash",role: .destructive) { remove(record) } }
- }.labelStyle(.iconOnly).studioButton(.tertiary)
- }
+ }
+ .navigationTitle(projectID != nil ? (records.first?.request.title ?? model.t("projects.title")) : model.t(libraryOnly ? "projects.title" : "mobile.tabs.dub")).navigationBarTitleDisplayMode(.inline)
+ .safeAreaInset(edge: .bottom, spacing: 0) {
+ if projectID == nil && !libraryOnly {
+ DubStartButton(action: start)
+ .disabled(!ready || !consent || source == nil || targets.isEmpty || model.busy || copying || model.phone.activeDub != nil)
}
- }.navigationTitle(projectID != nil ? (records.first?.request.title ?? model.t("projects.title")) : model.t(libraryOnly ? "projects.title" : "mobile.tabs.dub")).navigationBarTitleDisplayMode(.inline)
+ }
.fileImporter(isPresented: $importing,allowedContentTypes: [.movie,.audio]) { result in
switch result { case .success(let url): source = SelectedMedia(url: url); case .failure: model.error = ClientError("mobile.simple.media_failed") }
}
diff --git a/mobile/ios/VoiceStudio/Features/SpeakView.swift b/mobile/ios/VoiceStudio/Features/SpeakView.swift
index e43bb81c7..ae3c57493 100644
--- a/mobile/ios/VoiceStudio/Features/SpeakView.swift
+++ b/mobile/ios/VoiceStudio/Features/SpeakView.swift
@@ -18,7 +18,6 @@ struct SpeakView: View {
var initialComputerVoiceID: String? = nil
@Environment(AppModel.self) private var model
@Environment(\.vsTheme) private var theme
- @Environment(\.dynamicTypeSize) private var typeSize
@State private var preference: TaskLocation?
@State private var phoneModelID = ""
@State private var speakerID = "0"
@@ -46,67 +45,15 @@ struct SpeakView: View {
var body: some View {
Page {
RunOnPicker(preference: $preference, task: "speak", installed: localReady).disabled(generating)
- if route == .download { LocalDownloadPrompt(items: phoneModel.map { [$0] } ?? [], feature: "mobile.tabs.speak") }
if route == .connect { NavigationLink(model.t("mobile.settings.connection")) { ConnectView() } }
- ZStack(alignment: .topLeading) {
- if text.isEmpty { Text(model.t("mobile.speak.placeholder")).foregroundStyle(theme.color("textMuted")).padding(Theme.compactInset).allowsHitTesting(false) }
- TextEditor(text: $text).frame(minHeight: 240)
- .scrollContentBackground(.hidden).padding(Theme.compactInset)
- .background(theme.color("input"), in: RoundedRectangle(cornerRadius: VSTokens.iosCardRadius, style: .continuous))
- .accessibilityLabel(model.t("mobile.speak.placeholder")).accessibilityIdentifier("speak.text")
- }
- if route != .computer {
- pickerLayout {
- ChoicePicker(label: model.t("mobile.speak.voice"), selection: $speakerID, options: (0..<min(128,Int(phoneModel?.config["num_speakers"]?.number ?? 1))).map { SelectionOption(id: String($0), title: model.t("mobile.local.preset_voice", ["number": String($0 + 1)])) } + model.phone.voices.map { SelectionOption(id: "phone:"+$0.id.uuidString,title: $0.name) }, compact: true)
- ChoicePicker(label: model.t("mobile.local.models"), selection: Binding(get: { phoneModel?.id ?? "" }, set: { phoneModelID = $0; model.phone.chooseModel("speak-"+capability.rawValue,$0) }), options: model.phone.candidates(capability).map { SelectionOption(id: $0.id, title: $0.name, subtitle: model.t("mobile.simple." + $0.capability.rawValue), enabled: $0.fits()) }, compact: true)
- ChoicePicker(label: model.t("mobile.speak.language"), selection: $phoneLanguage, options: phoneVoice == nil ? (phoneModel?.languages ?? []).map { SelectionOption(id: $0, title: Locale(identifier: model.l10n.locale).localizedString(forLanguageCode: $0) ?? $0) } : [SelectionOption(id: "auto",title: model.t("mobile.ios.language_auto"))], compact: true)
-
- }.disabled(generating)
- } else {
- HStack(spacing: VSTokens.spacingGap) {
- VoicePicker(selection: Binding(get: { selection.profileID }, set: {
- selection.chooseProfile($0, profiles: model.profiles, inventory: model.inventory, catalog: model.languages)
- }), compact: true)
- ChoicePicker(label: model.t("mobile.speak.engine"), selection: $selection.engineID, options: engines, compact: true).accessibilityIdentifier("speak.engine")
- ChoicePicker(label: model.t("mobile.speak.language"), selection: $selection.language,
- options: model.languages.languages.map { SelectionOption(id: $0.value, title: $0.name) }, compact: true).accessibilityIdentifier("speak.language")
- }
- }
+ speechEditor
+ speechOptions
+ if route == .download { LocalDownloadPrompt(items: phoneModel.map { [$0] } ?? [], feature: "mobile.tabs.speak") }
if player.file != nil || player.playing { AudioPlayerView(player: player) }
- Text(model.t("mobile.speak.recent")).font(.headline)
- if route != .computer {
- if model.phone.recent.isEmpty { EmptyState(key: "mobile.simple.empty_recent") }
- ForEach(model.phone.recent) { item in
- HStack {
- Text(item.text).lineLimit(1).frame(maxWidth: .infinity,alignment: .leading)
- Button(model.t("common.play"),systemImage: "play.fill") { Task { await model.performPhone {
- guard let store = model.phone.generationStore else { throw ClientError("mobile.errors.file") }
- try await player.load(Data(contentsOf: await store.file(item)),extension: "wav"); player.play()
- } } }
- Button(model.t("common.delete"),systemImage: "trash",role: .destructive) { Task { await model.performPhone { try await model.phone.generationStore?.delete(item); await model.phone.refresh() } } }
- }.labelStyle(.iconOnly).studioButton(.tertiary)
- }
- } else if model.history.isEmpty && !model.loading { EmptyState(key: "mobile.simple.empty_recent") }
- else {
- Card {
- ForEach(model.history) { item in
- HStack(spacing: VSTokens.spacingGap) {
- Text(item.text).lineLimit(1).frame(maxWidth: .infinity, alignment: .leading)
- Button(model.t("common.play"), systemImage: "play.fill") { Task { await model.perform { let api = try model.api(); try await player.stream(request: api.historyAudioRequest(item.id), api: api) } } }
- .labelStyle(.iconOnly).studioButton(.tertiary)
- Menu {
- Button(model.t(item.starred ? "mobile.speak.unstar" : "mobile.speak.star"), systemImage: item.starred ? "star.fill" : "star") { Task { await model.perform { try await model.api().star(item); model.history = try await model.api().history() } } }
- Button(model.t("common.delete"), systemImage: "trash", role: .destructive) { deleting = item }
- } label: { Label(model.t("mobile.ios.more_actions"), systemImage: "ellipsis") }
- .labelStyle(.iconOnly).studioButton(.tertiary).frame(minWidth: 44, minHeight: 44)
- }
- if item.id != model.history.last?.id { Divider().overlay(theme.color("border")) }
- }
- }
- }
- }.navigationTitle(model.t("mobile.tabs.speak")).navigationBarTitleDisplayMode(.large)
+ recentGenerations
+ }.navigationTitle(model.t("mobile.tabs.speak")).navigationBarTitleDisplayMode(.inline)
.safeAreaInset(edge: .bottom, spacing: 0) {
- generationControls.padding(Theme.compactInset).background(.bar)
+ generationControls.padding(.horizontal, Theme.compactInset).padding(.vertical, VSTokens.spacingGap / 2)
}
.onChange(of: model.inventory?.tts.active, initial: true) { _, _ in selection.reconcile(inventory: model.inventory, profiles: model.profiles) }
.onChange(of: model.profiles.map(\.id)) { _, _ in selection.reconcile(inventory: model.inventory, profiles: model.profiles) }
@@ -123,10 +70,75 @@ struct SpeakView: View {
.onChange(of: model.phone.voices) { _, _ in if speakerID.hasPrefix("phone:") && phoneVoice == nil { speakerID = "0" } }
.onDisappear { generation?.cancel(); if hostScope != model.hostState.scopeID { player.clear() } else { player.pause() } }
}
- private var pickerLayout: AnyLayout {
- typeSize.isAccessibilitySize
- ? AnyLayout(VStackLayout(alignment: .leading, spacing: VSTokens.spacingGap))
- : AnyLayout(HStackLayout(spacing: VSTokens.spacingGap))
+ private var speechEditor: some View {
+ ZStack(alignment: .topLeading) {
+ TextEditor(text: $text).frame(minHeight: 200)
+ .scrollContentBackground(.hidden).padding(Theme.compactInset)
+ .background(theme.color("surface"), in: RoundedRectangle(cornerRadius: VSTokens.iosCardRadius, style: .continuous))
+ .accessibilityLabel(model.t("mobile.speak.placeholder")).accessibilityIdentifier("speak.text")
+ if text.isEmpty {
+ Text(model.t("mobile.speak.placeholder")).foregroundStyle(theme.color("textMuted"))
+ .padding(Theme.compactInset).allowsHitTesting(false).accessibilityHidden(true)
+ }
+ }
+ }
+ private var speechOptions: some View {
+ Card {
+ if route != .computer {
+ VStack(alignment: .leading, spacing: 0) {
+ ChoicePicker(label: model.t("mobile.speak.voice"), selection: $speakerID, options: (0..<min(128,Int(phoneModel?.config["num_speakers"]?.number ?? 1))).map { SelectionOption(id: String($0), title: model.t("mobile.local.preset_voice", ["number": String($0 + 1)])) } + model.phone.voices.map { SelectionOption(id: "phone:"+$0.id.uuidString,title: $0.name) }, compact: false)
+ Divider().overlay(theme.color("border"))
+ ChoicePicker(label: model.t("mobile.local.models"), selection: Binding(get: { phoneModel?.id ?? "" }, set: { phoneModelID = $0; model.phone.chooseModel("speak-"+capability.rawValue,$0) }), options: model.phone.candidates(capability).map { SelectionOption(id: $0.id, title: $0.name, subtitle: model.t("mobile.simple." + $0.capability.rawValue), enabled: $0.fits()) }, compact: false)
+ Divider().overlay(theme.color("border"))
+ ChoicePicker(label: model.t("mobile.speak.language"), selection: $phoneLanguage, options: phoneVoice == nil ? (phoneModel?.languages ?? []).map { SelectionOption(id: $0, title: Locale(identifier: model.l10n.locale).localizedString(forLanguageCode: $0) ?? $0) } : [SelectionOption(id: "auto",title: model.t("mobile.ios.language_auto"))], compact: false)
+
+ }.disabled(generating)
+ } else {
+ VStack(alignment: .leading, spacing: 0) {
+ VoicePicker(selection: Binding(get: { selection.profileID }, set: {
+ selection.chooseProfile($0, profiles: model.profiles, inventory: model.inventory, catalog: model.languages)
+ }), compact: false)
+ Divider().overlay(theme.color("border"))
+ ChoicePicker(label: model.t("mobile.speak.engine"), selection: $selection.engineID, options: engines, compact: false).accessibilityIdentifier("speak.engine")
+ Divider().overlay(theme.color("border"))
+ ChoicePicker(label: model.t("mobile.speak.language"), selection: $selection.language,
+ options: model.languages.languages.map { SelectionOption(id: $0.value, title: $0.name) }, compact: false).accessibilityIdentifier("speak.language")
+ }
+ }
+ }
+ }
+ @ViewBuilder private var recentGenerations: some View {
+ Text(model.t("mobile.speak.recent")).font(.headline)
+ if route != .computer {
+ if model.phone.recent.isEmpty { EmptyState(key: "mobile.simple.empty_recent") }
+ ForEach(model.phone.recent) { item in
+ HStack {
+ Text(item.text).lineLimit(1).frame(maxWidth: .infinity,alignment: .leading)
+ Button(model.t("common.play"),systemImage: "play.fill") { Task { await model.performPhone {
+ guard let store = model.phone.generationStore else { throw ClientError("mobile.errors.file") }
+ try await player.load(Data(contentsOf: await store.file(item)),extension: "wav"); player.play()
+ } } }
+ Button(model.t("common.delete"),systemImage: "trash",role: .destructive) { Task { await model.performPhone { try await model.phone.generationStore?.delete(item); await model.phone.refresh() } } }
+ }.labelStyle(.iconOnly).studioButton(.tertiary)
+ }
+ } else if model.history.isEmpty && !model.loading { EmptyState(key: "mobile.simple.empty_recent") }
+ else {
+ Card {
+ ForEach(model.history) { item in
+ HStack(spacing: VSTokens.spacingGap) {
+ Text(item.text).lineLimit(1).frame(maxWidth: .infinity, alignment: .leading)
+ Button(model.t("common.play"), systemImage: "play.fill") { Task { await model.perform { let api = try model.api(); try await player.stream(request: api.historyAudioRequest(item.id), api: api) } } }
+ .labelStyle(.iconOnly).studioButton(.tertiary)
+ Menu {
+ Button(model.t(item.starred ? "mobile.speak.unstar" : "mobile.speak.star"), systemImage: item.starred ? "star.fill" : "star") { Task { await model.perform { try await model.api().star(item); model.history = try await model.api().history() } } }
+ Button(model.t("common.delete"), systemImage: "trash", role: .destructive) { deleting = item }
+ } label: { Label(model.t("mobile.ios.more_actions"), systemImage: "ellipsis") }
+ .labelStyle(.iconOnly).studioButton(.tertiary).frame(minWidth: 44, minHeight: 44)
+ }
+ if item.id != model.history.last?.id { Divider().overlay(theme.color("border")) }
+ }
+ }
+ }
}
private var generationControls: some View {
VStack(spacing: VSTokens.spacingGap) {
@@ -156,7 +168,7 @@ struct SpeakView: View {
}
} label: {
Label(model.t(generating ? "mobile.speak.generating" : "mobile.speak.generate"), systemImage: "waveform")
- .frame(maxWidth: .infinity, minHeight: 44)
+ .frame(maxWidth: .infinity)
}.studioButton(.primary)
.disabled(model.busy || model.phone.activeDub != nil || generating || (route != .phone && route != .computer) || (route == .computer && !selection.canGenerate(in: model.inventory, profiles: model.profiles)) || text.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty)
.accessibilityIdentifier("speak.generate")
diff --git a/mobile/ios/VoiceStudio/Features/VoicesView.swift b/mobile/ios/VoiceStudio/Features/VoicesView.swift
index 84cc1e4c5..a0b42586f 100644
--- a/mobile/ios/VoiceStudio/Features/VoicesView.swift
+++ b/mobile/ios/VoiceStudio/Features/VoicesView.swift
@@ -12,7 +12,6 @@ private struct VoiceEntry: Identifiable {
struct VoicesView: View {
@Environment(AppModel.self) private var model
@Environment(\.vsTheme) private var theme
- @State private var preference: TaskLocation?
@State private var query = ""
@State private var creating = false
@State private var player = AudioPlayer()
@@ -22,21 +21,18 @@ struct VoicesView: View {
@State private var hostScope: UUID?
private var entries: [VoiceEntry] { model.phone.voices.map(VoiceEntry.init) + model.profiles.map(VoiceEntry.init) }
private var filtered: [VoiceEntry] { entries.filter { query.isEmpty || $0.name.localizedCaseInsensitiveContains(query) } }
- private var localReady: Bool { model.phone.selectedModel("clone",.asr).map(model.phone.ready) ?? false }
- private var route: TaskRoute { LocalRouting.route(preference: preference, installed: localReady, paired: model.connection.client != nil) }
var body: some View {
- Page {
- RunOnPicker(preference: $preference, task: "clone", installed: localReady)
- if route == .download { LocalDownloadPrompt(items: model.phone.selectedModel("clone",.asr).map { [$0] } ?? [], feature: "mobile.tabs.voices") }
- SearchField(prompt: model.t("mobile.voices.search"), text: $query)
+ Page(fill: entries.isEmpty && !model.loading) {
if entries.isEmpty && !model.loading {
+ Spacer(minLength: 0)
ContentUnavailableView {
Label(model.t("mobile.simple.empty_voices"), systemImage: "person.wave.2")
} description: {
Text(model.t("clone.reference_hint"))
}
- Button(model.t("mobile.voices.new_clone"), systemImage: "plus") { creating = true }.studioButton(.primary)
+ Spacer(minLength: 0)
} else {
+ SearchField(prompt: model.t("mobile.voices.search"), text: $query)
Card {
if filtered.isEmpty { SearchEmptyState(query: query) }
ForEach(filtered) { entry in
@@ -66,10 +62,22 @@ struct VoicesView: View {
}
if player.file != nil { AudioPlayerView(player: player) }
}.studioNavigationTitle(model.t("mobile.tabs.voices"))
- .toolbar { Button(model.t("mobile.voices.new_clone"),systemImage: "plus") { creating = true }.accessibilityIdentifier("voices.create") }
- .task { preference = model.phone.preference("clone"); await model.phone.refresh() }
+ .safeAreaInset(edge: .bottom, spacing: 0) {
+ if entries.isEmpty && !model.loading {
+ Button { creating = true } label: {
+ Label(model.t("mobile.voices.new_clone"), systemImage: "plus").frame(maxWidth: .infinity)
+ }.studioButton(.primary).accessibilityIdentifier("voices.create")
+ .padding(.horizontal, Theme.compactInset).padding(.vertical, VSTokens.spacingGap / 2)
+ }
+ }
+ .toolbar {
+ if !entries.isEmpty || model.loading {
+ Button(model.t("mobile.voices.new_clone"),systemImage: "plus") { creating = true }.accessibilityIdentifier("voices.create")
+ }
+ }
+ .task { await model.phone.refresh() }
.refreshable { await model.phone.refresh(); if model.connection.client != nil { await model.perform { model.profiles = try await model.api().profiles() } } }
- .fullScreenCover(isPresented: $creating) { NavigationStack { CloneView(preference: preference) }.environment(model) }
+ .fullScreenCover(isPresented: $creating) { NavigationStack { CloneView() }.environment(model) }
.sheet(item: $renamed) { entry in
NavigationStack {
Page(backgroundRole: "surfaceOverlay") {
@@ -98,9 +106,10 @@ struct VoicesView: View {
}
struct CloneView: View {
@Environment(AppModel.self) private var model
+ @Environment(\.vsTheme) private var theme
@Environment(\.dismiss) private var dismiss
@Environment(\.scenePhase) private var phase
- var preference: TaskLocation?
+ @State private var preference: TaskLocation?
@State private var name = ""
@State private var consent = false
@State private var importing = false
@@ -114,20 +123,19 @@ struct CloneView: View {
private var ready: Bool { asr.map(model.phone.ready) ?? false }
private var route: TaskRoute { LocalRouting.route(preference: preference,installed: ready,paired: model.connection.client != nil) }
var body: some View {
- Page(backgroundRole: "surfaceOverlay") {
- if route == .download { LocalDownloadPrompt(items: asr.map { [$0] } ?? [], feature: "mobile.tabs.voices") }
+ Form {
+ if model.connection.client != nil {
+ Section { RunOnPicker(preference: $preference, task: "clone", installed: ready) }
+ }
if route == .connect { NavigationLink(model.t("mobile.simple.reconnect")) { ConnectView() } }
- if route != .computer {
- DisclosureGroup(model.t("mobile.simple.more")) {
- ChoicePicker(label: model.t("mobile.local.models"), selection: Binding(get: { asr?.id ?? "" }, set: { model.phone.chooseModel("clone",$0) }), options: model.phone.candidates(.asr).map { SelectionOption(id: $0.id, title: $0.name, subtitle: model.t("mobile.simple." + $0.capability.rawValue), enabled: $0.fits()) })
+ Section {
+ TextField(model.t("mobile.voices.name_label"),text: $name).textFieldStyle(.plain).accessibilityIdentifier("voices.clone.name")
+ }.listRowBackground(theme.color("surface"))
+ Section {
+ HStack {
+ Toggle(model.t("mobile.simple.voice_consent"),isOn: $consent).frame(minHeight: 44)
+ InfoButton(title: model.t("mobile.voices.consent_title"),detail: model.t("mobile.voices.consent_body"))
}
- }
- TextField(model.t("mobile.voices.name_label"),text: $name).accessibilityIdentifier("voices.clone.name")
- HStack {
- Toggle(model.t("mobile.simple.voice_consent"),isOn: $consent).frame(minHeight: 44)
- InfoButton(title: model.t("mobile.voices.consent_title"),detail: model.t("mobile.voices.consent_body"))
- }
- HStack {
Button(model.t(recorder.recording ? "common.stop" : "mobile.voices.record"),systemImage: recorder.recording ? "stop.fill" : "mic.fill") {
recordingTask = Task { await model.performPhone {
if recorder.recording { recorder.stop(); audio = recorder.file.map { SelectedMedia(url: $0) } }
@@ -135,14 +143,27 @@ struct CloneView: View {
} }
}.disabled(!consent || running)
Button(model.t("mobile.voices.pick_file"),systemImage: "doc") { importing = true }.disabled(recorder.recording || running)
+ if recorder.recording { Text(model.t("mobile.voices.recording",["seconds": String(recorder.seconds)])) }
+ if let audio { SelectedFileRow(name: audio.name) { self.audio = nil } }
+ } footer: { Text(model.t("clone.reference_hint")) }
+ .listRowBackground(theme.color("surface"))
+ if route == .download {
+ Section { LocalDownloadPrompt(items: asr.map { [$0] } ?? [], feature: "mobile.tabs.voices") }
+ .listRowInsets(EdgeInsets()).listRowBackground(Color.clear)
+ }
+ if route != .computer {
+ Section {
+ DisclosureGroup(model.t("mobile.simple.more")) {
+ ChoicePicker(label: model.t("mobile.local.models"), selection: Binding(get: { asr?.id ?? "" }, set: { model.phone.chooseModel("clone",$0) }), options: model.phone.candidates(.asr).map { SelectionOption(id: $0.id, title: $0.name, subtitle: model.t("mobile.simple." + $0.capability.rawValue), enabled: $0.fits()) })
+ }
+ }.listRowBackground(theme.color("surface"))
}
- if recorder.recording { Text(model.t("mobile.voices.recording",["seconds": String(recorder.seconds)])) }
- if let audio { SelectedFileRow(name: audio.name) { self.audio = nil } }
- }.navigationTitle(model.t("mobile.voices.new_clone"))
+ }.scrollContentBackground(.hidden).background(theme.color("canvas").ignoresSafeArea()).keyboardAccessible()
+ .navigationTitle(model.t("mobile.voices.new_clone")).navigationBarTitleDisplayMode(.inline)
.safeAreaInset(edge: .bottom, spacing: 0) {
VStack(spacing: VSTokens.spacingGap) {
Button { create() } label: {
- Label(model.t("mobile.ios.clone_create"), systemImage: "person.badge.plus").frame(maxWidth: .infinity, minHeight: 44)
+ Label(model.t("mobile.ios.clone_create"), systemImage: "person.badge.plus").frame(maxWidth: .infinity)
}
.studioButton(.primary)
.disabled(!consent || name.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty || name.count > 200 || audio == nil || recorder.recording || model.busy || model.phone.activeDub != nil || running || (route != .phone && route != .computer))
@@ -150,12 +171,13 @@ struct CloneView: View {
ProgressView(value: progress).accessibilityLabel(model.t("mobile.ios.progress"))
Button(model.t("common.cancel")) { work?.cancel() }
}
- }.padding(Theme.compactInset).background(.bar)
+ }.padding(.horizontal, Theme.compactInset).padding(.vertical, VSTokens.spacingGap / 2)
}
.toolbar { ToolbarItem(placement: .cancellationAction) { Button(model.t("common.cancel")) { work?.cancel(); recorder.stop(); dismiss() } } }
.fileImporter(isPresented: $importing,allowedContentTypes: [.audio]) { result in
switch result { case .success(let url): audio = SelectedMedia(url: url); case .failure: model.error = ClientError("mobile.errors.file") }
}
+ .task { preference = model.phone.preference("clone") }
.onChange(of: recorder.seconds) { _, seconds in if seconds >= 29 && recorder.recording { recorder.stop(); audio = recorder.file.map { SelectedMedia(url: $0) } } }
.onChange(of: phase) { _, value in if value != .active { work?.cancel(); if value == .background { recordingTask?.cancel() }; if recorder.recording { recorder.stop(); audio = nil } } }
.onDisappear { work?.cancel(); recordingTask?.cancel(); recorder.stop(); if let file = recorder.file { try? FileManager.default.removeItem(at: file) } }
diff --git a/mobile/ios/VoiceStudioUITests/PhoneScreens.swift b/mobile/ios/VoiceStudioUITests/PhoneScreens.swift
index 5719c7902..c98a9a942 100644
--- a/mobile/ios/VoiceStudioUITests/PhoneScreens.swift
+++ b/mobile/ios/VoiceStudioUITests/PhoneScreens.swift
@@ -13,7 +13,7 @@ final class PhoneScreens: XCTestCase {
app.tabButton("Voices").tap(); app.buttons["voices.create"].tap()
XCTAssertTrue(app.buttons["models.get"].waitForExistence(timeout: 5)); app.buttons["Cancel"].tap()
app.tabButton("Dub").tap()
- XCTAssertTrue(app.staticTexts["1 Source"].waitForExistence(timeout: 5))
+ XCTAssertTrue(app.buttons["Choose video or audio"].waitForExistence(timeout: 5))
XCTAssertFalse(app.textFields["dub.source_url"].exists)
}
@MainActor func testChangingSpeechModelResetsUnavailablePreset() {
@@ -37,14 +37,17 @@ final class PhoneScreens: XCTestCase {
XCTAssertFalse(app.buttons["Create clone"].isEnabled)
XCTAssertFalse(app.staticTexts["This task currently runs on your paired computer."].exists)
}
- @MainActor func testUnpairedDubHasSourceLanguagesAndVoiceSteps() {
+ @MainActor func testUnpairedDubKeepsSetupVisibleAndRequiresInput() {
let app = launch(); app.tabButton("Dub").tap()
- for step in ["1 Source","2 Languages","3 Voice"] { XCTAssertTrue(app.staticTexts[step].waitForExistence(timeout: 5)) }
- XCTAssertTrue(app.buttons["Choose video or audio"].exists)
- XCTAssertTrue(app.buttons["dub.languages"].exists)
+ XCTAssertTrue(app.buttons["Choose video or audio"].waitForExistence(timeout: 5))
+ for label in ["Choose video or audio", "dub.languages", "Voice", "models.get"] {
+ XCTAssertTrue(app.buttons[label].isHittable, label)
+ }
+ XCTAssertTrue(app.switches["I have permission"].isHittable)
+ XCTAssertGreaterThanOrEqual(app.buttons["models.get"].frame.height, 44)
XCTAssertFalse(app.buttons["dub.start"].isEnabled)
+ XCTAssertLessThan(app.buttons["dub.start"].frame.height, 72)
XCTAssertFalse(app.textFields["dub.source_url"].exists)
- XCTAssertTrue(app.staticTexts["No dubs"].exists)
}
@MainActor func testModelsTermsRequireExplicitUncheckedConsent() {
let app = launch(); app.tabButton("Settings").tap(); app.buttons["Models"].tap()
diff --git a/mobile/ios/VoiceStudioUITests/SmokeTests.swift b/mobile/ios/VoiceStudioUITests/SmokeTests.swift
index 2a8779149..58335a4f9 100644
--- a/mobile/ios/VoiceStudioUITests/SmokeTests.swift
+++ b/mobile/ios/VoiceStudioUITests/SmokeTests.swift
@@ -5,6 +5,12 @@ extension XCUIApplication {
@MainActor func tabButton(_ label: String) -> XCUIElement {
let tab = tabBars.buttons[label]
if tab.exists { return tab }
+ // iOS 26+ collapses the bar after scrolling. Its selected tab expands it.
+ let selected = tabBars.buttons.firstMatch
+ if selected.exists, (selected.value as? String)?.contains("Collapsed") == true {
+ selected.tap()
+ if tab.waitForExistence(timeout: 3) { return tab }
+ }
let symbols = ["Home": "house", "Voices": "person.wave.2", "Dub": "film", "Dictate": "mic", "Settings": "gearshape"]
return buttons.matching(NSPredicate(format: "label == %@ AND identifier == %@", label, symbols[label] ?? label)).firstMatch
}
@@ -23,6 +29,20 @@ extension XCUIApplication {
}
final class SmokeTests: XCTestCase {
+ @MainActor func testCloneRemembersItsRunLocationAfterDismissal() {
+ let app = XCUIApplication()
+ app.launchArguments = ["--ui-smoke", "-AppleLanguages", "(en)"]
+ app.launch(); connect(app)
+ app.tabButton("Voices").tap(); app.buttons["voices.create"].tap()
+ let phone = app.segmentedControls.buttons["This phone"]
+ XCTAssertTrue(phone.waitForExistence(timeout: 5)); phone.tap()
+ app.buttons["Cancel"].tap()
+ app.buttons["voices.create"].tap()
+ XCTAssertTrue(phone.waitForExistence(timeout: 5))
+ XCTAssertTrue(phone.isSelected)
+ app.buttons["Cancel"].tap()
+ }
+
@MainActor func testDestructivePhoneHistoryAction() {
let app = XCUIApplication()
app.launchArguments = ["--ui-smoke", "--ui-phone-history", "-AppleLanguages", "(en)"]