Repository navigation
fix(ios): wire Cloud Voices activation toggle, exclude .cloud from bare picker - #492
Conversation
…re picker Fixes #491, found while reviewing the current state of dev: PR #482 (a parallel, independently-authorized dev-agent run on issue #452 that merged while this session's own from-scratch Settings UI PR for the same scope was still in progress — genuine duplicate work, discarded in favor of this small targeted fix instead of a competing rewrite) implemented provider/key/voice-id configuration but never wired activation: `CloudVoicesSection.swift` never referenced `ttsEngineType` anywhere, and `ttsSection`'s segmented Picker listed `TTSEngineType .allCases` unfiltered, making ".cloud" directly selectable there with nothing configured — CloudTtsEngine's own gate would just silently fall back to on-device every time, a confusing dead end disconnected from the Cloud Voices section below it. - `ttsSection`'s Picker now filters out `.cloud` — mirrors Android's `TtsSettingsSection` never listing CLOUD as a bare radio option. Footer copy fixed too (still claimed "no network access"). - New "Use Cloud Voices for Read Aloud" toggle inside `CloudVoicesSection`, shown once a provider is merely *selected* — not gated on already being configured, which is exactly the gating bug Android's own PR #470 hit and fixed (hiding it until configured leaves no discovery path at all). Disabled + explained until the selected provider actually has credentials saved and a non-blank voice id is set. Re-checks `CloudTtsGate.canUseCloudTts` before actually activating, not just relying on the toggle's own `.disabled` affordance. Disabling always reverts to `.system`, gate irrelevant. - Extracted the enable/disable decision as a pure `static func canActivateCloudEngine`, matching this file's own established `isSaveEnabled`/`nextVoiceID` precedent for testability without ViewInspector/snapshot infrastructure (which this repo doesn't have). - `#Preview` needed the two new `@EnvironmentObject`s added. Testing: 6 new `CloudVoicesSectionTests` cases covering `canActivateCloudEngine`'s every branch (no provider selected, wrong provider configured, empty/whitespace voice id, the happy path). The gate re-check itself already has full coverage via `CloudTtsGateTests` (#472) — nothing new to test there. No Xcode/macOS available in this environment — verified by careful manual review against the actual merged file content on dev (`git show origin/dev:...`, not a stale local assumption) and this file's own established static-helper testing convention. Real verification is this PR's own CI run. Closes #491. Part of #452.
|
This PR was opened outside the automated pipeline (author isn't |
📱 iOS Build Status: PASSED✅ iOS Simulator Build & Unit Tests - success iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those. |
QA verification — PR #492 vs issue #491Acceptance criteria (from issue #491's "Suggested fix")
What I ran No Xcode available on this (Linux) QA runner, same limitation the PR itself notes — so I read the diff/logic directly and then watched the PR's own real CI signal (
Test quality (AGENTS.md "prove a new test can fail" / this repo's mock-past-the-bug history)
Regressions / related areas Grepped the full iOS tree for other AGENTS.md conventions Branch name Note for principal review (not a QA blocker): issue #491 carries the VerdictAll 5 acceptance-criterion items pass, the real CI build+test (including the new tests, individually confirmed) succeeded, the new tests exercise real new logic rather than a relaxed mock, and no regressions were found in related areas. QA verdict: PASS |
Principal review — verdict:
|
What
Fixes #491, found while checking the current state of
devbefore opening this session's own (now-redundant, discarded) Settings UI PR: PR #482 — a parallel, independently-authorizeddev-agentrun on issue #452 (see that issue's own authorization comments) that merged while this session's own from-scratch Settings UI PR for the identical scope was still in progress — implemented provider/key/voice-id configuration but never wired activation.Confirmed directly against the real merged content (
git show origin/dev:..., not a stale assumption):CloudVoicesSection.swiftnever referencedttsEngineType/.cloudanywhere (zero matches).SettingsView.ttsSection's segmentedPickerlistedTTSEngineType.allCasesunfiltered, so "Cloud Voices" was directly selectable there with nothing configured. Not silently inert the way Android's own first Settings UI pass was (feat(android): Cloud Voices Settings UI — completes Android #451 #470's own critical finding) — selecting it does callswitchTTSEngine(to: .cloud)— butCloudTtsEngine's gate then falls back to on-device on every real call, since nothing's configured. Confusing dead end, disconnected from the Cloud Voices section below it.Changes
ttsSection'sPickernow filters out.cloud— mirrors Android'sTtsSettingsSectionnever listingCLOUDas a bare radio option. Footer copy fixed too (still claimed "no network access").CloudVoicesSection, shown once a provider is merely selected — not gated on already being configured, which is exactly the gating bug Android's own PR feat(android): Cloud Voices Settings UI — completes Android #451 #470 hit and fixed (hiding it until configured leaves no discovery path at all). Disabled + explained until the selected provider actually has credentials saved and a non-blank voice id is set. Re-checksCloudTtsGate.canUseCloudTtsbefore actually activating, not just relying on the toggle's own.disabledaffordance. Disabling always reverts to.system, gate irrelevant.static func canActivateCloudEngine, matching this file's own establishedisSaveEnabled/nextVoiceIDprecedent for testability (this repo has no ViewInspector/snapshot UI-testing infrastructure).#Previewneeded the two new@EnvironmentObjects the section now reads.Testing
6 new
CloudVoicesSectionTestscases coveringcanActivateCloudEngine's every branch (no provider selected, wrong provider configured, empty/whitespace voice id, the happy path). The gate re-check itself already has full coverage viaCloudTtsGateTests(#472) — nothing new to test there.Known limitation
No Xcode/macOS available in this environment — verified by careful manual review against the actual merged file content on
devand this file's own established static-helper testing convention. Real verification is this PR's own CI run.Closes #491. Part of #452.