Skip to content

Your phone, on your command. Gotcha is world's first fully on-device AI copilot for Android that turns natural language into real device actions — safely.

feat(settings): group AI configuration under one hub (#73)

Durganshu7ac1d01ce497
diff --git a/.maestro/flows/02-settings-toggle.yaml b/.maestro/flows/02-settings-toggle.yaml
index 3cdc879..43b96f3 100644
--- a/.maestro/flows/02-settings-toggle.yaml
+++ b/.maestro/flows/02-settings-toggle.yaml
@@ -7,5 +7,6 @@ appId: com.gotcha
- assertVisible: "Light"
- tapOn: "Dark"
- assertVisible: "Dark"
+- tapOn: "AI"
- tapOn: "AI Configuration"
- assertVisible: "Base URL (OpenAI-compatible)"
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 592506a..57d023a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,18 @@ All notable changes to Gotcha are documented here.
## [Unreleased]
### Changed
+- **Settings → AI.** The model and the voice used to sit as two unrelated rows on
+ the settings list, as if choosing what Gotcha thinks with had nothing to do with
+ choosing what it speaks with. Both now live under a single `AI` row:
+ `AI Configuration` for the provider and models, `Speech (TTS / STT)` for voices
+ and transcription. The pages themselves are unchanged, and so is everything
+ already saved on them.
+- **Advanced settings are collapsed by default.** The knobs almost nobody needs —
+ sub-agent and navigator model overrides, the agent-loop limits, the API timeout,
+ the cache-clearing buttons, the podcast host voices — are now behind an
+ `Advanced settings` disclosure on the page they belong to, instead of standing
+ between a new install and the Save button. Nothing moved pages, and expanding
+ the section is never required to save.
- **Settings → About.** The hub that collects the company page, the legal
agreements and the app updater is now titled `About` rather than `About Us`:
it holds more than company information, so the old title undersold it.
diff --git a/app/src/androidTest/java/com/gotcha/SettingsFlowTest.kt b/app/src/androidTest/java/com/gotcha/SettingsFlowTest.kt
index ffcdaf9..1796e4d 100644
--- a/app/src/androidTest/java/com/gotcha/SettingsFlowTest.kt
+++ b/app/src/androidTest/java/com/gotcha/SettingsFlowTest.kt
@@ -70,7 +70,10 @@ class SettingsFlowTest {
scenario = ActivityScenario.launch(MainActivity::class.java)
composeRule.waitForIdle()
- // First run opens on AI Configuration; Back reaches the category list.
+ // First run opens on AI Configuration, which sits inside the AI hub, so
+ // reaching the category list takes two Backs.
+ composeRule.onNodeWithTag("settings_back").performClick()
+ composeRule.waitForIdle()
composeRule.onNodeWithTag("settings_back").performClick()
composeRule.waitForIdle()
composeRule.onNodeWithTag("settings_personal_info_row").performScrollTo().performClick()
@@ -99,16 +102,42 @@ class SettingsFlowTest {
composeRule.waitForIdle()
// First run opens on AI Configuration; Back from a sub-page lands on the
- // category list rather than leaving Settings.
+ // hub it hangs off rather than leaving Settings...
composeRule.onNodeWithTag("settings_base_url").assertExists()
composeRule.onNodeWithTag("settings_back").performClick()
composeRule.waitForIdle()
composeRule.onNodeWithTag("settings_ai_config_row").assertExists()
- // Opening another category replaces the list with that page.
+ // ...and Back again from the hub lands on the category list.
+ composeRule.onNodeWithTag("settings_back").performClick()
+ composeRule.waitForIdle()
+ composeRule.onNodeWithTag("settings_ai_row").assertExists()
+ composeRule.onNodeWithTag("settings_ai_config_row").assertDoesNotExist()
+
+ // Opening a category replaces the list with that page.
+ composeRule.onNodeWithTag("settings_ai_row").performScrollTo().performClick()
+ composeRule.waitForIdle()
composeRule.onNodeWithTag("settings_speech_row").performScrollTo().performClick()
composeRule.waitForIdle()
composeRule.onNodeWithTag("settings_ai_config_row").assertDoesNotExist()
composeRule.onNodeWithText("TTS Provider").assertExists()
}
+
+ @Test
+ fun aiConfig_keepsTheAdvancedKnobsCollapsedUntilAsked() {
+ val context = ApplicationProvider.getApplicationContext<android.content.Context>()
+ TestSeed.seedUnconfigured(context)
+
+ scenario = ActivityScenario.launch(MainActivity::class.java)
+ composeRule.waitForIdle()
+
+ // First run opens on AI Configuration. The agent-loop limits are one tap
+ // away, not in the way of the fields that make the app work.
+ composeRule.onNodeWithTag("settings_model").assertExists()
+ composeRule.onNodeWithText("Max tool rounds").assertDoesNotExist()
+
+ composeRule.onNodeWithTag("settings_ai_advanced").performScrollTo().performClick()
+ composeRule.waitForIdle()
+ composeRule.onNodeWithText("Max tool rounds").performScrollTo().assertExists()
+ }
}
diff --git a/app/src/main/java/com/gotcha/MainActivity.kt b/app/src/main/java/com/gotcha/MainActivity.kt
index 595dc9b..34ab51c 100644
--- a/app/src/main/java/com/gotcha/MainActivity.kt
+++ b/app/src/main/java/com/gotcha/MainActivity.kt
@@ -96,6 +96,7 @@ private fun tourPlaceOf(route: Route, page: SettingsPage?, drawerOpen: Boolean):
route == Route.HOME -> TourPlace.CHAT
route == Route.SETTINGS -> when (page) {
null -> TourPlace.SETTINGS_HOME
+ SettingsPage.AI -> TourPlace.AI_HUB
SettingsPage.AI_CONFIG -> TourPlace.AI_CONFIG
SettingsPage.PERMISSIONS -> TourPlace.PERMISSIONS
SettingsPage.PERSONAL_INFO -> TourPlace.PERSONAL_INFO
@@ -108,6 +109,7 @@ private fun tourPlaceOf(route: Route, page: SettingsPage?, drawerOpen: Boolean):
private fun routeForTourPlace(place: TourPlace): Pair<Route, SettingsPage?> = when (place) {
TourPlace.CHAT, TourPlace.CHAT_DRAWER -> Route.HOME to null
TourPlace.SETTINGS_HOME -> Route.SETTINGS to null
+ TourPlace.AI_HUB -> Route.SETTINGS to SettingsPage.AI
TourPlace.AI_CONFIG -> Route.SETTINGS to SettingsPage.AI_CONFIG
TourPlace.PERMISSIONS -> Route.SETTINGS to SettingsPage.PERMISSIONS
TourPlace.PERSONAL_INFO -> Route.SETTINGS to SettingsPage.PERSONAL_INFO
diff --git a/app/src/main/java/com/gotcha/ui/AiConfigScreen.kt b/app/src/main/java/com/gotcha/ui/AiConfigScreen.kt
index 57b0f94..23b5207 100644
--- a/app/src/main/java/com/gotcha/ui/AiConfigScreen.kt
+++ b/app/src/main/java/com/gotcha/ui/AiConfigScreen.kt
@@ -36,6 +36,12 @@ import kotlinx.coroutines.launch
* The AI Configuration page: which LLM backend to talk to, which models to use
* for the main agent and its sub-agents, and the agent loop's limits.
*
+ * Only the three things a working install needs — provider, credentials, main
+ * model — are on the page itself. The sub-agent and navigator overrides, the loop
+ * limits and the cache-clearing buttons sit inside a collapsed
+ * [SettingsAdvancedSection]: they are worth having, but not worth scrolling past
+ * on the way to Save.
+ *
* Saves write only the fields on this page (see [SettingsScreen]'s `onSave`), so
* edits left half-finished on another page are never dragged into storage here.
*/
@@ -341,150 +347,172 @@ fun AiConfigScreen(
)
}
}
- ExposedDropdownMenuBox(
- expanded = subAgentModelExpanded,
- onExpandedChange = {
- subAgentModelExpanded = it
- if (it) refreshChatModelsAction()
- }
- ) {
- val subLabel = if (subAgentModel.isBlank()) "Same as main agent" else subAgentModel
- OutlinedTextField(
- value = subLabel,
- onValueChange = {},
- readOnly = true,
- label = { Text("Sub-agent model") },
- trailingIcon = {
- ExposedDropdownMenuDefaults.TrailingIcon(
- expanded = subAgentModelExpanded
- )
- },
- modifier = Modifier.fillMaxWidth().menuAnchor()
- )
- SkinExposedDropdownMenu(
+ // ---- Advanced: model overrides, agent-loop limits, maintenance ----
+ // Collapsed by default. The fields' state lives at the top of this
+ // composable and `applyAiConfig` reads it either way, so folding the
+ // section away never drops an edit or changes what Save writes.
+ SettingsAdvancedSection(testTag = "settings_ai_advanced") {
+ ExposedDropdownMenuBox(
expanded = subAgentModelExpanded,
- onDismissRequest = { subAgentModelExpanded = false }
+ onExpandedChange = {
+ subAgentModelExpanded = it
+ if (it) refreshChatModelsAction()
+ }
) {
- DropdownMenuItem(
- text = { Text(if (refreshingChatModels) "Refreshing…" else "🔄 Refresh models…") },
- onClick = { refreshChatModelsAction() }
- )
- DropdownMenuItem(
- text = { Text("Same as main agent") },
- onClick = {
- subAgentModel = ""
- subAgentModelExpanded = false
- }
- )
- if (availableChatModels.isNotEmpty()) {
- availableChatModels.forEach { m ->
- DropdownMenuItem(
- text = { Text(m) },
- onClick = {
- subAgentModel = m
- subAgentModelExpanded = false
- }
+ val subLabel = if (subAgentModel.isBlank()) "Same as main agent" else subAgentModel
+ OutlinedTextField(
+ value = subLabel,
+ onValueChange = {},
+ readOnly = true,
+ label = { Text("Sub-agent model") },
+ trailingIcon = {
+ ExposedDropdownMenuDefaults.TrailingIcon(
+ expanded = subAgentModelExpanded
)
+ },
+ modifier = Modifier.fillMaxWidth().menuAnchor()
+ )
+ SkinExposedDropdownMenu(
+ expanded = subAgentModelExpanded,
+ onDismissRequest = { subAgentModelExpanded = false }
+ ) {
+ DropdownMenuItem(
+ text = { Text(if (refreshingChatModels) "Refreshing…" else "🔄 Refresh models…") },
+ onClick = { refreshChatModelsAction() }
+ )
+ DropdownMenuItem(
+ text = { Text("Same as main agent") },
+ onClick = {
+ subAgentModel = ""
+ subAgentModelExpanded = false
+ }
+ )
+ if (availableChatModels.isNotEmpty()) {
+ availableChatModels.forEach { m ->
+ DropdownMenuItem(
+ text = { Text(m) },
+ onClick = {
+ subAgentModel = m
+ subAgentModelExpanded = false
+ }
+ )
+ }
}
}
}
- }
- ExposedDropdownMenuBox(
- expanded = navigatorModelExpanded,
- onExpandedChange = {
- navigatorModelExpanded = it
- if (it) refreshChatModelsAction()
- }
- ) {
- val navLabel = if (navigatorModel.isBlank()) "Same as main model" else navigatorModel
- OutlinedTextField(
- value = navLabel,
- onValueChange = {},
- readOnly = true,
- label = { Text("Navigator model") },
- trailingIcon = {
- ExposedDropdownMenuDefaults.TrailingIcon(
- expanded = navigatorModelExpanded
- )
- },
- modifier = Modifier.fillMaxWidth().menuAnchor()
- )
- SkinExposedDropdownMenu(
+ ExposedDropdownMenuBox(
expanded = navigatorModelExpanded,
- onDismissRequest = { navigatorModelExpanded = false }
+ onExpandedChange = {
+ navigatorModelExpanded = it
+ if (it) refreshChatModelsAction()
+ }
) {
- DropdownMenuItem(
- text = { Text(if (refreshingChatModels) "Refreshing…" else "🔄 Refresh models…") },
- onClick = { refreshChatModelsAction() }
- )
- DropdownMenuItem(
- text = { Text("Same as main model") },
- onClick = {
- navigatorModel = ""
- navigatorModelExpanded = false
- }
- )
- if (availableChatModels.isNotEmpty()) {
- availableChatModels.forEach { m ->
- DropdownMenuItem(
- text = { Text(m) },
- onClick = {
- navigatorModel = m
- navigatorModelExpanded = false
- }
+ val navLabel = if (navigatorModel.isBlank()) "Same as main model" else navigatorModel
+ OutlinedTextField(
+ value = navLabel,
+ onValueChange = {},
+ readOnly = true,
+ label = { Text("Navigator model") },
+ trailingIcon = {
+ ExposedDropdownMenuDefaults.TrailingIcon(
+ expanded = navigatorModelExpanded
)
+ },
+ modifier = Modifier.fillMaxWidth().menuAnchor()
+ )
+ SkinExposedDropdownMenu(
+ expanded = navigatorModelExpanded,
+ onDismissRequest = { navigatorModelExpanded = false }
+ ) {
+ DropdownMenuItem(
+ text = { Text(if (refreshingChatModels) "Refreshing…" else "🔄 Refresh models…") },
+ onClick = { refreshChatModelsAction() }
+ )
+ DropdownMenuItem(
+ text = { Text("Same as main model") },
+ onClick = {
+ navigatorModel = ""
+ navigatorModelExpanded = false
+ }
+ )
+ if (availableChatModels.isNotEmpty()) {
+ availableChatModels.forEach { m ->
+ DropdownMenuItem(
+ text = { Text(m) },
+ onClick = {
+ navigatorModel = m
+ navigatorModelExpanded = false
+ }
+ )
+ }
}
}
}
+ OutlinedTextField(
+ value = maxToolRounds,
+ onValueChange = { maxToolRounds = it },
+ label = { Text("Max tool rounds") },
+ singleLine = true,
+ keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
+ modifier = Modifier.fillMaxWidth()
+ )
+ OutlinedTextField(
+ value = maxRepeatedToolCalls,
+ onValueChange = { maxRepeatedToolCalls = it },
+ label = { Text("Max repeated tool calls") },
+ singleLine = true,
+ keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
+ modifier = Modifier.fillMaxWidth()
+ )
+ OutlinedTextField(
+ value = maxNavigationToolCalls,
+ onValueChange = { maxNavigationToolCalls = it },
+ label = { Text("Max navigation tool calls") },
+ singleLine = true,
+ keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
+ modifier = Modifier.fillMaxWidth()
+ )
+ OutlinedTextField(
+ value = maxConsecutiveDelegations,
+ onValueChange = { maxConsecutiveDelegations = it },
+ label = { Text("Max consecutive delegations") },
+ singleLine = true,
+ keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
+ modifier = Modifier.fillMaxWidth()
+ )
+ OutlinedTextField(
+ value = maxContextTokens,
+ onValueChange = { maxContextTokens = it },
+ label = { Text("Max context tokens") },
+ singleLine = true,
+ keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
+ modifier = Modifier.fillMaxWidth()
+ )
+ OutlinedTextField(
+ value = apiTimeoutSeconds,
+ onValueChange = { apiTimeoutSeconds = it },
+ label = { Text("API Timeout (seconds, 0 for infinite)") },
+ singleLine = true,
+ keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
+ modifier = Modifier.fillMaxWidth()
+ )
+ OutlinedButton(
+ onClick = {
+ onClearLlmCache()
+ overlay.show("LLM response cache cleared.")
+ status = null
+ },
+ modifier = Modifier.fillMaxWidth()
+ ) { Text("Clear LLM cache") }
+ OutlinedButton(
+ onClick = {
+ onClearDebugScreenshots()
+ overlay.show("Debug screenshots cleared.")
+ status = null
+ },
+ modifier = Modifier.fillMaxWidth()
+ ) { Text("Clear debug screenshots") }
}
- OutlinedTextField(
- value = maxToolRounds,
- onValueChange = { maxToolRounds = it },
- label = { Text("Max tool rounds") },
- singleLine = true,
- keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
- modifier = Modifier.fillMaxWidth()
- )
- OutlinedTextField(
- value = maxRepeatedToolCalls,
- onValueChange = { maxRepeatedToolCalls = it },
- label = { Text("Max repeated tool calls") },
- singleLine = true,
- keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
- modifier = Modifier.fillMaxWidth()
- )
- OutlinedTextField(
- value = maxNavigationToolCalls,
- onValueChange = { maxNavigationToolCalls = it },
- label = { Text("Max navigation tool calls") },
- singleLine = true,
- keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
- modifier = Modifier.fillMaxWidth()
- )
- OutlinedTextField(
- value = maxConsecutiveDelegations,
- onValueChange = { maxConsecutiveDelegations = it },
- label = { Text("Max consecutive delegations") },
- singleLine = true,
- keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
- modifier = Modifier.fillMaxWidth()
- )
- OutlinedTextField(
- value = maxContextTokens,
- onValueChange = { maxContextTokens = it },
- label = { Text("Max context tokens") },
- singleLine = true,
- keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
- modifier = Modifier.fillMaxWidth()
- )
- OutlinedTextField(
- value = apiTimeoutSeconds,
- onValueChange = { apiTimeoutSeconds = it },
- label = { Text("API Timeout (seconds, 0 for infinite)") },
- singleLine = true,
- keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
- modifier = Modifier.fillMaxWidth()
- )
Button(
onClick = {
onSave { applyAiConfig(it) }
@@ -524,22 +552,6 @@ fun AiConfigScreen(
},
modifier = Modifier.fillMaxWidth()
) { Text("Test connection") }
- OutlinedButton(
- onClick = {
- onClearLlmCache()
- overlay.show("LLM response cache cleared.")
- status = null
- },
- modifier = Modifier.fillMaxWidth()
- ) { Text("Clear LLM cache") }
- OutlinedButton(
- onClick = {
- onClearDebugScreenshots()
- overlay.show("Debug screenshots cleared.")
- status = null
- },
- modifier = Modifier.fillMaxWidth()
- ) { Text("Clear debug screenshots") }
status?.let {
Text(it, style = MaterialTheme.typography.bodyMedium)
}
diff --git a/app/src/main/java/com/gotcha/ui/AiHubScreen.kt b/app/src/main/java/com/gotcha/ui/AiHubScreen.kt
new file mode 100644
index 0000000..78a2d66
--- /dev/null
+++ b/app/src/main/java/com/gotcha/ui/AiHubScreen.kt
@@ -0,0 +1,55 @@
+package com.gotcha.ui
+
+import androidx.compose.material3.HorizontalDivider
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.platform.testTag
+import androidx.compose.ui.unit.dp
+import com.gotcha.ui.tour.TourAnchor
+import com.gotcha.ui.tour.tourAnchor
+
+/**
+ * AI: the hub for everything the assistant thinks, hears and speaks with — the
+ * language model on one page, speech and transcription on the other.
+ *
+ * They used to be two unrelated rows on the settings home list, which read as if
+ * choosing a voice had nothing to do with choosing a brain; both are the same
+ * decision about which provider does the work, and both are usually configured
+ * in one sitting.
+ */
+@Composable
+fun AiHubScreen(
+ onBack: () -> Unit,
+ onOpenPage: (SettingsPage) -> Unit
+) {
+ val overlay = rememberSettingsOverlayState()
+
+ SettingsScaffold(title = SettingsPage.AI.title, onBack = onBack, overlay = overlay) {
+ Text(
+ "The model does the thinking; speech gives it a voice and ears. " +
+ "One provider can cover both.",
+ style = MaterialTheme.typography.bodySmall,
+ color = MaterialTheme.colorScheme.onSurfaceVariant
+ )
+ listOf(SettingsPage.AI_CONFIG, SettingsPage.SPEECH).forEach { page ->
+ HorizontalDivider(thickness = 1.dp)
+ SettingsNavRow(
+ page = page,
+ onClick = { onOpenPage(page) },
+ modifier = Modifier
+ .testTag(page.testTag)
+ .then(
+ // The tour walks the user to the model page from here.
+ if (page == SettingsPage.AI_CONFIG) {
+ Modifier.tourAnchor(TourAnchor.SETTINGS_AI_CONFIG)
+ } else {
+ Modifier
+ }
+ )
+ )
+ }
+ HorizontalDivider(thickness = 1.dp)
+ }
+}
diff --git a/app/src/main/java/com/gotcha/ui/SettingsCommon.kt b/app/src/main/java/com/gotcha/ui/SettingsCommon.kt
index f8ec6db..705abf4 100644
--- a/app/src/main/java/com/gotcha/ui/SettingsCommon.kt
+++ b/app/src/main/java/com/gotcha/ui/SettingsCommon.kt
@@ -39,6 +39,7 @@ import androidx.compose.runtime.Stable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
+import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
@@ -82,8 +83,9 @@ import kotlin.math.round
*
* Most pages hang directly off the home list. The exceptions declare a [parent]:
* they are full pages, routed and titled like any other, but reached from inside
- * that parent instead of from the home list. [ABOUT] is the only such hub today,
- * collecting "who made this app and what did I agree to" into one row.
+ * that parent instead of from the home list. Two hubs exist: [AI], which collects
+ * everything the assistant thinks, hears and speaks with, and [ABOUT], which
+ * collects "who made this app and what did I agree to".
*/
enum class SettingsPage(
val title: String,
@@ -102,15 +104,22 @@ enum class SettingsPage(
"Who you are, language, currency, reply style",
"settings_personal_info_row"
),
+ AI(
+ "AI",
+ "Model, provider, voice and transcription",
+ "settings_ai_row"
+ ),
AI_CONFIG(
"AI Configuration",
"Provider, models, agent limits",
- "settings_ai_config_row"
+ "settings_ai_config_row",
+ { AI }
),
SPEECH(
"Speech (TTS / STT)",
"Voices, transcription, read replies aloud",
- "settings_speech_row"
+ "settings_speech_row",
+ { AI }
),
PERMISSIONS(
"Permissions",
@@ -732,6 +741,57 @@ fun SamosaAuthSection(
}
}
+/**
+ * A collapsed-by-default disclosure for the knobs a page has but most people
+ * never touch — model overrides, loop limits, timeouts. Keeps them one tap away
+ * without letting them crowd out the two or three controls that actually decide
+ * whether the app works.
+ *
+ * Uses the same text triangle as the permission groups rather than an icon font,
+ * so the settings pages keep one disclosure idiom.
+ *
+ * [testTag] tags the header row, which is the part a test clicks to expand.
+ * Expansion is remembered per page visit (`rememberSaveable`), so a rotation or
+ * a trip to Android Settings doesn't fold the section back up mid-edit. The
+ * fields inside stay hoisted in the calling screen, so collapsing the section
+ * never discards what was typed into it.
+ */
+@Composable
+fun SettingsAdvancedSection(
+ testTag: String,
+ title: String = "Advanced settings",
+ content: @Composable ColumnScope.() -> Unit
+) {
+ var expanded by rememberSaveable { mutableStateOf(false) }
+
+ Row(
+ modifier = Modifier
+ .fillMaxWidth()
+ .clickable { expanded = !expanded }
+ .padding(vertical = 8.dp)
+ .testTag(testTag),
+ verticalAlignment = Alignment.CenterVertically
+ ) {
+ Text(
+ text = if (expanded) "▼ " else "▶ ",
+ style = MaterialTheme.typography.bodyLarge,
+ color = MaterialTheme.colorScheme.onSurfaceVariant
+ )
+ Text(
+ text = title,
+ style = MaterialTheme.typography.bodyLarge,
+ fontWeight = FontWeight.Medium
+ )
+ }
+ AnimatedVisibility(visible = expanded) {
+ Column(
+ modifier = Modifier.fillMaxWidth(),
+ verticalArrangement = Arrangement.spacedBy(12.dp),
+ content = content
+ )
+ }
+}
+
/**
* A label with a trailing switch — the settings screens' standard boolean row.
*
diff --git a/app/src/main/java/com/gotcha/ui/SettingsScreen.kt b/app/src/main/java/com/gotcha/ui/SettingsScreen.kt
index 3e5c54c..e5e8e2a 100644
--- a/app/src/main/java/com/gotcha/ui/SettingsScreen.kt
+++ b/app/src/main/java/com/gotcha/ui/SettingsScreen.kt
@@ -125,6 +125,10 @@ fun SettingsScreen(
onBack = backToHome,
onTestVoice = onTestVoice
)
+ SettingsPage.AI -> AiHubScreen(
+ onBack = backToHome,
+ onOpenPage = onPageChange
+ )
SettingsPage.AI_CONFIG -> AiConfigScreen(
load = load,
onSave = onSave,
@@ -240,7 +244,7 @@ private fun SettingsHome(
@Composable
private fun SettingsPage.tourAnchorModifier(): Modifier = when (this) {
SettingsPage.PERSONAL_INFO -> Modifier.tourAnchor(TourAnchor.SETTINGS_PERSONAL_INFO)
- SettingsPage.AI_CONFIG -> Modifier.tourAnchor(TourAnchor.SETTINGS_AI_CONFIG)
+ SettingsPage.AI -> Modifier.tourAnchor(TourAnchor.SETTINGS_AI)
SettingsPage.PERMISSIONS -> Modifier.tourAnchor(TourAnchor.SETTINGS_PERMISSIONS)
else -> Modifier
}
diff --git a/app/src/main/java/com/gotcha/ui/SpeechScreen.kt b/app/src/main/java/com/gotcha/ui/SpeechScreen.kt
index e8b44d4..ee62ba8 100644
--- a/app/src/main/java/com/gotcha/ui/SpeechScreen.kt
+++ b/app/src/main/java/com/gotcha/ui/SpeechScreen.kt
@@ -359,40 +359,45 @@ fun SpeechScreen(
AudioProvider.ANDROID, AudioProvider.NONE -> Unit
}
// ---- Podcast hosts (synthesize_podcast_dialogue) ----
+ // Advanced: only two-host podcast generation reads these, and the
+ // defaults (the TTS voice for host A, an automatically chosen second
+ // voice for host B) already work.
if (ttsProvider.isApiBased()) {
- Text(
- "Podcast hosts — the two voices used when the assistant generates a two-host " +
- "podcast dialogue. Leave blank to use the TTS voice for host A and an " +
- "automatically chosen different voice for host B.",
- style = MaterialTheme.typography.bodySmall,
- color = MaterialTheme.colorScheme.onSurfaceVariant
- )
- TtsVoicePicker(
- selectedModel = ttsApiModel,
- selectedVoice = podcastHostAVoice,
- availableModels = availableTtsModels,
- expanded = hostAVoiceExpanded,
- onExpandedChange = { hostAVoiceExpanded = it },
- onSelect = {
- podcastHostAVoice = it
- hostAVoiceExpanded = false
- },
- onClearVoice = { podcastHostAVoice = "" },
- label = "Podcast Host A Voice (optional)"
- )
- TtsVoicePicker(
- selectedModel = ttsApiModel,
- selectedVoice = podcastHostBVoice,
- availableModels = availableTtsModels,
- expanded = hostBVoiceExpanded,
- onExpandedChange = { hostBVoiceExpanded = it },
- onSelect = {
- podcastHostBVoice = it
- hostBVoiceExpanded = false
- },
- onClearVoice = { podcastHostBVoice = "" },
- label = "Podcast Host B Voice (optional)"
- )
+ SettingsAdvancedSection(testTag = "settings_speech_advanced") {
+ Text(
+ "Podcast hosts — the two voices used when the assistant generates a two-host " +
+ "podcast dialogue. Leave blank to use the TTS voice for host A and an " +
+ "automatically chosen different voice for host B.",
+ style = MaterialTheme.typography.bodySmall,
+ color = MaterialTheme.colorScheme.onSurfaceVariant
+ )
+ TtsVoicePicker(
+ selectedModel = ttsApiModel,
+ selectedVoice = podcastHostAVoice,
+ availableModels = availableTtsModels,
+ expanded = hostAVoiceExpanded,
+ onExpandedChange = { hostAVoiceExpanded = it },
+ onSelect = {
+ podcastHostAVoice = it
+ hostAVoiceExpanded = false
+ },
+ onClearVoice = { podcastHostAVoice = "" },
+ label = "Podcast Host A Voice (optional)"
+ )
+ TtsVoicePicker(
+ selectedModel = ttsApiModel,
+ selectedVoice = podcastHostBVoice,
+ availableModels = availableTtsModels,
+ expanded = hostBVoiceExpanded,
+ onExpandedChange = { hostBVoiceExpanded = it },
+ onSelect = {
+ podcastHostBVoice = it
+ hostBVoiceExpanded = false
+ },
+ onClearVoice = { podcastHostBVoice = "" },
+ label = "Podcast Host B Voice (optional)"
+ )
+ }
}
ExposedDropdownMenuBox(
expanded = sttProviderExpanded,
diff --git a/app/src/main/java/com/gotcha/ui/tour/TourAnchors.kt b/app/src/main/java/com/gotcha/ui/tour/TourAnchors.kt
index fd5109b..0b77807 100644
--- a/app/src/main/java/com/gotcha/ui/tour/TourAnchors.kt
+++ b/app/src/main/java/com/gotcha/ui/tour/TourAnchors.kt
@@ -25,6 +25,11 @@ import androidx.compose.ui.layout.onGloballyPositioned
enum class TourAnchor {
DRAWER_SETTINGS,
SETTINGS_PERSONAL_INFO,
+
+ /** The AI hub's row on the settings home list. */
+ SETTINGS_AI,
+
+ /** The AI Configuration row, which lives inside the AI hub. */
SETTINGS_AI_CONFIG,
SETTINGS_PERMISSIONS,
AI_PROVIDER,
diff --git a/app/src/main/java/com/gotcha/ui/tour/TourStep.kt b/app/src/main/java/com/gotcha/ui/tour/TourStep.kt
index 014523e..6bdf836 100644
--- a/app/src/main/java/com/gotcha/ui/tour/TourStep.kt
+++ b/app/src/main/java/com/gotcha/ui/tour/TourStep.kt
@@ -20,6 +20,9 @@ enum class TourPlace {
/** The settings category list. */
SETTINGS_HOME,
+
+ /** The AI hub: the model page and the speech page, one level under Settings. */
+ AI_HUB,
AI_CONFIG,
PERMISSIONS,
PERSONAL_INFO
@@ -96,13 +99,21 @@ private fun brainSteps(): List<TourStep> = listOf(
hint = "Tip: the same swipe works from anywhere in the chat."
),
TourStep(
- id = "open_ai_config",
+ id = "open_ai",
place = TourPlace.SETTINGS_HOME,
autoNavigate = false,
+ anchor = TourAnchor.SETTINGS_AI,
+ title = "Start with AI",
+ body = "Everything Gotcha thinks, hears and says with is behind this row. Open it."
+ ),
+ TourStep(
+ id = "open_ai_config",
+ place = TourPlace.AI_HUB,
+ autoNavigate = false,
anchor = TourAnchor.SETTINGS_AI_CONFIG,
title = "Give Gotcha a brain",
body = "AI Configuration is where the model lives. Open it — you'll come back here to " +
- "change models later."
+ "change models later, and to pick a voice."
),
TourStep(
id = "choose_provider",