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.

feat(ios): refine native presentation and compact tab headers

debpalashaff89d811117
diff --git a/.github/workflows/mobile.yml b/.github/workflows/mobile.yml
index a036f3b10..86396caaf 100644
--- a/.github/workflows/mobile.yml
+++ b/.github/workflows/mobile.yml
@@ -182,6 +182,9 @@ jobs:
run: python3 mobile/ios/scripts/fetch-smoke-models.py --accept-test-licences
- name: Real TTS -> ASR
+ env:
+ # Native source metadata uses the same read-only API token as iOS builds.
+ GITHUB_TOKEN: ${{ github.token }}
run: mobile/ios/scripts/real-inference.sh
android-inference:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4229bdbf6..654c268c0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -22,6 +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)
- 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/electron/src/renderer/src/styles/globals.css b/electron/src/renderer/src/styles/globals.css
index 821676b0a..854822f07 100644
--- a/electron/src/renderer/src/styles/globals.css
+++ b/electron/src/renderer/src/styles/globals.css
@@ -72,6 +72,10 @@
}
:root {
+ /* Native iOS content geometry; exported alongside the shared mobile palette. */
+ --ios-card-radius: 1.5rem;
+ --ios-field-radius: 1rem;
+ --ios-home-wordmark-size: 1.75rem;
--workspace-footer-height: 40px;
--control-radius: 0.5rem;
--workspace-gap: 1rem;
diff --git a/mobile/android/app/src/test/kotlin/com/voicestudio/mobile/DubConsentRegressionTest.kt b/mobile/android/app/src/test/kotlin/com/voicestudio/mobile/DubConsentRegressionTest.kt
index 30b784666..9fd65ae94 100644
--- a/mobile/android/app/src/test/kotlin/com/voicestudio/mobile/DubConsentRegressionTest.kt
+++ b/mobile/android/app/src/test/kotlin/com/voicestudio/mobile/DubConsentRegressionTest.kt
@@ -67,7 +67,7 @@ class DubConsentRegressionTest {
compose.onNodeWithText("Target languages").performScrollTo().performClick()
compose.onNodeWithText("Search").performTextInput("French")
compose.onNode(hasText("French") and !hasSetTextAction()).performClick()
- compose.onNodeWithText("Close").performClick()
+ compose.onNodeWithText("Confirm").performClick()
compose.onNodeWithText("Voice").performScrollTo().performClick()
compose.onNodeWithText("Default voice").performClick()
repeat(2) {
diff --git a/mobile/android/app/src/test/kotlin/com/voicestudio/mobile/PickerRegressionTest.kt b/mobile/android/app/src/test/kotlin/com/voicestudio/mobile/PickerRegressionTest.kt
index 7d8195fec..08284f1b6 100644
--- a/mobile/android/app/src/test/kotlin/com/voicestudio/mobile/PickerRegressionTest.kt
+++ b/mobile/android/app/src/test/kotlin/com/voicestudio/mobile/PickerRegressionTest.kt
@@ -62,7 +62,7 @@ class PickerRegressionTest {
compose.onNodeWithText("KittenTTS").assertExists()
assertEquals("active",value)
}
- @Test fun dubPickerSearchSelectCloseAndRemoveChip() {
+ @Test fun dubPickerSearchConfirmAndRemoveChip() {
val choices=LanguageCatalog.load(context).dubChoices()
assertFalse(choices.any {it.second=="Auto"})
content {
@@ -72,7 +72,7 @@ class PickerRegressionTest {
compose.onNodeWithText("Target languages").performClick()
compose.onNodeWithText("Search").performTextInput("French")
compose.onNode(hasText("French") and !hasSetTextAction()).performClick()
- compose.onNodeWithText("Close").performClick()
+ compose.onNodeWithText("Confirm").performClick()
compose.onNodeWithContentDescription("Remove French").assertExists().performClick()
compose.onNodeWithContentDescription("Remove French").assertDoesNotExist()
}
diff --git a/mobile/android/app/src/test/kotlin/com/voicestudio/mobile/ReviewUiRegressionTest.kt b/mobile/android/app/src/test/kotlin/com/voicestudio/mobile/ReviewUiRegressionTest.kt
index 1a90bdf57..a8708e565 100644
--- a/mobile/android/app/src/test/kotlin/com/voicestudio/mobile/ReviewUiRegressionTest.kt
+++ b/mobile/android/app/src/test/kotlin/com/voicestudio/mobile/ReviewUiRegressionTest.kt
@@ -57,6 +57,19 @@ class ReviewUiRegressionTest {
assertNull(vm.api)
} finally {vm.viewModelScope.cancel()}
}
+ @Test fun languageSelectionOnlyAppliesConfirmedDraft() {
+ var selected by mutableStateOf(emptyList<String>())
+ content {MultiPicker("mobile.dub.target_languages",selected,listOf("fr" to "French")) {selected=it}}
+ compose.onNodeWithText("Target languages").performClick()
+ compose.onNodeWithText("French").performClick()
+ assertTrue(selected.isEmpty())
+ compose.onNodeWithText("Cancel").performClick()
+ assertTrue(selected.isEmpty())
+ compose.onNodeWithText("Target languages").performClick()
+ compose.onNodeWithText("French").performClick()
+ compose.onNodeWithText("Confirm").performClick()
+ assertEquals(listOf("fr"),selected)
+ }
@Test fun successfulQrScanExposesAddressPinAndConnect() {
shadowOf(app).grantPermissions(android.Manifest.permission.CAMERA)
val vm=vm()
diff --git a/mobile/android/core/designsystem/src/main/kotlin/com/voicestudio/mobile/designsystem/Tokens.generated.kt b/mobile/android/core/designsystem/src/main/kotlin/com/voicestudio/mobile/designsystem/Tokens.generated.kt
index 72551e981..1f849a720 100644
--- a/mobile/android/core/designsystem/src/main/kotlin/com/voicestudio/mobile/designsystem/Tokens.generated.kt
+++ b/mobile/android/core/designsystem/src/main/kotlin/com/voicestudio/mobile/designsystem/Tokens.generated.kt
@@ -844,4 +844,7 @@ object VSTokens {
const val RADIUS_CONTROL: Float = 8.00f
const val SPACING_GAP: Float = 16.00f
const val SPACING_INSET: Float = 24.00f
+ const val IOS_CARD_RADIUS: Float = 24.00f
+ const val IOS_FIELD_RADIUS: Float = 16.00f
+ const val IOS_HOME_WORDMARK_SIZE: Float = 28.00f
}
diff --git a/mobile/android/features/src/main/kotlin/com/voicestudio/mobile/features/Components.kt b/mobile/android/features/src/main/kotlin/com/voicestudio/mobile/features/Components.kt
index 852b08513..36bcc5068 100644
--- a/mobile/android/features/src/main/kotlin/com/voicestudio/mobile/features/Components.kt
+++ b/mobile/android/features/src/main/kotlin/com/voicestudio/mobile/features/Components.kt
@@ -152,9 +152,10 @@ fun Modifier.dismissKeyboardOnTap(): Modifier = composed {
@OptIn(ExperimentalLayoutApi::class)
@Composable fun MultiPicker(label: String, selected: List<String>, choices: List<Pair<String,String>>, change: (List<String>) -> Unit) {
var open by rememberSaveable {mutableStateOf(false)}
+ var draft by rememberSaveable {mutableStateOf(emptyList<String>())}
var query by rememberSaveable {mutableStateOf("")}
val dismiss=rememberKeyboardDismiss()
- Group {PickerRow(label,selected.mapNotNull {id -> choices.firstOrNull {it.first==id}?.second}.joinToString().ifBlank {tr("mobile.android.choose")},choices.isNotEmpty()) {open=true}}
+ Group {PickerRow(label,selected.mapNotNull {id -> choices.firstOrNull {it.first==id}?.second}.joinToString().ifBlank {tr("mobile.android.choose")},choices.isNotEmpty()) {draft=selected;query="";open=true}}
FlowRow(horizontalArrangement=Arrangement.spacedBy(VSTheme.gap)) {
choices.filter {it.first in selected}.forEach {(id,name) ->
val remove=tr("mobile.android.remove_selection",mapOf("name" to name))
@@ -170,17 +171,18 @@ fun Modifier.dismissKeyboardOnTap(): Modifier = composed {
if(matches.isEmpty()) SearchEmpty(query)
LazyColumn(Modifier.heightIn(max=(VSTokens.SPACING_GAP*20).dp)) {
items(matches,key={it.first}) {(id,name) ->
- Surface(onClick={dismissSearch();change(if(id in selected) selected-id else selected+id)},color=role("surfaceOverlay"),shape=MaterialTheme.shapes.small,
- modifier=Modifier.fillMaxWidth().heightIn(min=VSTheme.touchTarget).semantics {this.selected=id in selected}) {
+ Surface(onClick={dismissSearch();draft=if(id in draft) draft-id else draft+id},color=role("surfaceOverlay"),shape=MaterialTheme.shapes.small,
+ modifier=Modifier.fillMaxWidth().heightIn(min=VSTheme.touchTarget).semantics {this.selected=id in draft}) {
Row(Modifier.padding(VSTheme.inset),verticalAlignment=Alignment.CenterVertically) {
Text(name,Modifier.weight(1f),maxLines=2,overflow=TextOverflow.Ellipsis)
- Checkbox(checked=id in selected,onCheckedChange=null)
+ Checkbox(checked=id in draft,onCheckedChange=null)
}
}
}
}
}
- },confirmButton={TextButton(shape=MaterialTheme.shapes.small,onClick={open=false}) {Text(tr("common.close"))}})
+ },confirmButton={TextButton(shape=MaterialTheme.shapes.small,onClick={change(draft);open=false}) {Text(tr("common.confirm"))}},
+ dismissButton={TextButton(shape=MaterialTheme.shapes.small,onClick={open=false}) {Text(tr("common.cancel"))}})
}
@Composable fun Toggle(key: String, value: Boolean, change: (Boolean) -> Unit) {
val label = tr(key)
diff --git a/mobile/contract/SPEC.md b/mobile/contract/SPEC.md
index 9d57813cf..55f30ffd6 100644
--- a/mobile/contract/SPEC.md
+++ b/mobile/contract/SPEC.md
@@ -33,7 +33,10 @@ no accounts. M1 (below) is the computer connection; M2 is on-device inference.
secondary = `textMuted`/`mutedForeground`; separators = `border`; fields =
`input`; focus ring = `focus`; errors = `error`/`errorForeground`/`errorSurface`;
warnings likewise; tab/nav bars = `chrome` + `toolbarForeground`.
-- Type: Inter (bundled, SIL OFL — include its license). Desktop sizes
+- Type: Inter (bundled, SIL OFL — include its license) preserves the brand in
+ artwork and the Home wordmark. iOS uses the system semantic text styles for
+ navigation, controls and body content, scaling with Dynamic Type; Android keeps
+ the generated Inter typography. Desktop sizes
(`VSTokens.text*`) are the base; scale with Dynamic Type / Android font
scale. Body text on phones uses `editor` (16/28); controls use `ui` (14/20)
scaled up to the platform minimum touch-readable size.
@@ -41,6 +44,19 @@ no accounts. M1 (below) is the computer connection; M2 is on-device inference.
`spacingGap` between elements, `spacingInset` for screen padding (cap at 16
on compact widths).
- Respect reduced motion and reduced transparency.
+- Native iOS presentation follows Apple's current HIG: automatic system navigation
+ and tab-bar materials, platform button shapes and sheet curvature. Content can
+ scroll beneath native chrome while controls remain in safe areas. iOS content
+ cards and text fields use generated `iosCardRadius` and `iosFieldRadius`
+ tokens (continuous 24-point and 16-point corners). The Home wordmark uses
+ generated `iosHomeWordmarkSize` (28 points), scaling with Dynamic Type;
+ Android retains its generated shapes. These presentation differences preserve
+ the same capabilities and consent gates on both platforms.
+- iOS licence review is a large, scrollable sheet with a leading Close action,
+ readable exact terms, collapsed technical metadata, an initially unchecked
+ confirmation and a persistent Accept action disabled until confirmation. Closing
+ never records acceptance or starts a download. On both platforms, multi-selection
+ sheets/dialogs edit a draft; Cancel/dismiss discards it and Confirm applies it.
## Strings
diff --git a/mobile/contract/tokens.json b/mobile/contract/tokens.json
index c29f4a732..728c9a8e9 100644
--- a/mobile/contract/tokens.json
+++ b/mobile/contract/tokens.json
@@ -905,5 +905,10 @@
"spacing": {
"gap": 16,
"inset": 24
+ },
+ "ios": {
+ "cardRadius": 24,
+ "fieldRadius": 16,
+ "homeWordmarkSize": 28
}
}
diff --git a/mobile/ios/README.md b/mobile/ios/README.md
index 023cf6353..8fcbe09d4 100644
--- a/mobile/ios/README.md
+++ b/mobile/ios/README.md
@@ -39,6 +39,8 @@ The smoke fetcher verifies every file's size and SHA-256 from the actual shared
With full Xcode, prepare the native frameworks before generating or building the app:
```sh
+export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
+mobile/ios/scripts/check-swift.sh test
mobile/native/ios/build.sh ios
xcodegen generate --spec mobile/ios/VoiceStudio/project.yml
xcodebuild -project mobile/ios/VoiceStudio/VoiceStudio.xcodeproj \
@@ -119,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. All 16 UI scenarios pass in one full run on the iPhone Duo simulator with iOS 27.1, including Home navigation and dark/light screenshots. 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/largest Dynamic Type, signing, background uploads and real-host end-to-end workflows still require device validation. 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 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.
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.
@@ -134,3 +136,30 @@ saved phone voices select the reference in Speak, and projects open their
outputs and resume controls. Empty states are localized and downloads remain
explicit. Home replaces Speak in the five-item navigation; Speak opens from Home.
Desktop-only workspaces are not advertised as available mobile features.
+
+## Native iOS presentation
+
+The app supports iOS 17 and later, using system navigation and tab-bar materials, semantic system
+text styles, native capsule buttons, grouped Settings/Models forms and platform
+sheet geometry. The Home wordmark and bundled Electron artwork retain VoiceStudio's
+identity and generated palette choices. Content scrolls behind native chrome;
+All five tabs use compact leading navigation titles, with Home aligned opposite
+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.
+
+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.
+Language pickers have Cancel/Confirm actions and discard unconfirmed drafts.
+Large Dynamic Type, native reduced-transparency behavior and reduced-motion
+recording feedback are supported.
+Newer system materials follow the installed iOS version; tab-bar minimization is
+enabled on iOS 26 and later. Content radii and the Home wordmark size are exported
+from Electron's theme alongside the shared palette. Smoke networking and credentials
+are compiled only into Debug builds for UI automation.
+
+References: [Apple's Liquid Glass adoption guide](https://developer.apple.com/documentation/technologyoverviews/adopting-liquid-glass),
+[Sheets](https://developer.apple.com/design/human-interface-guidelines/sheets),
+[Layout](https://developer.apple.com/design/human-interface-guidelines/layout) and
+[Accessibility](https://developer.apple.com/design/human-interface-guidelines/accessibility).
diff --git a/mobile/ios/VoiceStudio/App/AppModel.swift b/mobile/ios/VoiceStudio/App/AppModel.swift
index 7a8689af6..9062d370a 100644
--- a/mobile/ios/VoiceStudio/App/AppModel.swift
+++ b/mobile/ios/VoiceStudio/App/AppModel.swift
@@ -27,16 +27,19 @@ import BackgroundTasks
private(set) var monitorTask: Task<Void, Never>?
private var notified = Set<String>()
private var monitorID = UUID()
- let mockMode: Bool
init() {
- mockMode = ProcessInfo.processInfo.arguments.contains("--ui-smoke")
let d = UserDefaults.standard
+ #if DEBUG
+ let mockMode = ProcessInfo.processInfo.arguments.contains("--ui-smoke")
if mockMode {
for task in ["speak", "dictate", "clone", "dub"] { d.removeObject(forKey: "run-on."+task) }
d.removeObject(forKey: "consentAnswered"); d.removeObject(forKey: "activeHost")
d.removeObject(forKey: "theme"); d.removeObject(forKey: "language")
connection = ConnectionStore(defaults: d, vault: SmokeVault(), transport: SmokeTransport())
} else { connection = ConnectionStore() }
+ #else
+ connection = ConnectionStore()
+ #endif
hostState = HostState(dub: DubWorkflow())
consentAnswered = d.bool(forKey: "consentAnswered")
analytics = d.bool(forKey: "analytics"); notifications = d.bool(forKey: "notifications")
diff --git a/mobile/ios/VoiceStudio/App/KeyboardSupport.swift b/mobile/ios/VoiceStudio/App/KeyboardSupport.swift
index 48a14c435..99b3b49e1 100644
--- a/mobile/ios/VoiceStudio/App/KeyboardSupport.swift
+++ b/mobile/ios/VoiceStudio/App/KeyboardSupport.swift
@@ -21,7 +21,7 @@ private struct KeyboardAccessible: ViewModifier {
ToolbarItemGroup(placement: .keyboard) {
Spacer()
Button(model.t("mobile.keyboard.done")) { Keyboard.dismiss() }
- .buttonStyle(VSButtonStyle(kind: .tertiary))
+ .studioButton(.tertiary)
.accessibilityIdentifier("keyboard.done")
}
}
diff --git a/mobile/ios/VoiceStudio/App/NativeTheme.swift b/mobile/ios/VoiceStudio/App/NativeTheme.swift
index f9f5ab09f..005e72e7d 100644
--- a/mobile/ios/VoiceStudio/App/NativeTheme.swift
+++ b/mobile/ios/VoiceStudio/App/NativeTheme.swift
@@ -8,20 +8,21 @@ import VoiceStudioKit
return UIColor(red: c.r, green: c.g, blue: c.b, alpha: c.a)
}
let navigation = UINavigationBarAppearance()
- navigation.configureWithOpaqueBackground()
- navigation.backgroundColor = color("chrome")
- navigation.shadowColor = color("border")
- let font = UIFontMetrics(forTextStyle: .body).scaledFont(for: UIFont(name: "InterVariable", size: Theme.controlTypeSize) ?? UIFont.preferredFont(forTextStyle: .body))
+ navigation.configureWithDefaultBackground()
+ let font = UIFont.preferredFont(forTextStyle: .headline)
navigation.titleTextAttributes = [.foregroundColor: color("toolbarForeground"), .font: font]
- navigation.largeTitleTextAttributes = [.foregroundColor: color("toolbarForeground"), .font: UIFontMetrics(forTextStyle: .largeTitle).scaledFont(for: UIFont(name: "InterVariable", size: Theme.titleTypeSize) ?? UIFont.preferredFont(forTextStyle: .largeTitle))]
+ navigation.largeTitleTextAttributes = [.foregroundColor: color("toolbarForeground"), .font: UIFont.preferredFont(forTextStyle: .largeTitle)]
UINavigationBar.appearance().standardAppearance = navigation
- UINavigationBar.appearance().scrollEdgeAppearance = navigation
+ let edge = UINavigationBarAppearance()
+ edge.configureWithTransparentBackground()
+ edge.titleTextAttributes = navigation.titleTextAttributes
+ edge.largeTitleTextAttributes = navigation.largeTitleTextAttributes
+ UINavigationBar.appearance().scrollEdgeAppearance = edge
UINavigationBar.appearance().compactAppearance = navigation
UINavigationBar.appearance().tintColor = color("messageAction")
let tab = UITabBarAppearance()
- tab.configureWithOpaqueBackground()
- tab.backgroundColor = color("chrome"); tab.shadowColor = color("border")
- let tabFont = UIFontMetrics(forTextStyle: .caption1).scaledFont(for: UIFont(name: "InterVariable", size: VSTokens.textCaption.size) ?? UIFont.preferredFont(forTextStyle: .caption1))
+ tab.configureWithDefaultBackground()
+ let tabFont = UIFont.preferredFont(forTextStyle: .caption1)
for item in [tab.stackedLayoutAppearance, tab.inlineLayoutAppearance, tab.compactInlineLayoutAppearance] {
item.normal.iconColor = color("toolbarForeground")
item.normal.titleTextAttributes = [.foregroundColor: color("toolbarForeground"), .font: tabFont]
diff --git a/mobile/ios/VoiceStudio/App/SelectionControls.swift b/mobile/ios/VoiceStudio/App/SelectionControls.swift
index 0168ccbb4..6f9273935 100644
--- a/mobile/ios/VoiceStudio/App/SelectionControls.swift
+++ b/mobile/ios/VoiceStudio/App/SelectionControls.swift
@@ -62,15 +62,15 @@ struct ChoicePicker: View {
SelectionRow(label: label, value: options.first { $0.id == selection }?.title ?? model.t("common.unknown"))
}
}
- }.buttonStyle(VSButtonStyle(kind: .tertiary))
+ }.studioButton(compact ? .secondary : .tertiary)
.sheet(isPresented: $presenting) {
NavigationStack {
choices
.navigationTitle(label).navigationBarTitleDisplayMode(.inline)
- .toolbar { Button(model.t("common.close")) { presenting = false }.buttonStyle(VSButtonStyle(kind: .tertiary)) }
+ .toolbar { ToolbarItem(placement: .cancellationAction) { Button(model.t("common.close")) { presenting = false } } }
}
- .presentationBackground(theme.color("surfaceOverlay"))
- .presentationCornerRadius(VSTokens.radiusLg)
+ .presentationDetents(options.count > 6 ? [.large] : [.medium, .large])
+ .presentationDragIndicator(.visible)
}
}
private var choices: some View {
@@ -96,12 +96,12 @@ struct ChoicePicker: View {
VStack(alignment: .leading, spacing: VSTokens.spacingGap) {
Text(option.title).foregroundStyle(theme.color(option.enabled ? "text" : "textMuted"))
.lineLimit(2).truncationMode(.tail)
- if let subtitle = option.subtitle { Text(subtitle).font(.custom("InterVariable", size: VSTokens.textLabel.size, relativeTo: .caption)).foregroundStyle(theme.color("textMuted")) }
+ if let subtitle = option.subtitle { Text(subtitle).font(.caption).foregroundStyle(theme.color("textMuted")) }
}
Spacer(minLength: 0)
if selection == option.id { Image(systemName: "checkmark").foregroundStyle(theme.color("text")).accessibilityIdentifier("choice.selected") }
}.frame(minHeight: 44).contentShape(Rectangle())
- }.buttonStyle(VSButtonStyle(kind: .tertiary)).disabled(!option.enabled)
+ }.studioButton(.tertiary).disabled(!option.enabled)
.accessibilityLabel(option.title)
.accessibilityValue(ListFormatter.localizedString(byJoining: [model.t(selection == option.id ? "mobile.ios.selected" : "mobile.ios.not_selected")] + (option.subtitle.map { [$0] } ?? [])))
.accessibilityAddTraits(selection == option.id ? .isSelected : [])
@@ -124,6 +124,65 @@ struct SearchEmptyState: View {
}
}
+/// The modal owns the draft. Parent tasks only change when Confirm is pressed.
+struct LanguageSelectionSheet: View {
+ @Environment(AppModel.self) private var model
+ @Environment(\.vsTheme) private var theme
+ @Environment(\.dismiss) private var dismiss
+ let includesUnavailable: Bool
+ let confirm: (Set<String>) -> Void
+ @State private var draft: Set<String>
+ @State private var query = ""
+
+ init(selection: Set<String>, includesUnavailable: Bool, confirm: @escaping (Set<String>) -> Void) {
+ self.includesUnavailable = includesUnavailable
+ self.confirm = confirm
+ _draft = State(initialValue: selection)
+ }
+ var body: some View {
+ NavigationStack {
+ List {
+ SearchField(prompt: model.t("common.search"), text: $query)
+ .listRowBackground(theme.color("surfaceOverlay"))
+ let matches = model.languages.search(query, includeAuto: false)
+ .filter { includesUnavailable || $0.code != nil }
+ if matches.isEmpty { SearchEmptyState(query: query) }
+ ForEach(matches) { language in
+ let selected = language.code.map { draft.contains($0) } ?? false
+ Button {
+ if let code = language.code {
+ if draft.contains(code) { draft.remove(code) } else { draft.insert(code) }
+ }
+ } label: {
+ HStack(spacing: VSTokens.spacingGap) {
+ VStack(alignment: .leading, spacing: 4) {
+ Text(language.name)
+ if language.code == nil {
+ Text(model.t("mobile.dub.language_unavailable"))
+ .font(.caption).foregroundStyle(theme.color("textMuted"))
+ }
+ }
+ Spacer(minLength: 0)
+ Image(systemName: selected ? "checkmark.circle.fill" : "circle")
+ .foregroundStyle(theme.color("messageAction")).accessibilityHidden(true)
+ }.frame(minHeight: 44).contentShape(Rectangle())
+ }.buttonStyle(.plain).disabled(language.code == nil)
+ .accessibilityLabel(language.name)
+ .accessibilityValue(model.t(selected ? "mobile.ios.selected" : "mobile.ios.not_selected"))
+ .accessibilityAddTraits(selected ? .isSelected : [])
+ .listRowBackground(theme.color("surface"))
+ }
+ }.scrollContentBackground(.hidden).background(theme.color("surfaceOverlay"))
+ .keyboardAccessible()
+ .navigationTitle(model.t("mobile.dub.target_languages")).navigationBarTitleDisplayMode(.inline)
+ .toolbar {
+ ToolbarItem(placement: .cancellationAction) { Button(model.t("common.cancel")) { dismiss() } }
+ ToolbarItem(placement: .confirmationAction) { Button(model.t("common.confirm")) { confirm(draft); dismiss() } }
+ }
+ }.presentationDetents([.large]).presentationDragIndicator(.visible)
+ }
+}
+
struct SelectedFileRow: View {
@Environment(AppModel.self) private var model
let name: String
@@ -132,7 +191,7 @@ struct SelectedFileRow: View {
HStack(spacing: VSTokens.spacingGap) {
Text(name).lineLimit(1).truncationMode(.middle).frame(maxWidth: .infinity, alignment: .leading)
Button(model.t("mobile.ios.remove_file"), systemImage: "xmark", action: remove)
- .buttonStyle(VSButtonStyle(kind: .tertiary))
+ .studioButton(.tertiary)
.accessibilityLabel(model.t("common.remove", ["term": name]))
.accessibilityIdentifier("source.remove")
}
@@ -151,6 +210,7 @@ struct SearchField: View {
HStack(spacing: VSTokens.spacingGap) {
Image(systemName: "magnifyingglass").foregroundStyle(theme.color("textMuted")).accessibilityHidden(true)
TextField(prompt, text: $text)
+ .textFieldStyle(.plain)
.textInputAutocapitalization(.never).autocorrectionDisabled()
.submitLabel(.search)
.accessibilityIdentifier("search.field")
@@ -161,7 +221,7 @@ struct SearchField: View {
}
}
.padding(.horizontal, VSTokens.spacingGap).frame(minHeight: 44)
- .background(theme.color("input"), in: RoundedRectangle(cornerRadius: VSTokens.radiusControl))
+ .background(theme.color("input"), in: RoundedRectangle(cornerRadius: VSTokens.iosFieldRadius))
}
}
@@ -177,11 +237,10 @@ struct DeleteConfirmation: View {
Page(backgroundRole: "surfaceOverlay") {
Text(title)
Button(model.t("common.delete"), role: .destructive) { onDelete(); dismiss() }
- .buttonStyle(VSButtonStyle(kind: .secondary))
+ .studioButton(.secondary)
}.navigationTitle(model.t("common.delete")).navigationBarTitleDisplayMode(.inline)
- .toolbar { Button(model.t("common.cancel")) { dismiss() }.buttonStyle(VSButtonStyle(kind: .tertiary)) }
- }.presentationBackground(theme.color("surfaceOverlay"))
- .presentationCornerRadius(VSTokens.radiusLg).presentationDetents([.medium, .large])
+ .toolbar { ToolbarItem(placement: .cancellationAction) { Button(model.t("common.cancel")) { dismiss() } } }
+ }.presentationDragIndicator(.visible).presentationDetents([.medium, .large])
}
}
@@ -198,13 +257,13 @@ struct InfoButton: View {
if row { Label(title, systemImage: icon) }
else { Image(systemName: icon).accessibilityLabel(title) }
}.labelStyle(.titleAndIcon)
- .buttonStyle(VSButtonStyle(kind: .tertiary))
+ .studioButton(.tertiary)
.sheet(isPresented: $showing) {
NavigationStack {
Page(backgroundRole: "surfaceOverlay") { Text(detail).textSelection(.enabled) }
.navigationTitle(title).navigationBarTitleDisplayMode(.inline)
- .toolbar { Button(model.t("common.close")) { showing = false } }
- }.presentationDetents([.medium, .large]).presentationBackground(theme.color("surfaceOverlay"))
+ .toolbar { ToolbarItem(placement: .cancellationAction) { Button(model.t("common.close")) { showing = false } } }
+ }.presentationDetents([.medium, .large]).presentationDragIndicator(.visible)
}
}
}
diff --git a/mobile/ios/VoiceStudio/App/ThemeUI.swift b/mobile/ios/VoiceStudio/App/ThemeUI.swift
index 8313a7b1c..0638d2558 100644
--- a/mobile/ios/VoiceStudio/App/ThemeUI.swift
+++ b/mobile/ios/VoiceStudio/App/ThemeUI.swift
@@ -9,33 +9,68 @@ extension Theme {
func color(_ role: String) -> Color { let c = self[role]; return Color(.sRGB, red: c.r, green: c.g, blue: c.b, opacity: c.a) }
}
enum VSButtonKind { case primary, secondary, tertiary }
-struct VSButtonStyle: ButtonStyle {
+/// Keep destructive roles visible and put the full touch target inside the Button.
+private struct StudioPlainButtonStyle: ButtonStyle {
@Environment(\.vsTheme) private var theme
- @Environment(\.isEnabled) private var enabled
- var kind: VSButtonKind = .secondary
func makeBody(configuration: Configuration) -> some View {
- configuration.label
- .font(.custom("InterVariable", size: Theme.controlTypeSize, relativeTo: .body))
- .frame(minWidth: 44, minHeight: 44)
- .frame(maxWidth: kind == .primary ? .infinity : nil)
- .padding(.horizontal, kind == .tertiary ? 0 : VSTokens.spacingGap)
- .foregroundStyle(theme.color(!enabled ? "mutedForeground" : (configuration.role == .destructive ? "error" : (kind == .primary ? "messageActionForeground" : "text"))))
- .background {
- if kind != .tertiary {
- RoundedRectangle(cornerRadius: VSTokens.radiusControl)
- .fill(theme.color(!enabled ? "muted" : (kind == .primary ? (configuration.isPressed ? "messageActionHover" : "messageAction") : (configuration.isPressed ? "muted" : "surface"))))
- }
+ Group {
+ if configuration.role == .destructive {
+ configuration.label.foregroundStyle(theme.color("error"))
+ } else {
+ configuration.label
}
- .overlay {
- if kind == .secondary { RoundedRectangle(cornerRadius: VSTokens.radiusControl).strokeBorder(theme.color("border")) }
+ }.frame(minWidth: 44, minHeight: 44).contentShape(Rectangle())
+ .opacity(configuration.isPressed ? 0.65 : 1)
+ }
+}
+/// Apply system button styles to the original control, retaining its action,
+/// accessibility identity and List-row activation semantics.
+private struct StudioButton: ViewModifier {
+ let kind: VSButtonKind
+ @ViewBuilder func body(content: Content) -> some View {
+ if kind == .primary {
+ content.buttonStyle(.borderedProminent).buttonBorderShape(.capsule).controlSize(.large)
+ } else if kind == .secondary {
+ content.buttonStyle(.bordered).buttonBorderShape(.capsule).controlSize(.large)
+ } else {
+ content.buttonStyle(StudioPlainButtonStyle())
+ }
+ }
+}
+extension View {
+ func studioButton(_ kind: VSButtonKind = .secondary) -> some View { modifier(StudioButton(kind: kind)) }
+ func studioNavigationTitle(_ title: String) -> some View {
+ navigationTitle(title).navigationBarTitleDisplayMode(.inline)
+ .toolbar {
+ // Keep the navigation item's title for accessibility and Back,
+ // while placing the visible heading beside the trailing actions.
+ ToolbarItem(placement: .principal) {
+ Color.clear.frame(width: 1, height: 1).accessibilityHidden(true)
+ }
+ StudioLeadingTitle(title: title)
}
}
}
+private struct StudioLeadingTitle: ToolbarContent {
+ let title: String
+ @ToolbarContentBuilder var body: some ToolbarContent {
+ if #available(iOS 26.0, *) {
+ ToolbarItem(placement: .topBarLeading) { label }
+ .sharedBackgroundVisibility(.hidden)
+ } else {
+ ToolbarItem(placement: .topBarLeading) { label }
+ }
+ }
+ private var label: some View {
+ Text(title).font(.headline).fixedSize(horizontal: true, vertical: false)
+ .accessibilityAddTraits(.isHeader).accessibilityIdentifier("navigation.title")
+ }
+}
struct VSFieldStyle: TextFieldStyle {
@Environment(\.vsTheme) private var theme
func _body(configuration: TextField<Self._Label>) -> some View {
configuration.padding(Theme.compactInset).frame(minHeight: 44)
- .background(theme.color("input"), in: RoundedRectangle(cornerRadius: VSTokens.radiusControl))
+ .background(theme.color("input"), in: RoundedRectangle(cornerRadius: VSTokens.iosFieldRadius))
.tint(theme.color("focus"))
}
}
@@ -55,7 +90,8 @@ struct Page<Content: View>: View {
}
.padding(Theme.compactInset).frame(maxWidth: .infinity, alignment: .leading)
}
- .background(theme.color(backgroundRole))
+ .frame(maxWidth: .infinity, maxHeight: .infinity)
+ .background(theme.color(backgroundRole).ignoresSafeArea())
.keyboardAccessible()
}
}
@@ -66,8 +102,7 @@ struct Card<Content: View>: View {
var body: some View {
VStack(alignment: .leading, spacing: VSTokens.spacingGap) { content }
.frame(maxWidth: .infinity, alignment: .leading).padding(Theme.compactInset)
- .background(theme.color("surface"), in: RoundedRectangle(cornerRadius: VSTokens.radiusLg))
- .overlay(RoundedRectangle(cornerRadius: VSTokens.radiusLg).strokeBorder(theme.color("border")))
+ .background(theme.color("surface"), in: RoundedRectangle(cornerRadius: VSTokens.iosCardRadius, style: .continuous))
}
}
struct RootView: View {
@@ -87,8 +122,7 @@ struct RootView: View {
NavigationStack { SettingsView() }.tabItem { Label(model.t("mobile.tabs.settings"), systemImage: "gearshape") }
}
.id(model.hostState.scopeID)
- .toolbarBackground(theme.color("chrome"), for: .tabBar)
- .toolbarBackground(.visible, for: .tabBar)
+ .modifier(StudioTabBehavior())
}
}
.task { await model.phone.refresh() }
@@ -96,11 +130,10 @@ struct RootView: View {
.onChange(of: model.theme) { _, _ in NativeTheme.apply(theme) }
.onChange(of: scheme) { _, _ in NativeTheme.apply(theme) }
.environment(\.vsTheme, theme)
- .font(.custom("InterVariable", size: VSTokens.textEditor.size, relativeTo: .body))
+ .font(.body)
.foregroundStyle(theme.color("text")).tint(theme.color("messageAction"))
- .buttonStyle(VSButtonStyle()).textFieldStyle(VSFieldStyle())
+ .textFieldStyle(VSFieldStyle())
.background(theme.color("canvas"))
- .toolbarBackground(theme.color("chrome"), for: .navigationBar)
.sheet(isPresented: Binding(get: { recovery != nil },set: { if !$0 { recovery = nil } })) {
NavigationStack {
Group { if recovery == "models" { ModelsView() } else { ConnectView() } }
@@ -128,7 +161,7 @@ struct RootView: View {
}
}
}.padding(Theme.compactInset).background(theme.color("errorSurface"))
- .environment(\.vsTheme,theme).buttonStyle(VSButtonStyle(kind: .tertiary))
+ .environment(\.vsTheme,theme).studioButton(.tertiary)
}
}
@@ -149,20 +182,35 @@ struct ErrorNotice: View {
}
struct ConsentView: View {
@Environment(AppModel.self) private var model
+ @Environment(\.vsTheme) private var theme
var body: some View {
Page {
- Text(model.t("privacy.analytics_title")).font(.custom("InterVariable", size: VSTokens.textEditor.size, relativeTo: .title))
- Text(model.t("mobile.consent.phone_note"))
- InfoButton(title: model.t("mobile.simple.info"), detail: model.t("privacy.analytics_subtitle"))
- ViewThatFits(in: .horizontal) {
- HStack(spacing: VSTokens.spacingGap) { choice(true); choice(false) }
- VStack(spacing: VSTokens.spacingGap) { choice(true); choice(false) }
+ VStack(alignment: .leading, spacing: VSTokens.spacingGap * 2) {
+ Image(systemName: "waveform").font(.system(size: 52, weight: .medium)).foregroundStyle(theme.color("messageAction")).accessibilityHidden(true)
+ Text(model.t("privacy.analytics_title")).font(.largeTitle.bold()).fixedSize(horizontal: false, vertical: true)
+ Text(model.t("mobile.consent.phone_note")).font(.title3).foregroundStyle(theme.color("textMuted"))
+ Text(model.t("privacy.analytics_subtitle")).foregroundStyle(theme.color("textMuted"))
+ }.padding(.vertical, VSTokens.spacingGap * 2)
+ }.safeAreaInset(edge: .bottom) {
+ VStack(spacing: VSTokens.spacingGap) {
+ ViewThatFits(in: .horizontal) {
+ HStack(spacing: VSTokens.spacingGap) { choice(true); choice(false) }
+ VStack(spacing: VSTokens.spacingGap) { choice(true); choice(false) }
+ }
+ Button(model.t("common.dismiss")) { model.chooseConsent(false) }.accessibilityIdentifier("consent.dismiss")
}
- Button(model.t("common.dismiss")) { model.chooseConsent(false) }.accessibilityIdentifier("consent.dismiss")
+ .padding(Theme.compactInset).background(.bar)
}.interactiveDismissDisabled()
}
func choice(_ value: Bool) -> some View {
Button(model.t(value ? "common.yes" : "common.no")) { model.chooseConsent(value) }
- .buttonStyle(VSButtonStyle(kind: .secondary)).frame(maxWidth: .infinity).accessibilityIdentifier(value ? "consent.yes" : "consent.no")
+ .studioButton(.secondary).frame(maxWidth: .infinity).accessibilityIdentifier(value ? "consent.yes" : "consent.no")
+ }
+}
+
+private struct StudioTabBehavior: ViewModifier {
+ @ViewBuilder func body(content: Content) -> some View {
+ if #available(iOS 26.0, *) { content.tabBarMinimizeBehavior(.onScrollDown) }
+ else { content }
}
}
diff --git a/mobile/ios/VoiceStudio/Features/ConnectView.swift b/mobile/ios/VoiceStudio/Features/ConnectView.swift
index 9530a816d..163f75435 100644
--- a/mobile/ios/VoiceStudio/Features/ConnectView.swift
+++ b/mobile/ios/VoiceStudio/Features/ConnectView.swift
@@ -11,7 +11,7 @@ struct ConnectView: View {
@State private var manual = false
var body: some View {
Page {
- Button(model.t("mobile.connect.scan_qr"), systemImage: "qrcode.viewfinder") { scanning = true }.buttonStyle(VSButtonStyle(kind: .primary))
+ Button(model.t("mobile.connect.scan_qr"), systemImage: "qrcode.viewfinder") { scanning = true }.studioButton(.primary)
DisclosureGroup(model.t("mobile.simple.address"), isExpanded: $manual) {
Card {
TextField(model.t("mobile.connect.url_label"), text: $url).textContentType(.URL).keyboardType(.URL).textInputAutocapitalization(.never).autocorrectionDisabled().accessibilityIdentifier("connect.url")
@@ -20,7 +20,7 @@ struct ConnectView: View {
SecureField(model.t("mobile.connect.api_key_label"), text: $apiKey).textInputAutocapitalization(.never).autocorrectionDisabled()
}
Button(model.t(model.connection.connecting ? "mobile.connect.connecting" : "mobile.connect.connect")) { Task { await connect() } }
- .buttonStyle(VSButtonStyle(kind: .secondary)).disabled(model.connection.connecting || model.busy || BackgroundUpload.shared.pending != nil || url.isEmpty).accessibilityIdentifier("connect.submit")
+ .studioButton(.secondary).disabled(model.connection.connecting || model.busy || BackgroundUpload.shared.pending != nil || url.isEmpty).accessibilityIdentifier("connect.submit")
}
}
if let error = model.connection.error {
@@ -36,13 +36,16 @@ struct ConnectView: View {
}
}
}.navigationTitle(model.t("mobile.connect.title")).navigationBarTitleDisplayMode(.large)
- .sheet(isPresented: $scanning) {
+ .fullScreenCover(isPresented: $scanning) {
QRScanner(onCode: { code in
scanning = false
do { let address = try PairingAddress(code, qr: true); url = address.baseURL.absoluteString; pin = address.pin ?? ""; Task { await connect() } }
catch let e as ClientError { model.error = e } catch { model.error = ClientError("mobile.connect.error_qr") }
}, onError: { e in scanning = false; model.error = e })
- .presentationCornerRadius(VSTokens.radiusLg).ignoresSafeArea().overlay(alignment: .bottom) { Button(model.t("common.cancel")) { scanning = false } }
+ .ignoresSafeArea().overlay(alignment: .bottom) {
+ Button(model.t("common.cancel")) { scanning = false }
+ .studioButton(.secondary).padding(Theme.compactInset).background(.bar)
+ }
}
}
private func connect() async {
diff --git a/mobile/ios/VoiceStudio/Features/DictateView.swift b/mobile/ios/VoiceStudio/Features/DictateView.swift
index d7e824697..26f28d5ac 100644
--- a/mobile/ios/VoiceStudio/Features/DictateView.swift
+++ b/mobile/ios/VoiceStudio/Features/DictateView.swift
@@ -4,6 +4,7 @@ import VoiceStudioKit
struct DictateView: View {
@Environment(AppModel.self) private var model
@Environment(\.vsTheme) private var theme
+ @Environment(\.accessibilityReduceMotion) private var reduceMotion
@State private var preference: TaskLocation?
private var phoneModel: PhoneModel? { model.phone.preferred(.stream) }
private var localReady: Bool { phoneModel.map(model.phone.ready) ?? false }
@@ -32,17 +33,45 @@ struct DictateView: View {
Text(model.t("mobile.simple.connection_error"))
Button(model.t("mobile.simple.retry")) { Task { await readiness() } }
}
- Text(text).frame(maxWidth: .infinity, minHeight: 160, alignment: .bottomLeading)
- .textSelection(.enabled).accessibilityLabel(model.t("mobile.ios.transcript"))
+ if text.isEmpty {
+ ContentUnavailableView {
+ Label(model.t("mobile.tabs.dictate"), systemImage: "waveform")
+ } description: {
+ Text(model.t("mobile.dictate.tap_to_start"))
+ }.frame(minHeight: 240)
+ } else {
+ Text(text).font(.title3).frame(maxWidth: .infinity, minHeight: 240, alignment: .topLeading)
+ .textSelection(.enabled).accessibilityLabel(model.t("mobile.ios.transcript"))
+ }
+ }.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)
+ }
+ }
+ .task { preference = model.phone.preference("dictate"); await model.phone.refresh(); await readiness() }
+ .onChange(of: preference) { _, _ in Task { await readiness() } }
+ .onChange(of: route) { _, _ in Task { await readiness() } }
+ .refreshable { await readiness() }
+ .onDisappear { capturing?.cancel(); receiving?.cancel(); audio.stop(); listening = false; finalizing = false; Task { await stream.close() } }
+ }
+ private var recordControl: some View {
Button {
guard !suppressTap else { return }
if listening { stop() } else { start() }
} label: {
Image(systemName: listening ? "stop.fill" : "mic.fill")
- .font(.largeTitle).frame(width: 112, height: 112)
+ .font(.largeTitle).symbolEffect(.pulse, isActive: listening && !reduceMotion).frame(width: 88, height: 88)
.foregroundStyle(theme.color("messageActionForeground"))
.background(theme.color("messageAction"), in: Circle())
- }.buttonStyle(.plain).frame(maxWidth: .infinity, minHeight: 144)
+ }.buttonStyle(.plain).frame(maxWidth: .infinity, minHeight: 104)
.disabled(!ready || finalizing || model.phone.activeDub != nil)
.accessibilityLabel(model.t(listening ? "common.stop" : "mobile.simple.microphone"))
.accessibilityIdentifier("dictate.record")
@@ -52,21 +81,6 @@ struct DictateView: View {
Task { try? await Task.sleep(for: .milliseconds(150)); suppressTap = false }
}
}, perform: { holding = true; suppressTap = true; if !listening && ready { start() } })
- }.navigationTitle(model.t("mobile.tabs.dictate"))
- .safeAreaInset(edge: .bottom, spacing: 0) {
- 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).buttonStyle(VSButtonStyle(kind: .tertiary)).disabled(text.isEmpty)
- .frame(maxWidth: .infinity).padding(Theme.compactInset).background(theme.color("canvas"))
- }
- .task { preference = model.phone.preference("dictate"); await model.phone.refresh(); await readiness() }
- .onChange(of: preference) { _, _ in Task { await readiness() } }
- .onChange(of: route) { _, _ in Task { await readiness() } }
- .refreshable { await readiness() }
- .onDisappear { capturing?.cancel(); receiving?.cancel(); audio.stop(); listening = false; finalizing = false; Task { await stream.close() } }
}
private func readiness() async {
let scope = model.hostState.scopeID
diff --git a/mobile/ios/VoiceStudio/Features/DubView.swift b/mobile/ios/VoiceStudio/Features/DubView.swift
index 46d2e18f8..1532126e2 100644
--- a/mobile/ios/VoiceStudio/Features/DubView.swift
+++ b/mobile/ios/VoiceStudio/Features/DubView.swift
@@ -11,7 +11,8 @@ struct DubView: View {
.padding(.horizontal,Theme.compactInset).disabled(model.phone.activeDub != nil || model.busy)
if route == .computer { ComputerDubView() }
else { PhoneDubView(connect: route == .connect) }
- }.task { preference = model.phone.preference("dub"); await model.phone.refresh() }
+ }.studioNavigationTitle(model.t("mobile.tabs.dub"))
+ .task { preference = model.phone.preference("dub"); await model.phone.refresh() }
}
}
@@ -29,11 +30,9 @@ struct ComputerDubView: View {
@State private var selected = Set<String>()
@State private var profile = DubVoiceChoice.unselected
@State private var selectingLanguages = false
- @State private var languageQuery = ""
@State private var shared: SharedFile?
@State private var saved: SharedFile?
var languages: [DubLanguage] { model.languages.dubOptions }
- private var filteredLanguages: [MobileLanguage] { model.languages.search(languageQuery, includeAuto: false) }
var body: some View {
Page {
if model.connection.client == nil { NavigationLink(model.t("mobile.settings.connection")) { ConnectView() } }
@@ -48,7 +47,7 @@ struct ComputerDubView: View {
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)))
}
- }.buttonStyle(VSButtonStyle(kind: .tertiary)).accessibilityIdentifier("dub.languages")
+ }.studioButton(.tertiary).accessibilityIdentifier("dub.languages")
ScrollView(.horizontal) {
HStack(spacing: VSTokens.spacingGap) {
ForEach(languages.filter { selected.contains($0.code) }) { language in
@@ -61,7 +60,7 @@ struct ComputerDubView: View {
Label(model.t("mobile.simple.voice"), systemImage: "person")
VoicePicker(selection: $profile, dubbing: true)
Button(model.t("mobile.simple.dub"), systemImage: "film") { Task { await start() } }
- .buttonStyle(VSButtonStyle(kind: .primary)).disabled(model.connection.client == nil || profile == DubVoiceChoice.unselected || model.busy || upload.pending != nil || selected.isEmpty || (selectedFile == nil && sourceURL.isEmpty) || model.dub.monitoring)
+ .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 {
@@ -113,43 +112,14 @@ struct ComputerDubView: View {
}
}
}
- }.navigationTitle(model.t("mobile.tabs.dub")).navigationBarTitleDisplayMode(.large)
+ }.navigationTitle(model.t("mobile.tabs.dub")).navigationBarTitleDisplayMode(.inline)
.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") }
}
- .sheet(item: $shared) { file in ShareSheet(items: [file.url]).presentationCornerRadius(VSTokens.radiusLg) }
- .sheet(item: $saved) { file in SaveFileSheet(url: file.url).presentationCornerRadius(VSTokens.radiusLg) }
+ .sheet(item: $shared) { file in ShareSheet(items: [file.url]) }
+ .sheet(item: $saved) { file in SaveFileSheet(url: file.url) }
.sheet(isPresented: $selectingLanguages) {
- NavigationStack {
- List {
- SearchField(prompt: model.t("common.search"), text: $languageQuery).listRowBackground(theme.color("surfaceOverlay"))
- if filteredLanguages.isEmpty { SearchEmptyState(query: languageQuery).listRowBackground(theme.color("surface")) }
- ForEach(filteredLanguages) { language in
- Button {
- if let code = language.code {
- if selected.contains(code) { selected.remove(code) } else { selected.insert(code) }
- }
- } label: {
- HStack(spacing: VSTokens.spacingGap) {
- VStack(alignment: .leading, spacing: VSTokens.spacingGap) {
- Text(language.name).lineLimit(2).truncationMode(.tail)
- if language.code == nil { Text(model.t("mobile.dub.language_unavailable")).foregroundStyle(theme.color("textMuted")) }
- }
- Spacer(minLength: 0)
- Image(systemName: language.code.map { selected.contains($0) } == true ? "checkmark.circle.fill" : "circle")
- .foregroundStyle(theme.color("messageAction")).accessibilityHidden(true)
- }.frame(minHeight: 44).contentShape(Rectangle())
- }.buttonStyle(VSButtonStyle(kind: .tertiary)).disabled(language.code == nil)
- .accessibilityLabel(language.name)
- .accessibilityValue(model.t(language.code.map { selected.contains($0) } == true ? "mobile.ios.selected" : "mobile.ios.not_selected"))
- .listRowBackground(theme.color("surface"))
- }
- }
- .scrollContentBackground(.hidden).background(theme.color("surfaceOverlay"))
- .keyboardAccessible()
- .navigationTitle(model.t("mobile.dub.target_languages"))
- .toolbar { Button(model.t("common.confirm")) { selectingLanguages = false }.buttonStyle(VSButtonStyle(kind: .tertiary)) }
- }.presentationBackground(theme.color("surfaceOverlay")).presentationCornerRadius(VSTokens.radiusLg)
+ LanguageSelectionSheet(selection: selected, includesUnavailable: true) { selected = $0 }
}
.onChange(of: sourceURL) { _, value in if !value.isEmpty { selectedFile = nil } }
.refreshable { await model.perform { model.dubHistory = try await model.api().dubHistory() }; model.monitor() }
@@ -162,7 +132,7 @@ struct ComputerDubView: View {
} label: {
Text(model.t(allowed ? "mobile.dub.translation_allow" : "mobile.dub.translation_decline"))
.frame(maxWidth: .infinity)
- }.buttonStyle(VSButtonStyle(kind: .secondary))
+ }.studioButton(.secondary)
.accessibilityIdentifier(allowed ? "dub.translation.allow" : "dub.translation.decline")
}
private func start() async {
@@ -186,7 +156,7 @@ struct ComputerDubView: View {
VStack(alignment: .leading, spacing: VSTokens.spacingGap) {
Text(item.title).lineLimit(1).truncationMode(.middle)
Text(item.metadata(locale: Locale(identifier: model.l10n.locale)))
- .font(.custom("InterVariable", size: VSTokens.textLabel.size, relativeTo: .caption))
+ .font(.caption)
.foregroundStyle(theme.color("textMuted")).lineLimit(1).truncationMode(.tail)
}.frame(maxWidth: .infinity, alignment: .leading)
}
@@ -200,7 +170,7 @@ struct ComputerDubView: View {
Task { await download(item.job_id ?? item.id, name: item.title, share: true) }
}.accessibilityIdentifier("dub.share." + item.id)
.accessibilityLabel(model.t("mobile.speak.share") + ": " + item.title)
- }.labelStyle(.iconOnly).buttonStyle(VSButtonStyle(kind: .tertiary)).disabled(model.busy)
+ }.labelStyle(.iconOnly).studioButton(.tertiary).disabled(model.busy)
}
private func download(_ id: String, name: String, share: Bool = false) async {
await model.perform {
diff --git a/mobile/ios/VoiceStudio/Features/HomeView.swift b/mobile/ios/VoiceStudio/Features/HomeView.swift
index 1622bb7f9..b3808e7df 100644
--- a/mobile/ios/VoiceStudio/Features/HomeView.swift
+++ b/mobile/ios/VoiceStudio/Features/HomeView.swift
@@ -5,27 +5,28 @@ import VoiceStudioKit
struct HomeView: View {
@Environment(AppModel.self) private var model
@Environment(\.vsTheme) private var theme
+ @Environment(\.dynamicTypeSize) private var typeSize
@State private var player = AudioPlayer()
var body: some View {
Page {
VStack(alignment: .leading, spacing: VSTokens.spacingGap * 2) {
VStack(alignment: .leading, spacing: VSTokens.spacingGap) {
- Text(model.t("homeUi.title"))
- .font(.custom("InterVariable", size: Theme.titleTypeSize, relativeTo: .title).weight(.semibold))
+ Text(model.t("mobile.ios.app_name"))
+ .font(.custom("InterVariable", size: VSTokens.iosHomeWordmarkSize, relativeTo: .title).weight(.semibold))
Text(model.t("mobile.local.privacy"))
- .font(.custom("InterVariable", size: Theme.controlTypeSize, relativeTo: .body))
+ .font(.subheadline)
.foregroundStyle(theme.color("textMuted"))
}
.frame(maxWidth: .infinity, alignment: .leading).padding(Theme.compactInset)
.background(alignment: .trailing) {
GeometryReader { geometry in
Image("HomeArtwork").resizable().scaledToFill()
- .frame(width: geometry.size.width, height: geometry.size.height).clipped().opacity(0.25)
+ .frame(width: geometry.size.width, height: geometry.size.height).clipped().opacity(0.3)
.mask(LinearGradient(colors: [theme.color("canvas").opacity(0), theme.color("canvas")], startPoint: .leading, endPoint: .trailing))
}.accessibilityHidden(true)
}
- .clipShape(RoundedRectangle(cornerRadius: VSTokens.radiusLg))
- LazyVGrid(columns: [GridItem(.adaptive(minimum: 280), spacing: VSTokens.spacingGap)], spacing: VSTokens.spacingGap) {
+ .clipShape(RoundedRectangle(cornerRadius: VSTokens.iosCardRadius, style: .continuous))
+ LazyVGrid(columns: [GridItem(.adaptive(minimum: typeSize.isAccessibilitySize ? 300 : 155), spacing: VSTokens.spacingGap)], spacing: VSTokens.spacingGap) {
destination("speak", title: "mobile.tabs.speak", detail: "mobile.speak.placeholder", icon: "waveform", primary: true) { SpeakView() }
destination("voices", title: "nav.clone", detail: "clone.reference_hint", icon: "person.wave.2", primary: true) { VoicesView() }
destination("dub", title: "nav.dub", detail: "homeUi.dub", icon: "film", primary: true) { DubView() }
@@ -72,7 +73,7 @@ struct HomeView: View {
}
}.frame(maxWidth: 900).frame(maxWidth: .infinity)
}
- .navigationTitle(model.t("nav.home")).navigationBarTitleDisplayMode(.inline)
+ .studioNavigationTitle(model.t("nav.home"))
.toolbar { NavigationLink { PhoneDubView(libraryOnly: true) } label: { Label(model.t("projects.title"), systemImage: "folder") } }
.task { await model.phone.refresh() }
.refreshable { await model.phone.refresh(); if model.connection.client != nil { await model.perform { try await model.refresh() } } }
@@ -80,26 +81,30 @@ struct HomeView: View {
}
private func destination<Content: View>(_ id: String, title: String, detail: String, icon: String, primary: Bool = false, @ViewBuilder content: () -> Content) -> some View {
NavigationLink(destination: content()) {
- HStack(spacing: VSTokens.spacingGap) {
- Image(systemName: icon).font(.title2).foregroundStyle(theme.color("messageAction"))
- .frame(width: 44, height: 44).background(theme.color("messageSurface"), in: RoundedRectangle(cornerRadius: VSTokens.radiusControl))
- VStack(alignment: .leading, spacing: VSTokens.spacingGap) {
- Text(model.t(title)).font(.custom("InterVariable", size: Theme.controlTypeSize, relativeTo: .headline).weight(.semibold))
- Text(model.t(detail)).font(.custom("InterVariable", size: VSTokens.textUi.size, relativeTo: .body)).foregroundStyle(theme.color("textMuted"))
- }.frame(maxWidth: .infinity, alignment: .leading)
- Image(systemName: "arrow.right").foregroundStyle(theme.color("textMuted")).accessibilityHidden(true)
- }.padding(Theme.compactInset).frame(maxWidth: .infinity, minHeight: primary ? 116 : 96, alignment: .leading)
- .background(theme.color(primary ? "surfaceRaised" : "surface"), in: RoundedRectangle(cornerRadius: VSTokens.radiusLg))
- .overlay(RoundedRectangle(cornerRadius: VSTokens.radiusLg).stroke(theme.color("border")))
+ VStack(alignment: .leading, spacing: VSTokens.spacingGap) {
+ HStack {
+ Image(systemName: icon).font(.title2.weight(.medium)).foregroundStyle(theme.color("messageAction"))
+ .frame(width: 44, height: 44).background(theme.color("messageSurface"), in: Circle())
+ Spacer(minLength: 0)
+ Image(systemName: "arrow.up.right").font(.caption.weight(.semibold)).foregroundStyle(theme.color("textMuted")).accessibilityHidden(true)
+ }
+ VStack(alignment: .leading, spacing: 6) {
+ Text(model.t(title)).font(.headline)
+ Text(model.t(detail)).font(.subheadline).foregroundStyle(theme.color("textMuted"))
+ .lineLimit(typeSize.isAccessibilitySize ? nil : 3)
+ }
+ Spacer(minLength: 0)
+ }.padding(Theme.compactInset).frame(maxWidth: .infinity, minHeight: primary ? 164 : 148, alignment: .topLeading)
+ .background(theme.color(primary ? "surfaceRaised" : "surface"), in: RoundedRectangle(cornerRadius: VSTokens.iosCardRadius, style: .continuous))
}.buttonStyle(.plain).accessibilityIdentifier("home.\(id)")
}
private func section<Content: View>(_ key: String, @ViewBuilder content: () -> Content) -> some View {
VStack(alignment: .leading, spacing: VSTokens.spacingGap) {
- Text(model.t(key)).font(.custom("InterVariable", size: Theme.controlTypeSize, relativeTo: .headline).weight(.semibold)).accessibilityAddTraits(.isHeader)
+ Text(model.t(key)).font(.title3.weight(.semibold)).accessibilityAddTraits(.isHeader)
VStack(alignment: .leading, spacing: VSTokens.spacingGap, content: content)
.buttonStyle(.plain).padding(Theme.compactInset).frame(maxWidth: .infinity, alignment: .leading)
- .background(theme.color("surface"), in: RoundedRectangle(cornerRadius: VSTokens.radiusLg))
- .overlay(RoundedRectangle(cornerRadius: VSTokens.radiusLg).stroke(theme.color("border")))
+ .background(theme.color("surface"), in: RoundedRectangle(cornerRadius: VSTokens.iosCardRadius, style: .continuous))
+
}
}
private func empty(_ key: String) -> some View {
@@ -108,7 +113,7 @@ struct HomeView: View {
private func row(_ title: String, subtitle: String, icon: String) -> some View {
HStack(spacing: VSTokens.spacingGap) {
Image(systemName: icon).foregroundStyle(theme.color("messageAction")).frame(width: 32)
- VStack(alignment: .leading) { Text(title).lineLimit(2); Text(subtitle).font(.custom("InterVariable", size: VSTokens.textUi.size, relativeTo: .caption)).foregroundStyle(theme.color("textMuted")) }
+ VStack(alignment: .leading) { Text(title).lineLimit(2); Text(subtitle).font(.caption).foregroundStyle(theme.color("textMuted")) }
.frame(maxWidth: .infinity, alignment: .leading)
Image(systemName: "chevron.right").foregroundStyle(theme.color("textMuted")).accessibilityHidden(true)
}.frame(minHeight: 44).contentShape(Rectangle())
diff --git a/mobile/ios/VoiceStudio/Features/ModelsView.swift b/mobile/ios/VoiceStudio/Features/ModelsView.swift
index 553a626e0..ab0eeaf14 100644
--- a/mobile/ios/VoiceStudio/Features/ModelsView.swift
+++ b/mobile/ios/VoiceStudio/Features/ModelsView.swift
@@ -7,22 +7,26 @@ struct ModelsView: View {
@State private var reviewing: PhoneModel?
var body: some View {
@Bindable var phone = model.phone
- Page {
- Text(model.t("mobile.local.storage_used", ["size": ByteCountFormatter.string(fromByteCount: phone.used, countStyle: .file)]))
- Toggle(model.t("mobile.simple.mobile_data"), isOn: $phone.allowMobileData).frame(minHeight: 44)
+ Form {
+ Section {
+ Label(model.t("mobile.local.storage_used", ["size": ByteCountFormatter.string(fromByteCount: phone.used, countStyle: .file)]), systemImage: "internaldrive")
+ Toggle(model.t("mobile.simple.mobile_data"), isOn: $phone.allowMobileData)
+ }.listRowBackground(theme.color("surface"))
if phone.error != nil {
Text(model.t("mobile.simple.models_error")).foregroundStyle(theme.color("error"))
Button(model.t("mobile.simple.retry")) { phone.error = nil; Task { await phone.refresh() } }
}
ForEach(phone.models) { item in
- Card {
- Text(item.name).font(.headline)
- Text(ByteCountFormatter.string(fromByteCount: item.total_bytes, countStyle: .file))
+ Section {
HStack {
- Text(model.t("mobile.simple." + item.capability.rawValue)).font(.caption)
+ VStack(alignment: .leading, spacing: 4) {
+ Text(item.name).font(.headline)
+ Text(model.t("mobile.simple." + item.capability.rawValue)).font(.subheadline).foregroundStyle(theme.color("textMuted"))
+ }
Spacer()
- Button(model.t("mobile.local.review_licence"), systemImage: "info.circle") { reviewing = item }.labelStyle(.iconOnly).accessibilityIdentifier("model.licence."+item.id).buttonStyle(VSButtonStyle(kind: .tertiary))
+ Button(model.t("mobile.local.review_licence"), systemImage: "info.circle") { reviewing = item }.labelStyle(.iconOnly).accessibilityIdentifier("model.licence."+item.id).studioButton(.tertiary)
}
+ Text(ByteCountFormatter.string(fromByteCount: item.total_bytes, countStyle: .file)).font(.subheadline).foregroundStyle(theme.color("textMuted"))
if !item.fits() { Text(model.t("mobile.simple.ram", ["ram": String(item.min_ram_gb)])) }
if let value = phone.progress[item.id] {
ProgressView(value: value).accessibilityLabel(model.t("mobile.local.download"))
@@ -33,9 +37,10 @@ struct ModelsView: View {
ModelDownloadButton(items: [item], titleKey: "mobile.local.download")
}
- }
+ }.listRowBackground(theme.color("surface"))
}
- }.navigationTitle(model.t("mobile.local.models"))
+ }.scrollContentBackground(.hidden).background(theme.color("canvas").ignoresSafeArea())
+ .navigationTitle(model.t("mobile.local.models")).navigationBarTitleDisplayMode(.large)
.task { await phone.refresh() }
.sheet(item: $reviewing) { item in
ModelLicenceSheet(item: item)
@@ -52,40 +57,67 @@ struct ModelLicenceSheet: View {
@State private var checked = false
@State private var saving = false
var body: some View {
+ let canAccept = checked && !saving
NavigationStack {
- Page(backgroundRole: "surfaceOverlay") {
- Text(item.name).font(.headline)
- Text(model.t("mobile.local.licence_label", ["licence": item.licence.id, "category": item.licence.category]))
- if !item.licence.credit.isEmpty { Text(item.licence.credit) }
- if !item.licence.rights_holder.isEmpty { Text(item.licence.rights_holder) }
- if let terms = item.licence.disclosure { Text(terms).textSelection(.enabled) }
- Text(model.t("mobile.local.terms_fingerprint", ["fingerprint": item.licence.terms_fingerprint])).textSelection(.enabled)
- Text(item.languages.joined(separator: ", "))
- Text(model.t("mobile.local.storage_used", ["size": ByteCountFormatter.string(fromByteCount: model.phone.modelBytes[item.id] ?? 0, countStyle: .file)]))
+ Form {
+ Section {
+ Label {
+ VStack(alignment: .leading, spacing: 6) {
+ Text(item.name).font(.title2.weight(.semibold))
+ Text(model.t("mobile.simple." + item.capability.rawValue)).font(.subheadline).foregroundStyle(theme.color("textMuted"))
+ }
+ } icon: { Image(systemName: "waveform").font(.title2).foregroundStyle(theme.color("messageAction")) }
+ Text(model.t("mobile.local.licence_label", ["licence": item.licence.id, "category": item.licence.category])).font(.subheadline)
+ if !item.licence.rights_holder.isEmpty { Text(item.licence.rights_holder).font(.subheadline) }
+ }.listRowBackground(theme.color("surface"))
+ Section {
+ if let terms = item.licence.disclosure { Text(terms).textSelection(.enabled).fixedSize(horizontal: false, vertical: true) }
+ if !item.licence.credit.isEmpty { Text(item.licence.credit).font(.footnote).foregroundStyle(theme.color("textMuted")) }
+ }.listRowBackground(theme.color("surface"))
+ Section {
+ DisclosureGroup(model.t("mobile.simple.more")) {
+ Text(model.t("mobile.local.terms_fingerprint", ["fingerprint": item.licence.terms_fingerprint])).font(.footnote.monospaced()).textSelection(.enabled)
+ Text(ListFormatter.localizedString(byJoining: item.languages.map { Locale(identifier: model.l10n.locale).localizedString(forLanguageCode: $0) ?? $0 })).font(.subheadline)
+ Text(model.t("mobile.local.storage_used", ["size": ByteCountFormatter.string(fromByteCount: model.phone.modelBytes[item.id] ?? 0, countStyle: .file)]))
+ }
+ }.listRowBackground(theme.color("surface"))
if model.phone.progress[item.id] == nil && (model.phone.modelBytes[item.id] ?? 0) > 0 && !model.phone.installed.contains(item.id) {
Button(model.t("common.delete"), role: .destructive) { Task { await model.phone.delete(item); dismiss() } }
}
if item.licence.gated {
- Text(model.t("mobile.local.licensor_notice"))
- Toggle(model.t("mobile.local.licence_confirm"), isOn: $checked).accessibilityIdentifier("models.consent").frame(minHeight: 44)
+ Section {
+ Toggle(model.t("mobile.local.licence_confirm"), isOn: $checked).accessibilityIdentifier("models.consent").disabled(saving)
+ } footer: { Text(model.t("mobile.local.licensor_notice")) }
+ .listRowBackground(theme.color("surface"))
if model.phone.accepted.contains(item.id) {
Button(model.t("mobile.local.withdraw"), role: .destructive) {
Task { saving = true; defer { saving = false }; if await model.phone.accept(item, accepted: false) { dismiss() } }
}
}
- HStack {
- Button(model.t("mobile.simple.accept")) {
- Task {
- saving = true; defer { saving = false }
- if await model.phone.accept(item, accepted: true) { onAccepted(); dismiss() }
- }
- }.disabled(!checked || saving).accessibilityIdentifier("models.accept")
- Button(model.t("mobile.simple.decline")) { dismiss() }.disabled(saving)
- }
}
- }.navigationTitle(model.t("mobile.local.review_licence"))
- .toolbar { Button(model.t("common.close")) { dismiss() }.disabled(saving) }
- }.interactiveDismissDisabled(saving).presentationBackground(theme.color("surfaceOverlay"))
+ }.scrollContentBackground(.hidden)
+ .navigationTitle(model.t("mobile.local.review_licence")).navigationBarTitleDisplayMode(.inline)
+ .toolbar {
+ ToolbarItem(placement: .cancellationAction) {
+ Button(model.t("common.close")) { dismiss() }.disabled(saving)
+ }
+ }
+ .safeAreaInset(edge: .bottom, spacing: 0) {
+ if item.licence.gated {
+ Button {
+ Task {
+ saving = true; defer { saving = false }
+ if await model.phone.accept(item, accepted: true) { onAccepted(); dismiss() }
+ }
+ } label: {
+ HStack { if saving { ProgressView() }; Text(model.t("mobile.simple.accept")) }.frame(maxWidth: .infinity, minHeight: 44)
+ }.studioButton(.primary)
+ .disabled(!canAccept).accessibilityIdentifier("models.accept")
+ .padding(Theme.compactInset).background(.bar)
+ }
+ }
+ }.interactiveDismissDisabled(saving)
+ .presentationDetents([.large]).presentationDragIndicator(.visible)
}
}
@@ -175,7 +207,7 @@ struct LocalDownloadPrompt: View {
}
}.frame(maxWidth: .infinity, alignment: .leading)
}
- }.buttonStyle(VSButtonStyle(kind: .tertiary)).accessibilityIdentifier("models.open")
+ }.studioButton(.tertiary).accessibilityIdentifier("models.open")
ModelDownloadButton(items: needed)
}
if let progress { ProgressView(value: progress).accessibilityLabel(model.t("mobile.local.download")) }
diff --git a/mobile/ios/VoiceStudio/Features/PhoneDubView.swift b/mobile/ios/VoiceStudio/Features/PhoneDubView.swift
index bb45bf40d..f1ee49576 100644
--- a/mobile/ios/VoiceStudio/Features/PhoneDubView.swift
+++ b/mobile/ios/VoiceStudio/Features/PhoneDubView.swift
@@ -14,7 +14,6 @@ struct PhoneDubView: View {
@State private var importing = false
@State private var targets = Set<String>()
@State private var languages = false
- @State private var query = ""
@State private var voice = ""
@State private var consent = false
@State private var audioOnly = false
@@ -38,7 +37,7 @@ struct PhoneDubView: View {
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)))
}
- }.buttonStyle(VSButtonStyle(kind: .tertiary)).accessibilityIdentifier("dub.languages")
+ }.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]))
@@ -57,7 +56,7 @@ struct PhoneDubView: View {
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() }.buttonStyle(VSButtonStyle(kind: .primary))
+ 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")) }
@@ -92,33 +91,15 @@ struct PhoneDubView: View {
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).buttonStyle(VSButtonStyle(kind: .tertiary))
+ }.labelStyle(.iconOnly).studioButton(.tertiary)
}
}
- }.navigationTitle(projectID != nil ? (records.first?.request.title ?? model.t("projects.title")) : model.t(libraryOnly ? "projects.title" : "mobile.tabs.dub")).navigationBarTitleDisplayMode(.large)
+ }.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") }
}
.sheet(isPresented: $languages) {
- NavigationStack {
- List {
- SearchField(prompt: model.t("common.search"),text: $query)
- let filtered = model.languages.search(query,includeAuto: false).filter { $0.code != nil }
- if filtered.isEmpty { SearchEmptyState(query: query) }
- ForEach(filtered) { language in
- Button {
- if let code = language.code { if targets.contains(code) { targets.remove(code) } else { targets.insert(code) } }
- } label: {
- HStack { Text(language.name); Spacer(); Image(systemName: targets.contains(language.code ?? "") ? "checkmark.circle.fill" : "circle") }.frame(minHeight: 44)
- }.buttonStyle(VSButtonStyle(kind: .tertiary))
- .accessibilityValue(model.t(targets.contains(language.code ?? "") ? "mobile.ios.selected" : "mobile.ios.not_selected"))
- .accessibilityAddTraits(targets.contains(language.code ?? "") ? .isSelected : [])
- .listRowBackground(theme.color("surface"))
- }
- }.scrollContentBackground(.hidden).background(theme.color("surfaceOverlay")).keyboardAccessible()
- .navigationTitle(model.t("mobile.dub.target_languages"))
- .toolbar { Button(model.t("common.confirm")) { languages = false } }
- }.presentationBackground(theme.color("surfaceOverlay"))
+ LanguageSelectionSheet(selection: targets, includesUnavailable: false) { targets = $0 }
}
.sheet(item: $shared) { file in ShareSheet(items: [file.url]) }
.sheet(item: $saved) { file in SaveFileSheet(url: file.url) }
diff --git a/mobile/ios/VoiceStudio/Features/SettingsView.swift b/mobile/ios/VoiceStudio/Features/SettingsView.swift
index 52448cc11..b2e885019 100644
--- a/mobile/ios/VoiceStudio/Features/SettingsView.swift
+++ b/mobile/ios/VoiceStudio/Features/SettingsView.swift
@@ -3,42 +3,48 @@ import VoiceStudioKit
struct SettingsView: View {
@Environment(AppModel.self) private var model
+ @Environment(\.vsTheme) private var theme
var body: some View {
@Bindable var model = model
- Page {
- Card {
- NavigationLink { ConnectView() } label: { HStack { Image(systemName: "link").accessibilityHidden(true); SelectionRow(label: model.t("mobile.settings.connection"),value: model.connection.active?.label ?? "") } }.accessibilityIdentifier("settings.connect")
+ Form {
+ Section {
+ NavigationLink { ConnectView() } label: {
+ LabeledContent {
+ Text(model.connection.active?.label ?? "").foregroundStyle(theme.color("textMuted"))
+ } label: { Label(model.t("mobile.settings.connection"), systemImage: "link") }
+ }.accessibilityIdentifier("settings.connect")
NavigationLink { ModelsView() } label: { Label(model.t("mobile.local.models"),systemImage: "arrow.down.circle") }
}
if model.connection.client != nil {
- Card {
+ Section {
NavigationLink { ConnectView() } label: { Label(model.t("mobile.connect.saved_hosts"),systemImage: "desktopcomputer") }.disabled(model.busy || BackgroundUpload.shared.pending != nil)
Button(model.t("mobile.connect.disconnect"), systemImage: "personalhotspot.slash", role: .destructive) { Task { await model.perform(connectionChange: true) { model.pauseMonitor(); await BackgroundUpload.shared.cancel(); try await model.connection.disconnect(); model.profiles = []; model.history = []; model.dubHistory = []; model.inventory = nil } } }.disabled(model.busy)
}
}
- Card {
+ Section {
ChoicePicker(label: model.t("mobile.settings.mode"), selection: Binding(get: { model.theme.mode.rawValue }, set: { model.theme.mode = ThemeMode(rawValue: $0) ?? .dark }), options: ThemeMode.allCases.map { SelectionOption(id: $0.rawValue, title: model.t("mobile.settings.mode_" + $0.rawValue)) }, icon: "circle.lefthalf.filled")
palette(key: "mobile.settings.light_palette", selection: $model.theme.lightPalette)
palette(key: "mobile.settings.dark_palette", selection: $model.theme.darkPalette)
}
- Card {
+ Section {
ChoicePicker(label: model.t("mobile.settings.language"), selection: $model.language, options:
[SelectionOption(id: "", title: model.t("mobile.ios.language_system"))] + L10n.languages.map { SelectionOption(id: $0, title: Locale(identifier: $0).localizedString(forIdentifier: $0) ?? $0) }, icon: "globe").accessibilityIdentifier("settings.language")
Toggle(isOn: Binding(get: { model.notifications }, set: { value in Task { await model.enableNotifications(value) } })) { Label(model.t("mobile.settings.notifications"),systemImage: "bell") }.frame(minHeight: 44)
}
- Card {
+ Section {
InfoButton(title: model.t("mobile.simple.privacy"), detail: model.t("mobile.local.privacy"), row: true, icon: "shield")
Toggle(isOn: $model.analytics) { Label(model.t("mobile.simple.analytics"),systemImage: "chart.bar") }.frame(minHeight: 44)
}
- Card {
+ Section {
HStack { Label(model.t("mobile.ios.app_name"),systemImage: "info.circle"); Spacer(); Text(Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? model.t("common.unknown")) }
NavigationLink { LicensesView() } label: { Label(model.t("mobile.settings.licenses"),systemImage: "doc.text") }
if let host = model.connection.active {
Link(destination: host.url) { Label(model.t("mobile.ios.model_licenses"),systemImage: "doc.badge.gearshape") }
}
}
- }.navigationTitle(model.t("mobile.tabs.settings")).navigationBarTitleDisplayMode(.large)
+ }.scrollContentBackground(.hidden).background(theme.color("canvas").ignoresSafeArea())
+ .studioNavigationTitle(model.t("mobile.tabs.settings"))
}
private func palette(key: String, selection: Binding<String>) -> some View {
ChoicePicker(label: model.t(key), selection: selection, options: VSTokens.palettes.map { SelectionOption(id: $0.id, title: Theme.paletteLabel($0, l10n: model.l10n), swatch: Theme(palette: $0.id, appearance: key == "mobile.settings.light_palette" ? .light : .dark)) }, icon: "paintpalette").accessibilityIdentifier(key)
diff --git a/mobile/ios/VoiceStudio/Features/SpeakView.swift b/mobile/ios/VoiceStudio/Features/SpeakView.swift
index 62987a841..e43bb81c7 100644
--- a/mobile/ios/VoiceStudio/Features/SpeakView.swift
+++ b/mobile/ios/VoiceStudio/Features/SpeakView.swift
@@ -18,6 +18,7 @@ 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"
@@ -49,13 +50,13 @@ struct SpeakView: View {
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: VSTokens.textEditor.lineHeight * 6)
+ TextEditor(text: $text).frame(minHeight: 240)
.scrollContentBackground(.hidden).padding(Theme.compactInset)
- .background(theme.color("input"), in: RoundedRectangle(cornerRadius: VSTokens.radiusControl))
+ .background(theme.color("input"), in: RoundedRectangle(cornerRadius: VSTokens.iosCardRadius, style: .continuous))
.accessibilityLabel(model.t("mobile.speak.placeholder")).accessibilityIdentifier("speak.text")
}
if route != .computer {
- HStack(spacing: VSTokens.spacingGap) {
+ 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)
@@ -71,39 +72,8 @@ struct SpeakView: View {
options: model.languages.languages.map { SelectionOption(id: $0.value, title: $0.name) }, compact: true).accessibilityIdentifier("speak.language")
}
}
- Button(model.t(generating ? "mobile.speak.generating" : "mobile.speak.generate"), systemImage: "waveform") {
- generation = Task {
- generating = true; defer { generating = false; localProgress = nil }
- await model.perform(onPhone: route == .phone) {
- if route == .phone {
- guard let phoneModel, let engine = model.phone.engine else { throw ClientError("mobile.local.model_required") }
- let audio: LocalAudio
- let report: EngineProgressHandler = { value in await MainActor.run { localProgress = value } }
- if let voice = phoneVoice, let store = model.phone.voiceStore {
- let reference = try await store.reference(voice)
- audio = try await engine.clone(model: phoneModel,text: text,reference: reference,referenceText: voice.transcript,progress: report)
- } else {
- audio = try await engine.synthesize(model: phoneModel.selectingLanguage(phoneLanguage),text: text,speaker: Int(speakerID) ?? 0,speed: 1,progress: report)
- }
- _ = try await model.phone.generationStore?.save(text: text,audio: audio)
- await model.phone.refresh()
- try await player.load(audio.markSynthetic(), extension: "wav")
- return
- }
- let result = try await model.hostState.generate(api: model.api(), text: text, profile: selection.profileID, engine: selection.engineID, language: selection.language)
- try await player.load(result.audio, extension: "wav")
- model.history = try await model.api().history()
- }
- }
- }.buttonStyle(VSButtonStyle(kind: .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")
- if generating {
- if let value = localProgress { ProgressView(value: value.fraction).accessibilityLabel(model.t("mobile.ios.progress")) }
- Button(model.t("common.cancel")) { generation?.cancel() }
- }
if player.file != nil || player.playing { AudioPlayerView(player: player) }
- Text(model.t("mobile.speak.recent")).font(.custom("InterVariable", size: Theme.controlTypeSize, relativeTo: .headline))
+ 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
@@ -114,7 +84,7 @@ struct SpeakView: View {
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).buttonStyle(VSButtonStyle(kind: .tertiary))
+ }.labelStyle(.iconOnly).studioButton(.tertiary)
}
} else if model.history.isEmpty && !model.loading { EmptyState(key: "mobile.simple.empty_recent") }
else {
@@ -123,18 +93,21 @@ struct SpeakView: View {
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).buttonStyle(VSButtonStyle(kind: .tertiary))
+ .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).buttonStyle(VSButtonStyle(kind: .tertiary)).frame(minWidth: 44, minHeight: 44)
+ .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)
+ .safeAreaInset(edge: .bottom, spacing: 0) {
+ generationControls.padding(Theme.compactInset).background(.bar)
+ }
.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) }
.refreshable { if model.connection.client != nil { await model.perform { try await model.refresh() } }; await model.phone.refresh(); selection.reconcile(inventory: model.inventory, profiles: model.profiles) }
@@ -150,6 +123,49 @@ 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 generationControls: some View {
+ VStack(spacing: VSTokens.spacingGap) {
+ Button {
+ generation = Task {
+ generating = true; defer { generating = false; localProgress = nil }
+ await model.perform(onPhone: route == .phone) {
+ if route == .phone {
+ guard let phoneModel, let engine = model.phone.engine else { throw ClientError("mobile.local.model_required") }
+ let audio: LocalAudio
+ let report: EngineProgressHandler = { value in await MainActor.run { localProgress = value } }
+ if let voice = phoneVoice, let store = model.phone.voiceStore {
+ let reference = try await store.reference(voice)
+ audio = try await engine.clone(model: phoneModel,text: text,reference: reference,referenceText: voice.transcript,progress: report)
+ } else {
+ audio = try await engine.synthesize(model: phoneModel.selectingLanguage(phoneLanguage),text: text,speaker: Int(speakerID) ?? 0,speed: 1,progress: report)
+ }
+ _ = try await model.phone.generationStore?.save(text: text,audio: audio)
+ await model.phone.refresh()
+ try await player.load(audio.markSynthetic(), extension: "wav")
+ return
+ }
+ let result = try await model.hostState.generate(api: model.api(), text: text, profile: selection.profileID, engine: selection.engineID, language: selection.language)
+ try await player.load(result.audio, extension: "wav")
+ model.history = try await model.api().history()
+ }
+ }
+ } label: {
+ Label(model.t(generating ? "mobile.speak.generating" : "mobile.speak.generate"), systemImage: "waveform")
+ .frame(maxWidth: .infinity, minHeight: 44)
+ }.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")
+ if generating {
+ if let value = localProgress { ProgressView(value: value.fraction).accessibilityLabel(model.t("mobile.ios.progress")) }
+ Button(model.t("common.cancel")) { generation?.cancel() }
+ }
+ }
+ }
private func reconcilePhone() {
if phoneVoice != nil { phoneLanguage = "auto" }
else {
diff --git a/mobile/ios/VoiceStudio/Features/VoicesView.swift b/mobile/ios/VoiceStudio/Features/VoicesView.swift
index 65f7eb220..84cc1e4c5 100644
--- a/mobile/ios/VoiceStudio/Features/VoicesView.swift
+++ b/mobile/ios/VoiceStudio/Features/VoicesView.swift
@@ -30,8 +30,12 @@ struct VoicesView: View {
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)
if entries.isEmpty && !model.loading {
- EmptyState(key: "mobile.simple.empty_voices", icon: "person")
- Button(model.t("mobile.voices.new_clone"), systemImage: "plus") { creating = true }.buttonStyle(VSButtonStyle(kind: .primary))
+ 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)
} else {
Card {
if filtered.isEmpty { SearchEmptyState(query: query) }
@@ -49,23 +53,23 @@ struct VoicesView: View {
else { bytes = try await model.api().profileAudio(entry.id) }
try await player.load(bytes,extension: "wav"); player.play()
} }
- }.labelStyle(.iconOnly).buttonStyle(VSButtonStyle(kind: .tertiary))
+ }.labelStyle(.iconOnly).studioButton(.tertiary)
Menu {
Button(model.t("mobile.voices.rename"),systemImage: "pencil") { name = entry.name; renamed = entry }
Button(model.t("common.delete"),systemImage: "trash",role: .destructive) { deleting = entry }
} label: { Label(model.t("mobile.ios.more_actions"),systemImage: "ellipsis") }
- .labelStyle(.iconOnly).buttonStyle(VSButtonStyle(kind: .tertiary)).frame(minWidth: 44,minHeight: 44).accessibilityIdentifier("voices.actions."+entry.id)
+ .labelStyle(.iconOnly).studioButton(.tertiary).frame(minWidth: 44,minHeight: 44).accessibilityIdentifier("voices.actions."+entry.id)
}
if entry.id != filtered.last?.id { Divider().overlay(theme.color("border")) }
}
}
}
if player.file != nil { AudioPlayerView(player: player) }
- }.navigationTitle(model.t("mobile.tabs.voices")).navigationBarTitleDisplayMode(.large)
+ }.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() }
.refreshable { await model.phone.refresh(); if model.connection.client != nil { await model.perform { model.profiles = try await model.api().profiles() } } }
- .sheet(isPresented: $creating) { NavigationStack { CloneView(preference: preference) }.environment(model).presentationBackground(theme.color("surfaceOverlay")) }
+ .fullScreenCover(isPresented: $creating) { NavigationStack { CloneView(preference: preference) }.environment(model) }
.sheet(item: $renamed) { entry in
NavigationStack {
Page(backgroundRole: "surfaceOverlay") {
@@ -74,10 +78,10 @@ struct VoicesView: View {
if let voice = entry.phone { try await model.phone.voiceStore?.rename(voice,name: name); await model.phone.refresh() }
else { try await model.api().rename(entry.id,name: name); model.profiles = try await model.api().profiles() }
renamed = nil
- } } }.buttonStyle(VSButtonStyle(kind: .primary)).disabled(name.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty || model.busy)
+ } } }.studioButton(.primary).disabled(name.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty || model.busy)
}.navigationTitle(model.t("mobile.voices.rename"))
- .toolbar { Button(model.t("common.cancel")) { renamed = nil } }
- }.presentationBackground(theme.color("surfaceOverlay"))
+ .toolbar { ToolbarItem(placement: .cancellationAction) { Button(model.t("common.cancel")) { renamed = nil } } }
+ }.presentationDetents([.medium, .large]).presentationDragIndicator(.visible)
}
.sheet(item: $deleting) { entry in
DeleteConfirmation(title: model.t("mobile.voices.delete_confirm",["name": entry.name])) {
@@ -134,15 +138,21 @@ struct CloneView: View {
}
if recorder.recording { Text(model.t("mobile.voices.recording",["seconds": String(recorder.seconds)])) }
if let audio { SelectedFileRow(name: audio.name) { self.audio = nil } }
- Button(model.t("mobile.ios.clone_create"),systemImage: "person.badge.plus") { create() }
- .buttonStyle(VSButtonStyle(kind: .primary))
+ }.navigationTitle(model.t("mobile.voices.new_clone"))
+ .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)
+ }
+ .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))
if running {
ProgressView(value: progress).accessibilityLabel(model.t("mobile.ios.progress"))
Button(model.t("common.cancel")) { work?.cancel() }
}
- }.navigationTitle(model.t("mobile.voices.new_clone"))
- .toolbar { Button(model.t("common.cancel")) { work?.cancel(); recorder.stop(); dismiss() } }
+ }.padding(Theme.compactInset).background(.bar)
+ }
+ .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") }
}
diff --git a/mobile/ios/VoiceStudio/Platform/Audio.swift b/mobile/ios/VoiceStudio/Platform/Audio.swift
index 1b4fa8cc0..78ca53fb3 100644
--- a/mobile/ios/VoiceStudio/Platform/Audio.swift
+++ b/mobile/ios/VoiceStudio/Platform/Audio.swift
@@ -129,20 +129,20 @@ struct AudioPlayerView: View {
HStack(spacing: VSTokens.spacingGap) {
Button(model.t(player.playing ? "common.pause" : "common.play"), systemImage: player.playing ? "pause.fill" : "play.fill") {
if player.playing { player.pause() } else { player.play() }
- }.labelStyle(.iconOnly).buttonStyle(VSButtonStyle(kind: .tertiary)).accessibilityIdentifier("audio.play")
+ }.labelStyle(.iconOnly).studioButton(.tertiary).accessibilityIdentifier("audio.play")
Slider(value: Binding(get: { min(player.position, max(1, player.duration)) }, set: { player.seek($0) }), in: 0...max(1, player.duration))
.accessibilityLabel(model.t("player.seek"))
.accessibilityValue(PlaybackTime.format(player.position))
if let file = player.file {
ShareLink(item: file) { Label(model.t("mobile.speak.share"), systemImage: "square.and.arrow.up") }
- .labelStyle(.iconOnly).buttonStyle(VSButtonStyle(kind: .tertiary))
+ .labelStyle(.iconOnly).studioButton(.tertiary)
}
}
HStack {
Text(PlaybackTime.format(player.position))
Spacer(minLength: 0)
Text(PlaybackTime.format(player.duration))
- }.font(.custom("InterVariable", size: VSTokens.textCaption.size, relativeTo: .caption))
+ }.font(.caption)
.monospacedDigit().foregroundStyle(theme.color("textMuted"))
}
.onChange(of: player.error) { _, error in if let error { model.error = error; player.error = nil } }
diff --git a/mobile/ios/VoiceStudio/Platform/PhoneModels.swift b/mobile/ios/VoiceStudio/Platform/PhoneModels.swift
index 9f43c056a..2cfa5e367 100644
--- a/mobile/ios/VoiceStudio/Platform/PhoneModels.swift
+++ b/mobile/ios/VoiceStudio/Platform/PhoneModels.swift
@@ -44,12 +44,14 @@ final class WifiState: @unchecked Sendable {
init(bundle: Bundle = .main) {
allowMobileData = UserDefaults.standard.bool(forKey: "models.mobile-data")
do {
- let root: URL
- if ProcessInfo.processInfo.arguments.contains("--ui-smoke") {
- root = FileManager.default.temporaryDirectory.appendingPathComponent("PhoneModels-smoke-" + UUID().uuidString, isDirectory: true)
- } else {
- root = try FileManager.default.url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: true).appendingPathComponent("PhoneModels", isDirectory: true)
- }
+ let root: URL = try {
+ #if DEBUG
+ if ProcessInfo.processInfo.arguments.contains("--ui-smoke") {
+ return FileManager.default.temporaryDirectory.appendingPathComponent("PhoneModels-smoke-" + UUID().uuidString, isDirectory: true)
+ }
+ #endif
+ return try FileManager.default.url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: true).appendingPathComponent("PhoneModels", isDirectory: true)
+ }()
let store = try ModelStore(root: root)
self.store = store; engine = NativeLocalEngine(store: store)
guard let url = bundle.url(forResource: "models", withExtension: "json", subdirectory: "Catalogs") else { throw ClientError("mobile.local.catalogue_failed") }
@@ -65,6 +67,18 @@ final class WifiState: @unchecked Sendable {
self.error = error as? ClientError ?? ClientError("mobile.local.catalogue_failed")
}
+ #if DEBUG
+ if ProcessInfo.processInfo.arguments.contains("--ui-smoke"),
+ ProcessInfo.processInfo.arguments.contains("--ui-phone-history") {
+ Task {
+ if let generationStore {
+ _ = try? await generationStore.save(text: "Saved audio for deletion review",
+ audio: LocalAudio(samples: Array(repeating: 0, count: 16000), sampleRate: 16000))
+ await refresh()
+ }
+ }
+ }
+ #endif
}
func refresh() async {
guard let store else { return }
diff --git a/mobile/ios/VoiceStudio/Platform/SmokeTransport.swift b/mobile/ios/VoiceStudio/Platform/SmokeTransport.swift
index 55db1c38a..58e2125ea 100644
--- a/mobile/ios/VoiceStudio/Platform/SmokeTransport.swift
+++ b/mobile/ios/VoiceStudio/Platform/SmokeTransport.swift
@@ -1,6 +1,7 @@
import Foundation
import VoiceStudioKit
+#if DEBUG
/// Only selected by the UI test launch argument. No socket is opened.
actor SmokeVault: CredentialVault {
private var values: [String: Credentials] = [:]
@@ -26,7 +27,7 @@ struct SmokeTransport: HTTPTransport {
}
private func reply(_ json: String, headers: [String: String] = [:]) -> HTTPReply { HTTPReply(data: Data(json.utf8), headers: headers) }
private static func wav() -> Data {
- let count: UInt32 = 16000
+ let count: UInt32 = 16000 * 5
var result = Data()
func ascii(_ text: String) { result.append(Data(text.utf8)) }
func u32(_ n: UInt32) { var value = n.littleEndian; withUnsafeBytes(of: &value) { result.append(contentsOf: $0) } }
@@ -36,3 +37,4 @@ struct SmokeTransport: HTTPTransport {
return result
}
}
+#endif
diff --git a/mobile/ios/VoiceStudioKit/Sources/VoiceStudioKit/Theme/Tokens.generated.swift b/mobile/ios/VoiceStudioKit/Sources/VoiceStudioKit/Theme/Tokens.generated.swift
index 3acea048f..4a0a45549 100644
--- a/mobile/ios/VoiceStudioKit/Sources/VoiceStudioKit/Theme/Tokens.generated.swift
+++ b/mobile/ios/VoiceStudioKit/Sources/VoiceStudioKit/Theme/Tokens.generated.swift
@@ -843,4 +843,7 @@ public enum VSTokens {
public static let radiusControl: Double = 8.00
public static let spacingGap: Double = 16.00
public static let spacingInset: Double = 24.00
+ public static let iosCardRadius: Double = 24.00
+ public static let iosFieldRadius: Double = 16.00
+ public static let iosHomeWordmarkSize: Double = 28.00
}
diff --git a/mobile/ios/VoiceStudioKit/Tests/VoiceStudioKitTests/LocalInferenceTests.swift b/mobile/ios/VoiceStudioKit/Tests/VoiceStudioKitTests/LocalInferenceTests.swift
index 5a02ec184..fc6504c4e 100644
--- a/mobile/ios/VoiceStudioKit/Tests/VoiceStudioKitTests/LocalInferenceTests.swift
+++ b/mobile/ios/VoiceStudioKit/Tests/VoiceStudioKitTests/LocalInferenceTests.swift
@@ -439,24 +439,35 @@ private final class NativeWorkGate: @unchecked Sendable {
var count: Int { lock.withLock { calls } }
func run() { lock.withLock { calls += 1 }; finish.wait() }
}
-@Test func reviewCancelledExecuteKeepsBothLeasesUntilWorkerCleanup() async throws {
- let root = try localDirectory(); defer { try? FileManager.default.removeItem(at: root) }
- let model = try localFixture(), store = try ModelStore(root: root,available: { _ in 100_000_000 })
- try await store.download(model,wifi: { true },transport: RangeServer(bytes: Data("model".utf8)))
- let engine = NativeLocalEngine(store: store), first = NativeWorkGate(), second = NativeWorkGate()
- let work = Task { try await engine.execute(model,capability: .tts,progress: { _ in }) { _,_,_,_ in first.run(); return 1 } }
- while first.count == 0 { try await Task.sleep(for: .milliseconds(5)) }
- work.cancel()
- let next = Task { try await engine.execute(model,capability: .tts,progress: { _ in }) { _,_,_,_ in second.run(); return 2 } }
- try await Task.sleep(for: .milliseconds(150))
- #expect(second.count == 0)
- await #expect(throws: (any Error).self) { try await store.delete(model) }
- first.finish.signal()
- await #expect(throws: CancellationError.self) { try await work.value }
- while second.count == 0 { try await Task.sleep(for: .milliseconds(5)) }
- second.finish.signal()
- #expect(try await next.value == 2)
- try await store.delete(model)
+// These tests deliberately hold the process-wide native permit. Run them in
+// sequence so one test cannot consume another test's worker-start deadline.
+@Suite(.serialized) struct NativeLeaseRegressionTests {
+ @Test func reviewCancelledExecuteKeepsBothLeasesUntilWorkerCleanup() async throws {
+ let root = try localDirectory(); defer { try? FileManager.default.removeItem(at: root) }
+ let model = try localFixture(), store = try ModelStore(root: root,available: { _ in 100_000_000 })
+ try await store.download(model,wifi: { true },transport: RangeServer(bytes: Data("model".utf8)))
+ let engine = NativeLocalEngine(store: store), first = NativeWorkGate(), second = NativeWorkGate()
+ defer { first.finish.signal(); second.finish.signal() }
+ let work = Task { try await engine.execute(model,capability: .tts,progress: { _ in }) { _,_,_,_ in first.run(); return 1 } }
+ defer { work.cancel() }
+ let firstDeadline = ContinuousClock.now + .seconds(10)
+ while first.count == 0 && ContinuousClock.now < firstDeadline { try await Task.sleep(for: .milliseconds(5)) }
+ try #require(first.count == 1)
+ work.cancel()
+ let next = Task { try await engine.execute(model,capability: .tts,progress: { _ in }) { _,_,_,_ in second.run(); return 2 } }
+ defer { next.cancel() }
+ try await Task.sleep(for: .milliseconds(150))
+ #expect(second.count == 0)
+ await #expect(throws: (any Error).self) { try await store.delete(model) }
+ first.finish.signal()
+ await #expect(throws: CancellationError.self) { try await work.value }
+ let secondDeadline = ContinuousClock.now + .seconds(10)
+ while second.count == 0 && ContinuousClock.now < secondDeadline { try await Task.sleep(for: .milliseconds(5)) }
+ try #require(second.count == 1)
+ second.finish.signal()
+ #expect(try await next.value == 2)
+ try await store.delete(model)
+ }
}
@Test func reviewCompactErrorsRetainLocalizedRecoveryAndConnectionCause() throws {
@@ -477,26 +488,28 @@ private final class NativeWorkGate: @unchecked Sendable {
}
}
-@Test func reviewQueuedNativeWorkReverifiesAfterPriorNativeFailure() async throws {
- let root = try localDirectory(); defer { try? FileManager.default.removeItem(at: root) }
- let model = try localFixture(), store = try ModelStore(root: root,available: { _ in 100_000_000 })
- try await store.download(model,wifi: { true },transport: RangeServer(bytes: Data("model".utf8)))
- let path = try await store.authorize(model), held = NativeWorkGate(), engine = NativeLocalEngine(store: store)
- defer { held.finish.signal() }
- let first = Task { try await engine.execute(model,capability: .tts,progress: { _ in }) { _,_,_,_ -> Bool in
- held.run(); throw ClientError("mobile.local.inference_failed")
- } }
- let deadline = ContinuousClock.now + .seconds(5)
- while held.count == 0 && ContinuousClock.now < deadline { try await Task.sleep(for: .milliseconds(5)) }
- try #require(held.count == 1)
- let queued = Task { try await engine.execute(model,capability: .tts,progress: { _ in }) { _,_,_,_ in true } }
- defer { first.cancel(); queued.cancel() }
- try await Task.sleep(for: .milliseconds(100))
- let file = path.appendingPathComponent("model.bin")
- let modified = try file.resourceValues(forKeys: [.contentModificationDateKey]).contentModificationDate!
- try Data("other".utf8).write(to: file)
- try FileManager.default.setAttributes([.modificationDate: modified],ofItemAtPath: file.path)
- held.finish.signal()
- await #expect(throws: ClientError.self) { try await first.value }
- await #expect(throws: ClientError("mobile.local.checksum_failed")) { try await queued.value }
+extension NativeLeaseRegressionTests {
+ @Test func reviewQueuedNativeWorkReverifiesAfterPriorNativeFailure() async throws {
+ let root = try localDirectory(); defer { try? FileManager.default.removeItem(at: root) }
+ let model = try localFixture(), store = try ModelStore(root: root,available: { _ in 100_000_000 })
+ try await store.download(model,wifi: { true },transport: RangeServer(bytes: Data("model".utf8)))
+ let path = try await store.authorize(model), held = NativeWorkGate(), engine = NativeLocalEngine(store: store)
+ defer { held.finish.signal() }
+ let first = Task { try await engine.execute(model,capability: .tts,progress: { _ in }) { _,_,_,_ -> Bool in
+ held.run(); throw ClientError("mobile.local.inference_failed")
+ } }
+ let deadline = ContinuousClock.now + .seconds(5)
+ while held.count == 0 && ContinuousClock.now < deadline { try await Task.sleep(for: .milliseconds(5)) }
+ try #require(held.count == 1)
+ let queued = Task { try await engine.execute(model,capability: .tts,progress: { _ in }) { _,_,_,_ in true } }
+ defer { first.cancel(); queued.cancel() }
+ try await Task.sleep(for: .milliseconds(100))
+ let file = path.appendingPathComponent("model.bin")
+ let modified = try file.resourceValues(forKeys: [.contentModificationDateKey]).contentModificationDate!
+ try Data("other".utf8).write(to: file)
+ try FileManager.default.setAttributes([.modificationDate: modified],ofItemAtPath: file.path)
+ held.finish.signal()
+ await #expect(throws: ClientError.self) { try await first.value }
+ await #expect(throws: ClientError("mobile.local.checksum_failed")) { try await queued.value }
+ }
}
diff --git a/mobile/ios/VoiceStudioUITests/ApplePresentationScreens.swift b/mobile/ios/VoiceStudioUITests/ApplePresentationScreens.swift
new file mode 100644
index 000000000..5e9fa6179
--- /dev/null
+++ b/mobile/ios/VoiceStudioUITests/ApplePresentationScreens.swift
@@ -0,0 +1,58 @@
+import XCTest
+
+final class ApplePresentationScreens: XCTestCase {
+ @MainActor func testLargeTextKeepsCreationAndLicenceActionsReachable() {
+ let app = XCUIApplication()
+ app.launchArguments = ["--ui-smoke", "-AppleLanguages", "(en)",
+ "-UIPreferredContentSizeCategoryName", "UICTContentSizeCategoryAccessibilityXXXL"]
+ app.launch()
+ XCTAssertTrue(app.buttons["consent.no"].waitForExistence(timeout: 10))
+ app.buttons["consent.no"].tap()
+ app.openSpeak()
+ let generate = app.buttons["speak.generate"]
+ XCTAssertTrue(generate.waitForExistence(timeout: 5))
+ XCTAssertTrue(generate.isHittable)
+ XCTAssertGreaterThanOrEqual(generate.frame.height, 44)
+ XCTAssertFalse(generate.isEnabled)
+ app.tabButton("Settings").tap()
+ let models = app.buttons["Models"]
+ for _ in 0..<8 { if models.isHittable { break }; app.swipeUp() }
+ models.tap()
+ app.buttons["model.licence.kitten-mini-en-fp16"].tap()
+ let accept = app.buttons["models.accept"]
+ XCTAssertTrue(accept.waitForExistence(timeout: 5))
+ XCTAssertTrue(accept.isHittable)
+ XCTAssertGreaterThanOrEqual(accept.frame.height, 44)
+ XCTAssertFalse(accept.isEnabled)
+ XCTAssertTrue(app.buttons["Close"].isHittable)
+ let image = XCTAttachment(screenshot: app.screenshot())
+ image.name = "Licence-accessibility-text"; image.lifetime = .keepAlways; add(image)
+ app.buttons["Close"].tap()
+ XCTAssertTrue(app.navigationBars["Models"].waitForExistence(timeout: 5))
+ }
+
+ @MainActor func testCancellingLanguageSelectionDiscardsDraft() {
+ let app = XCUIApplication()
+ app.launchArguments = ["--ui-smoke", "-AppleLanguages", "(en)"]
+ app.launch()
+ XCTAssertTrue(app.buttons["consent.no"].waitForExistence(timeout: 10))
+ app.buttons["consent.no"].tap()
+ app.tabButton("Dub").tap()
+ app.buttons["dub.languages"].tap()
+ let french = app.buttons["French"]
+ if !french.isHittable {
+ let search = app.textFields["search.field"]
+ search.tap(); search.typeText("French")
+ app.buttons["keyboard.done"].tap()
+ }
+ french.tap()
+ XCTAssertEqual(french.value as? String, "Selected")
+ app.buttons["Cancel"].tap()
+ app.buttons["dub.languages"].tap()
+ let reopenedSearch = app.textFields["search.field"]
+ reopenedSearch.tap(); reopenedSearch.typeText("French")
+ app.buttons["keyboard.done"].tap()
+ XCTAssertEqual(app.buttons["French"].value as? String, "Not selected")
+ app.buttons["Cancel"].tap()
+ }
+}
diff --git a/mobile/ios/VoiceStudioUITests/HomeScreens.swift b/mobile/ios/VoiceStudioUITests/HomeScreens.swift
index a952fa76e..4ec8078cf 100644
--- a/mobile/ios/VoiceStudioUITests/HomeScreens.swift
+++ b/mobile/ios/VoiceStudioUITests/HomeScreens.swift
@@ -5,7 +5,11 @@ final class HomeScreens: XCTestCase {
let app = XCUIApplication(); app.launchArguments = ["--ui-smoke", "-AppleLanguages", "(en)"]
app.launch(); XCTAssertTrue(app.buttons["consent.no"].waitForExistence(timeout: 10)); app.buttons["consent.no"].tap()
XCTAssertTrue(app.navigationBars["Home"].waitForExistence(timeout: 5))
- XCTAssertTrue(app.staticTexts["VoiceStudio.sh Open Source"].exists)
+ let title = app.descendants(matching: .any)["navigation.title"].firstMatch
+ XCTAssertTrue(title.exists)
+ XCTAssertEqual(title.label, "Home")
+ XCTAssertLessThan(title.frame.midX, app.frame.width / 2)
+ XCTAssertTrue(app.staticTexts["VoiceStudio"].exists)
let attachment = XCTAttachment(screenshot: app.screenshot()); attachment.name = "Home-dark"; attachment.lifetime = .keepAlways; add(attachment)
for (route, title) in [("speak","Speak"),("voices","Voices"),("dub","Dub"),("dictate","Dictate"),("models","Models"),("connect","Connect to VoiceStudio")] {
let card = app.buttons["home."+route]
diff --git a/mobile/ios/VoiceStudioUITests/PhoneScreens.swift b/mobile/ios/VoiceStudioUITests/PhoneScreens.swift
index 0d0be604a..5719c7902 100644
--- a/mobile/ios/VoiceStudioUITests/PhoneScreens.swift
+++ b/mobile/ios/VoiceStudioUITests/PhoneScreens.swift
@@ -51,11 +51,21 @@ final class PhoneScreens: XCTestCase {
let licence = app.buttons["model.licence.kitten-mini-en-fp16"]
XCTAssertTrue(licence.waitForExistence(timeout: 5)); licence.tap()
let accept = app.buttons["models.accept"]
- for _ in 0..<15 { if accept.isHittable { break }; app.swipeUp() }
- XCTAssertTrue(accept.exists); XCTAssertFalse(accept.isEnabled)
+ XCTAssertTrue(accept.waitForExistence(timeout: 5))
+ XCTAssertTrue(accept.isHittable)
let consent = app.switches["models.consent"]
- XCTAssertTrue(consent.exists); consent.tap(); XCTAssertTrue(accept.isEnabled)
- app.buttons["Decline"].tap()
+ for _ in 0..<15 { if consent.isHittable { break }; app.swipeUp() }
+ XCTAssertTrue(accept.exists); XCTAssertFalse(accept.isEnabled)
+ XCTAssertTrue(consent.exists)
+ // A long native toggle label spans the row; activate the switch thumb.
+ consent.coordinate(withNormalizedOffset: CGVector(dx: 0.92, dy: 0.5)).tap()
+ let image = XCTAttachment(screenshot: app.screenshot()); image.name = "Licence-confirmation"; image.lifetime = .keepAlways; add(image)
+ XCTAssertTrue(accept.wait(for: \.isEnabled, toEqual: true, timeout: 3))
+ for _ in 0..<15 { if app.buttons["Close"].isHittable { break }; app.swipeDown() }
+ app.buttons["Close"].tap()
+ licence.tap()
+ XCTAssertTrue(accept.waitForExistence(timeout: 5)); XCTAssertFalse(accept.isEnabled)
+ app.buttons["Close"].tap()
}
@MainActor func testCompactDownloadsUseProductNamesAndOneDubAction() {
let app = launch()
@@ -65,10 +75,7 @@ final class PhoneScreens: XCTestCase {
app.buttons["models.get"].tap()
XCTAssertTrue(app.buttons["models.accept"].waitForExistence(timeout: 5))
XCTAssertFalse(app.buttons["models.accept"].isEnabled)
- for _ in 0..<15 { if app.buttons["Decline"].isHittable { break }; app.swipeUp() }
- app.buttons["Decline"].tap()
- app.tabButton("Voices").tap()
- XCTAssertFalse(app.buttons["whisper-tiny-int8"].exists)
+ app.buttons["Close"].tap()
app.tabButton("Dub").tap()
XCTAssertEqual(app.buttons.matching(identifier: "models.get").count, 1)
XCTAssertTrue(app.buttons["models.open"].label.contains("3 downloads"))
diff --git a/mobile/ios/VoiceStudioUITests/SmokeTests.swift b/mobile/ios/VoiceStudioUITests/SmokeTests.swift
index 4fed29c43..2a8779149 100644
--- a/mobile/ios/VoiceStudioUITests/SmokeTests.swift
+++ b/mobile/ios/VoiceStudioUITests/SmokeTests.swift
@@ -16,12 +16,35 @@ extension XCUIApplication {
if buttons["BackButton"].exists { buttons["BackButton"].tap() }
else { navigationBars.buttons.element(boundBy: 0).tap() }
}
+ for _ in 0..<8 { if buttons["home.speak"].isHittable { break }; swipeUp() }
buttons["home.speak"].tap()
}
}
final class SmokeTests: XCTestCase {
+ @MainActor func testDestructivePhoneHistoryAction() {
+ let app = XCUIApplication()
+ app.launchArguments = ["--ui-smoke", "--ui-phone-history", "-AppleLanguages", "(en)"]
+ app.launch()
+ XCTAssertTrue(app.buttons["consent.no"].waitForExistence(timeout: 10))
+ app.buttons["consent.no"].tap()
+ app.openSpeak()
+ let saved = app.staticTexts["Saved audio for deletion review"]
+ XCTAssertTrue(saved.waitForExistence(timeout: 5))
+ let delete = app.buttons["Delete"]
+ for _ in 0..<8 {
+ if delete.isHittable && delete.frame.maxY < app.buttons["speak.generate"].frame.minY { break }
+ app.swipeUp()
+ }
+ XCTAssertTrue(delete.isHittable)
+ XCTAssertGreaterThanOrEqual(delete.frame.height, 44)
+ let image = XCTAttachment(screenshot: app.screenshot())
+ image.name = "Destructive-history-action"; image.lifetime = .keepAlways; add(image)
+ delete.tap()
+ XCTAssertTrue(saved.wait(for: \.exists, toEqual: false, timeout: 5))
+ }
+
@MainActor func testUnpairedTabsAndModelDownloadPrompt() throws {
let app = XCUIApplication()
app.launchArguments = ["--ui-smoke", "-AppleLanguages", "(en)"]
@@ -34,6 +57,9 @@ final class SmokeTests: XCTestCase {
for tab in ["Voices", "Dub", "Dictate", "Settings"] {
app.tabButton(tab).tap()
XCTAssertTrue(app.navigationBars[tab].waitForExistence(timeout: 2))
+ let title = app.descendants(matching: .any)["navigation.title"].firstMatch
+ XCTAssertEqual(title.label, tab)
+ XCTAssertLessThan(title.frame.midX, app.frame.width / 2)
}
XCTAssertTrue(app.buttons["settings.connect"].exists)
}
@@ -155,9 +181,18 @@ final class SmokeTests: XCTestCase {
app.buttons["speak.generate"].tap()
let play = app.buttons["audio.play"]
XCTAssertTrue(play.waitForExistence(timeout: 10))
+ // Generation inserts the player below the editor. Reveal its controls
+ // above the pinned Generate action before attempting playback.
+ for _ in 0..<5 {
+ if play.isHittable && play.frame.maxY < app.buttons["speak.generate"].frame.minY { break }
+ app.swipeUp()
+ }
+ XCTAssertLessThan(play.frame.maxY, app.buttons["speak.generate"].frame.minY)
play.tap()
- XCTAssertEqual(play.label, "Pause")
- XCTAssertTrue(app.staticTexts["0:01"].exists)
+ XCTAssertTrue(play.wait(for: \.label, toEqual: "Pause", timeout: 3))
+ let playback = XCTAttachment(screenshot: app.screenshot())
+ playback.name = "Generated-audio-playback"; playback.lifetime = .keepAlways; add(playback)
+ XCTAssertTrue(app.staticTexts["0:05"].exists)
}
@MainActor func testKeyboardDismissalAcrossFormsAndSearch() throws {
diff --git a/scripts/export-mobile-tokens.ts b/scripts/export-mobile-tokens.ts
index bbd49cb39..f2bc0f31c 100644
--- a/scripts/export-mobile-tokens.ts
+++ b/scripts/export-mobile-tokens.ts
@@ -223,6 +223,11 @@ const tokens = {
control: rem(light.get('--control-radius')!),
},
spacing: { gap: rem(light.get('--workspace-gap')!), inset: rem(light.get('--workspace-inset')!) },
+ ios: {
+ cardRadius: rem(light.get('--ios-card-radius')!),
+ fieldRadius: rem(light.get('--ios-field-radius')!),
+ homeWordmarkSize: rem(light.get('--ios-home-wordmark-size')!),
+ },
};
// ---------- emitters ----------
@@ -250,6 +255,7 @@ function swift(): string {
s += ` public static let text${typeName(k)} = (size: ${v.size.toFixed(2)}, lineHeight: ${v.lineHeight.toFixed(2)})\n`;
for (const [k, v] of Object.entries(tokens.radius)) s += ` public static let radius${typeName(k)}: Double = ${v.toFixed(2)}\n`;
for (const [k, v] of Object.entries(tokens.spacing)) s += ` public static let spacing${typeName(k)}: Double = ${v.toFixed(2)}\n`;
+ for (const [k, v] of Object.entries(tokens.ios)) s += ` public static let ios${typeName(k)}: Double = ${v.toFixed(2)}\n`;
return s + '}\n';
}
@@ -271,6 +277,7 @@ function kotlin(): string {
}
for (const [k, v] of Object.entries(tokens.radius)) s += ` const val RADIUS_${k.toUpperCase()}: Float = ${v.toFixed(2)}f\n`;
for (const [k, v] of Object.entries(tokens.spacing)) s += ` const val SPACING_${k.toUpperCase()}: Float = ${v.toFixed(2)}f\n`;
+ for (const [k, v] of Object.entries(tokens.ios)) s += ` const val IOS_${k.replace(/[A-Z]/g, (c) => '_' + c).toUpperCase()}: Float = ${v.toFixed(2)}f\n`;
return s + '}\n';
}
diff --git a/tests/test_contact_emails.py b/tests/test_contact_emails.py
index 1387609d1..f8f8495c0 100644
--- a/tests/test_contact_emails.py
+++ b/tests/test_contact_emails.py
@@ -22,6 +22,11 @@ _RESERVED_DOMAIN = re.compile(r"(^|\.)(example\.(com|net|org)|example|test|inval
# GitHub no-reply commit addresses are identities, not contact addresses.
_NOREPLY_DOMAIN = "users.noreply.github.com"
_TEST_PATH = re.compile(r"(^|/)(tests?|__tests__|fixtures)/|\.test\.[a-z]+$|_test\.py$")
+# Vendored copyright notices retain upstream identities, not project contacts.
+_NATIVE_LICENCE_PATH = re.compile(
+ r"^mobile/(?:ios/VoiceStudio/Resources/NativeLicences/[^/]+\.txt"
+ r"|android/app/src/main/assets/licenses/native-[^/]+\.txt)$"
+)
def _tracked_text_files():
@@ -38,6 +43,8 @@ def _tracked_text_files():
def test_only_project_contact_addresses_are_published():
stray = []
for name, text in _tracked_text_files():
+ if _NATIVE_LICENCE_PATH.fullmatch(name):
+ continue
for address in _EMAIL.findall(text):
domain = address.rsplit("@", 1)[1]
if (address.lower() in _CONTACTS or _RESERVED_DOMAIN.search(domain) or domain.lower() == _NOREPLY_DOMAIN