Skip to content

feat(ios): Cloud Voices Settings UI — completes iOS #452 - #482

Merged
github-actions[bot] merged 8 commits into
devfrom
feature/cloudtts-ios-settings-ui
Aug 24, 2026
Merged

github-actions[bot] merged 8 commits into
devfrom
feature/cloudtts-ios-settings-ui

Conversation

@libravault-pipeline-bot

Copy link
Copy Markdown
Contributor

What

PR 4 of 4 for iOS's half of Premium Cloud TTS Voices (BYOK) — completes
#452. Builds only on the already-merged foundation (#472) and vendor
adapters (#476); deliberately does not depend on the engine-wiring PR
(#478, still open/status:needs-human-merge) — the Settings UI only needs
CloudVoicePreferences/CloudApiKeyStore/CloudTtsProvider, none of which
#478 touches, so this is buildable against dev as it stands today.
Mirrors Android's Settings UI PR (#470).

Security-sensitive: human authorization already given

This issue carries the security label (BYOK key-storage risk profile).
Per the dev-agent triage gate, a security-labeled issue normally stops at
status:needs-info rather than proceeding autonomously — but a human
(libravault-xyz, MEMBER) already reviewed and explicitly authorized
proceeding on this issue, in writing, twice (2026-08-23 08:18 and 08:21
UTC comments: "Human authorization to proceed (security-sensitive gate
acknowledged)... Proceeding under this constraint" / "Human authorization
to proceed stands"). The second comment also corrected an earlier
suggestion to stub isSubscribed — this PR wires straight to the real
StoreKitBillingManager.isSubscribed, per that correction and PRD §8, no
mock/stub. Flagging this reasoning explicitly rather than silently
proceeding, per the dev-agent persona.

Changes

  • New Sources/Features/CloudTTS/CloudVoicesSection.swift:
    • CloudVoicesSection — a Section (embedded directly in SettingsView's
      Form, not a separate screen), owning its own @State backed directly
      by CloudVoicePreferences/CloudApiKeyStore — same "local state, own
      persistence, no AppState involvement" shape SettingsView's existing
      screenSecurityEnabled/loggingEnabled already use.
    • Consent toggle that does not flip on immediately — turning it on
      only shows the first-enable disclosure alert (PRD §6); the switch only
      actually commits to on if the user taps "Accept & Enable". Turning off
      is immediate, no confirmation needed. Mirrors Android's
      toggleable(value = consentEnabled, onValueChange = toggleConsent).
    • Provider picker (radio-style rows) for the five fixed presets, each
      showing "✓ Configured" once a key is saved, with "Configure/Update API
      Key" and "Remove" actions.
    • CloudVoicesKeyEntrySheet — per-provider key entry, one field per
      CloudCredentialFields.requiredFields(for:), SecureField for every
      field except .region (nothing secret about a region string).
    • CloudVoicesSection.validateAndSave(...) — validates against the real
      vendor via CloudTtsProvider.validateKey before ever calling
      CloudApiKeyStore.save (PRD §6: "validated with a single cheap test
      call, then stored") — a failed validation never reaches the key store.
      A plain static async function, not a method on the live view, so it's
      directly testable against fakes.
  • SettingsView.swift: renders CloudVoicesSection() only when
    billingManager.isSubscribed — real signal, no stub, per the correction
    above. Also updated the "Does LibraVault need an internet connection?"
    FAQ answer in HelpView, which was about to go stale (it claimed
    unconditional offline operation) — now notes the opt-in exception.

Testing

CloudVoicesSectionTests.swift — isSecureField (region vs. every other
field), isSaveEnabled (blank/whitespace-only required field, mid-flight
validation, all-filled happy path), validateAndSave (saves on successful
validation; never saves when validation fails — the single most
safety-critical assertion here, PRD §6; propagates a key-store-side
failure like a field-count mismatch), loadConfiguredProviders. New
FakeCloudTtsProvider test double (mirrors the existing
FakeCloudApiKeyStore's shape) added alongside.

This project has no ViewInspector/snapshot UI-testing infrastructure (see
EncryptedVaultContentsViewTests.swift's doc comment), so — same as that
precedent — the view itself stays thin and every piece of actual logic
(isSecureField/isSaveEnabled/validateAndSave/loadConfiguredProviders)
is pulled out as a static function tested directly, rather than only
being exercised implicitly through a body no test here can render.

Known limitation of this PR

No Xcode/macOS available in the environment this was written in — verified
by careful manual review against this codebase's established conventions
(CloudApiKeyStoreTests, EncryptedVaultContentsViewTests,
AppStateSettingsTests) rather than a local build. Real verification is
this PR's own CI run.

Part of #452.

Closes #452

Part of #452. New CloudVoicesSection (Sources/Features/CloudTTS/) wired
into SettingsView, shown only when StoreKitBillingManager.isSubscribed.
Consent toggle + first-enable disclosure alert, provider picker, per-
provider key entry sheet that validates before saving (PRD §6).
…eCloudTtsProvider

isSecureField, isSaveEnabled, validateAndSave (including the safety-critical
never-saves-on-failed-validation guard), loadConfiguredProviders. New
FakeCloudTtsProvider test double mirrors FakeCloudApiKeyStore's shape.

Part of #452.
…del.md

Per PRD §6/§4: notes iOS's own (permission-manifest-less) equivalent of the
play-flavor INTERNET-permission callout, and adds the iOS file paths to the
threat model's existing 'Cloud TTS sends reader text to a third-party
vendor' row, including the Settings-side key-validation call this PR
introduces as the current only live iOS Cloud TTS network path pending
#478 (engine wiring).

Part of #452.
@github-actions
github-actions Bot marked this pull request as ready for review August 24, 2026 02:54
Marking this PR ready via gh pr ready produced no new pull_request workflow
run for iOS App Build & Test / JVM Tests, despite both declaring
ready_for_review as a trigger type — matches this issue's own
(#452) documented pipeline webhook-delivery flakiness. Empty commit to
force a synchronize event now that the PR is non-draft, so CI actually
evaluates the real (non-skipped) build jobs.
@github-actions

Copy link
Copy Markdown
Contributor

📱 iOS Build Status: PASSED

✅ iOS Simulator Build & Unit Tests - success
⏭️ Android Core Modules - skipped

iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those.

View run details

@github-actions github-actions Bot added the risk:high Touches a sensitive path or exceeds diff-size threshold — always human merge label Aug 24, 2026
@libravault-pipeline-bot libravault-pipeline-bot Bot added the status:needs-qa PR open, awaiting qa-agent verification label Aug 24, 2026
@claude

claude Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

QA verdict for PR #482 vs issue #452

Ran: No Xcode/macOS available in this environment (same limitation the PR itself flags), so I verified via the PR's own CI run (Build & Test iOS (Simulator), run 32684767581) rather than re-executing locally. Confirmed real execution, not a skip: CloudVoicesSectionTests (12 tests) actually ran on the simulator and all passed, e.g. testValidateAndSaveNeverSavesWhenValidationFails passed in 0.003s, with the log showing per-test started/passed lines and Test Suite 'CloudVoicesSectionTests' passed, 100% line coverage on the new file. Tests exercise the real extracted static logic (validateAndSave, isSaveEnabled, isSecureField, loadConfiguredProviders) against a FakeCloudTtsProvider/FakeCloudApiKeyStore that return real success/failure rather than a relaxed mock — e.g. testValidateAndSaveNeverSavesWhenValidationFails genuinely asserts the key store was never touched after a real validation failure. No JVM/Android files are touched by this diff, so ./gradlew testDebugUnitTest is not applicable here.

Acceptance criteria (issue #452 scope)

  • ✅ Vendor adapters / shared protocol — out of scope for this PR, already merged (feat(ios): Cloud TTS vendor adapters — 5 vendors + AWS SigV4 signer #476).
  • ✅ Secure Keychain storage — already merged (feat(ios): Cloud TTS foundation — Keychain store, consent, pure gate #472), reused correctly here (KeychainCloudApiKeyStore default).
  • ✅ Settings UI: "Cloud Voices" section, provider picker, per-provider key entry, first-enable disclosure modal — present and covered by tests. Consent toggle correctly does not flip on until "Accept & Enable" is tapped; validateAndSave correctly never reaches CloudApiKeyStore.save on a failed vendor validation (PRD §6's core safety property).
  • ✅ StoreKitBillingManager.isSubscribed wired for real, no stub — confirmed in SettingsView.swift, matches the human-authorization correction on the issue thread.
  • ❌ "Wire into the existing Read Aloud / TTS engine as an additional voice source" — not actually reachable through this PR's UI.

Gap found: no Voice ID input, so Cloud TTS can never actually activate

CloudTtsEngine.performSpeak (already merged via #478, now on dev) gates cloud playback on:

let providerID = voicePreferences.loadSelectedProvider(),
let voiceID = voicePreferences.loadSelectedVoiceID(), !voiceID.isEmpty,
let credentials = apiKeyStore.load(provider: providerID),
CloudTtsGate.canUseCloudTts(...)

CloudVoicePreferences.loadSelectedVoiceID()/save(selectedVoiceID:) already exist (from #472) for exactly this purpose. But CloudVoicesSection.swift (this PR) never calls save(selectedVoiceID:) anywhere, and exposes no UI field to enter/select one — I grepped the whole diff (CloudVoicesSection.swift, CloudVoicesSectionTests.swift) for VoiceID/voiceID/VoiceId and got zero matches. Compare with Android's already-merged reference implementation this PR claims to mirror (feature/settings/.../ui/CloudVoicesSection.kt:122-129), which has an explicit free-text "Voice ID" OutlinedTextField bound to selectedVoiceId/onVoiceIdChanged, with the surrounding comment explaining exactly why it's required (real vendor voice IDs can't be hardcoded).

Net effect: a user can subscribe, accept the consent disclosure, pick a provider, and validate+save a real API key — every step this PR's tests cover passes — and still never hear cloud audio. voicePreferences.loadSelectedVoiceID() stays permanently nil, so CloudTtsEngine's guard fails every time and it silently falls back to on-device TTS, indistinguishable to the user from cloud TTS just not being wired at all. This is exactly the class of gap this repo's history warns about (Pocket TTS shipping without ever producing audio) — here it's not a mocked test hiding it, it's a UI affordance simply missing, and no test in this PR or in #478 would catch it since each tests its own layer in isolation with a directly-supplied voiceID.

The PR body and its "Closes #452" claim this completes the iOS half of the feature now that #478 has merged. It doesn't yet — the Settings UI needs a Voice ID field (and a call to preferences.save(selectedVoiceID:)) before Cloud TTS is actually usable end-to-end on iOS.

Other notes (non-blocking)

QA verdict: FAIL

@github-actions github-actions Bot removed the status:needs-qa PR open, awaiting qa-agent verification label Aug 24, 2026
@libravault-pipeline-bot libravault-pipeline-bot Bot added the status:in-progress Dev agent is actively implementing label Aug 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor
QA failed its first round — routing back to the dev agent for one automated retry.

QA on PR #482 found CloudVoicesSection never captured a Voice ID and
never called CloudVoicePreferences.save(selectedVoiceID:), so
CloudTtsEngine.performSpeak's gate (merged via #478) could never pass
and cloud playback silently fell back to on-device TTS every time.

Adds a free-text Voice ID field, shown once a provider is selected
(mirrors Android's CloudVoicesSection.kt), bound to
CloudVoicePreferences.save(selectedVoiceID:). The field clears when
switching to a different provider (extracted as the testable static
CloudVoicesSection.voiceID(afterSelecting:previousProvider:currentVoiceID:))
so a voice ID never silently carries over to the wrong vendor.

Also merges origin/dev: this branch was cut before #478 (Cloud TTS
engine wiring) merged, so TTSEngineType.cloud/CloudTtsEngine didn't
exist in this working tree yet. Updates KNOWN_LIMITATIONS.md and
docs/threat-model.md, which described #478 as not-yet-merged.
Renamed to nextVoiceID(afterSelecting:previousProvider:currentVoiceID:)
so it's unambiguously distinct from the @State voiceID property, since
this couldn't be compile-checked locally (no Xcode in this environment).
@github-actions

Copy link
Copy Markdown
Contributor

📱 iOS Build Status: FAILED

❌ iOS Simulator Build & Unit Tests - cancelled
⏭️ Android Core Modules - skipped

iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those.

View run details

@github-actions

Copy link
Copy Markdown
Contributor

📱 iOS Build Status: FAILED

❌ iOS Simulator Build & Unit Tests - failure
⏭️ Android Core Modules - skipped

iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those.

View run details

CI caught this for real: this branch was cut before #478 merged, and
#478 independently added its own FakeCloudTtsProvider test double
(CloudTtsEngineTestFakes.swift) with a different shape (a Behavior
enum, including hangUntilCancelled for its cancellation regression
test) than this PR's own FakeCloudTtsProvider.swift (a simpler
validateKeyError/synthesizeResult pair). Merging dev in put both
declarations in the same LibraVaultTests target, which Swift rejects
outright ("invalid redeclaration").

Renamed this PR's own fake (used only by CloudVoicesSectionTests) to
FakeCloudVoicesTtsProvider, distinct from #478's own fake — leaves
#478's already-merged CloudTtsEngineTests/CloudTtsEngineTestFakes.swift
untouched.
@github-actions

Copy link
Copy Markdown
Contributor

📱 iOS Build Status: PASSED

✅ iOS Simulator Build & Unit Tests - success
⏭️ Android Core Modules - skipped

iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those.

View run details

@github-actions

Copy link
Copy Markdown
Contributor

Addressed QA gap

Fixed the reachability gap QA found: CloudVoicesSection never captured a Voice ID or called CloudVoicePreferences.save(selectedVoiceID:), so CloudTtsEngine.performSpeak's gate (merged via #478) could never pass and cloud playback silently fell back to on-device TTS every time.

  • Added a free-text Voice ID field to CloudVoicesSection, shown once a provider is selected (mirrors Android's CloudVoicesSection.kt), bound to CloudVoicePreferences.save(selectedVoiceID:).
  • The field clears when switching to a different provider, extracted as the testable static CloudVoicesSection.nextVoiceID(afterSelecting:previousProvider:currentVoiceID:) — covered by 3 new tests — so a voice ID never silently carries over to the wrong vendor.
  • Merged origin/dev into this branch: it was cut before feat(ios): Cloud TTS engine wiring — makes Cloud TTS reachable #478 (Cloud TTS engine wiring) merged, so TTSEngineType.cloud/CloudTtsEngine didn't exist here yet. That merge also updates KNOWN_LIMITATIONS.md/docs/threat-model.md, which QA flagged as stale ("feat(ios): Cloud TTS engine wiring — makes Cloud TTS reachable #478 not yet merged").
  • The merge surfaced a real, CI-caught issue: this PR's own FakeCloudTtsProvider.swift test double collided with feat(ios): Cloud TTS engine wiring — makes Cloud TTS reachable #478's own, independently-added FakeCloudTtsProvider (different shape — a Behavior enum vs. a simple validateKeyError/synthesizeResult pair) now landing in the same LibraVaultTests target. Renamed this PR's fake to FakeCloudVoicesTtsProvider; left feat(ios): Cloud TTS engine wiring — makes Cloud TTS reachable #478's already-merged CloudTtsEngineTests/CloudTtsEngineTestFakes.swift untouched.

CI is green: Build & Test iOS (Simulator) and iOS UI Tests (informational) both pass on the latest commit.

@github-actions github-actions Bot removed the status:in-progress Dev agent is actively implementing label Aug 24, 2026
@libravault-pipeline-bot libravault-pipeline-bot Bot added the status:needs-qa PR open, awaiting qa-agent verification label Aug 24, 2026
@claude

claude Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

QA verification — PR #482 vs issue #452

Scope note: issue #452 is iOS's full Premium Cloud TTS Voices feature, delivered across 4 PRs (#472 foundation, #476 vendor adapters, #478 engine wiring, this PR's Settings UI). Foundation/adapters/engine-gate pieces are already merged to dev and were QA'd in their own PRs; this review focuses on what #482 actually changes, plus confirming the feature is now reachable end-to-end as a whole.

Acceptance criteria (issue #452 checklist)

  • Settings UI: new "Cloud Voices" Section in SettingsView, visible only when billingManager.isSubscribed (SettingsView.swift:36) — real StoreKitBillingManager.isSubscribed, not a stub, matching the human-authorization correction on the issue (2026-08-23 08:21 UTC comment). Provider picker, per-provider key entry, "✓ Configured"/"Remove" affordances all present.
  • Two independent gates, subscription buying ≠ consent: confirmed in code — CloudVoicesSection's consent toggle defaults off and only commits after the "Accept & Enable" disclosure alert; CloudTtsGate.canUseCloudTts ANDs both isSubscribed and consentEnabled independently (CloudTtsGate.swift).
  • Key validated before storage (PRD §6): CloudVoicesSection.validateAndSave calls ttsProvider.validateKey first and only calls keyStore.save on success — covered by testValidateAndSaveNeverSavesWhenValidationFails, which is the one PR description calls out as most safety-critical, and it does verify the right thing (asserts keyStore.load is nil after a forced validation failure).
  • Wired into TTS engine end-to-end: this is the interesting one. A prior QA round on this same PR (see commit e1238fd) correctly caught that the Settings UI never captured a Voice ID, so CloudTtsEngine.performSpeak's gate (voicePreferences.loadSelectedVoiceID(), !voiceID.isEmpty — CloudTtsEngine.swift:77) could never pass and cloud playback silently fell back to on-device every time. That's now fixed: the Voice ID TextField is present, bound to preferences.save(selectedVoiceID:), and clears on provider switch via the extracted/tested nextVoiceID(afterSelecting:previousProvider:currentVoiceID:). I independently re-traced this path (CloudVoicePreferences.swift ↔ CloudTtsEngine.swift:77 ↔ CloudVoicesSection.swift) and confirm the fix is real, not cosmetic.
  • No credential logging: no print/NSLog/Logger calls anywhere in CloudVoicesSection.swift.

Tests run

No Xcode/macOS toolchain is available in this environment (xcodebuild not found, Linux runner) — same limitation the PR description itself flags. This diff touches zero JVM/Kotlin files, so ./gradlew testDebugUnitTest is not applicable here (correctly, CI's own "Unit & Integration Tests (JVM)" / "Build Android App" jobs show skipping).

Verified instead via the PR's own CI, which is real (not skipped) for the paths this diff touches:

  • Build & Test iOS (Simulator): pass, 9m39s
  • iOS UI Tests (informational): pass, 14m34s

Test quality check

CloudVoicesSectionTests.swift's new tests exercise the extracted static functions directly (isSecureField, nextVoiceID, isSaveEnabled, validateAndSave, loadConfiguredProviders) against FakeCloudApiKeyStore/FakeCloudVoicesTtsProvider — hand-written fakes with real observable state (call counters, actual credential storage/lookup), not relaxed/loose mocks that trivially return non-nil. FakeCloudVoicesTtsProvider was renamed from an earlier FakeCloudTtsProvider after merging dev collided with #478's own same-named fake in the same test target (f2881ec) — confirmed only one FakeCloudTtsProvider/FakeCloudVoicesTtsProvider declaration now exists in LibraVaultTests/, so the "invalid redeclaration" this fixed is actually resolved.

Regressions / related-area check

  • SettingsView.swift diff is minimal and additive (CloudVoicesSection() gated behind the existing billingManager env object already present in scope); doesn't touch unrelated sections.
  • KNOWN_LIMITATIONS.md / docs/threat-model.md updates accurately reflect current code (cross-checked the "Settings-side key-validation call" claim against CloudVoicesSection.body: the provider list, and therefore the key-entry sheet, is only reachable once consentEnabled is true, matching the doc's gating claim).
  • AGENTS.md testing conventions followed: new logic ships with tests, no hardcoded versions, commit history shows real fixups (redeclaration, property collision) rather than squash-hiding a broken state.

Gaps / things I could not verify

No blocking issues found. This PR does what it says: adds the Settings UI, and fixes the specific end-to-end reachability bug a prior QA round on this same PR caught.

QA verdict: PASS

@github-actions github-actions Bot removed the status:needs-qa PR open, awaiting qa-agent verification label Aug 24, 2026
@libravault-pipeline-bot libravault-pipeline-bot Bot added the status:needs-review QA passed, awaiting principal-review-agent label Aug 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Principal review — verdict: human-merge

Risk classification

risk:high was applied at 03:15:26Z, before three more commits landed (03:21–03:34Z, including a dev merge). Re-ran .github/scripts/classify_pr_risk.py against the current head (f2881ec) to sanity-check rather than trust the label as-is:

$ python3 .github/scripts/classify_pr_risk.py 2624bf4d1192a94bcb11e6a5512494e9b2f80cd3 HEAD
risk:high
diff is 549 changed lines, over the 400-line auto-merge threshold

Confirmed still risk:high — same verdict, now for the diff-size threshold (549 > 400 lines) rather than a sensitive-path match. No sensitive_paths glob is actually touched by this PR's file list. This alone forces human-merge regardless of review findings, per agent-policy.yml.

Verification performed

  • CI: green against the actual head commit f2881ec (not a stale run) — Build & Test iOS (Simulator) and iOS UI Tests (informational) both success; Android/JVM jobs correctly skipped (diff doesn't touch those paths).
  • Security-sensitive gate / human authorization: issue Premium Cloud TTS Voices — iOS implementation (BYOK, 5 presets) #452 carries the security label. Verified the two cited authorization comments from libravault-xyz (a MEMBER) actually exist at 2026-08-23T08:18:28Z and 08:21:56Z, and that the second one's correction (wire straight to real StoreKitBillingManager.isSubscribed, no mock/stub) is what's actually implemented — SettingsView.swift:36 gates on the real billingManager.isSubscribed, and DomainBridge.swift:103 wires the same real property into CloudTtsEngine. No stub found anywhere in the diff.
  • No new sensitive path touched: confirmed against .github/agent-policy.yml's sensitive_paths list directly — none of the 6 changed files match.
  • No new unauthorized networking: the only new network-reaching call is CloudVoicesSection.validateAndSave → CloudTtsProvider.validateKey, which is the PRD-specified "validate before save" call (§6), not a new capability — the vendor adapters themselves shipped in the already-merged feat(ios): Cloud TTS vendor adapters — 5 vendors + AWS SigV4 signer #476. Reachability is structurally gated by consentEnabled (provider rows, including "Configure API Key", only render if consentEnabled) and by SettingsView only rendering the section if billingManager.isSubscribed. docs/threat-model.md's updated "Cloud TTS sends reader text to a third-party vendor" row now explicitly documents this call site instead of leaving it implicit — good catch/update.
  • Cross-checked claims against ground truth, not just the PR description: CloudApiKeyStore.save's exact-field-match require/guard (CloudApiKeyStoreError.fieldMismatch), CloudCredentialFields.requiredFields per provider, CloudVoicePreferences's UserDefaults-backed off-by-default consent read, and the EncryptedVaultContentsViewTests precedent this PR's own test-file doc comment cites — all actually exist and behave as described, not just asserted.
  • Fix-commit history double-checked: the two post-QA fixes (missing Voice ID field; FakeCloudTtsProvider redeclaration after merging dev/feat(ios): Cloud TTS engine wiring — makes Cloud TTS reachable #478) are real fixes for real problems (confirmed no duplicate FakeCloudTtsProvider/FakeCloudVoicesTtsProvider declarations remain in the tree), not just claimed-fixed.
  • Searched for a pre-existing issue before considering filing one (gh issue list --search) — none needed; see below.

Findings

None at CONFIRMED severity — nothing to file an issue for. One PLAUSIBLE-but-not-blocking observation for a human to weigh, not a request for changes:

  • CloudTtsProvider.swift's protocol doc comment states every conformer/caller "MUST check CloudTtsGate.canUseCloudTts immediately before calling either method" (synthesize or validateKey). CloudVoicesSection.validateAndSave calls validateKey without calling that gate function directly — it relies instead on the call site being structurally unreachable unless consentEnabled and billingManager.isSubscribed both hold (UI-tree gating, not the named gate helper). This PR's own docs/threat-model.md update is transparent about this ("gated by the same … chain, not a separate bypass"), and I traced the actual reachability and agree it holds today. Flagging only because the invariant is enforced by view-hierarchy structure rather than an explicit runtime check, so a future refactor that moves the "Configure API Key" button out of the if consentEnabled block would silently reopen it with nothing to catch the regression.

Why human-merge

risk:high (diff-size threshold, re-verified above), not any defect in the change itself. The implementation is solid: validated-before-saved credential flow matches PRD §6 exactly, consent/subscription gating is correctly structured and tested, docs (KNOWN_LIMITATIONS.md, docs/threat-model.md) are updated accurately rather than left stale, and the two post-QA fix commits address real bugs (dead Voice ID field, test-target redeclaration) correctly.

@github-actions github-actions Bot added status:needs-human-merge Principal review done, requires human merge decision and removed status:needs-review QA passed, awaiting principal-review-agent labels Aug 24, 2026
@github-actions
github-actions Bot merged commit 82ba777 into dev Aug 24, 2026
20 checks passed
@github-actions
github-actions Bot deleted the feature/cloudtts-ios-settings-ui branch August 24, 2026 04:52
github-actions Bot pushed a commit that referenced this pull request Aug 24, 2026
…re picker (#492)

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:high Touches a sensitive path or exceeds diff-size threshold — always human merge status:needs-human-merge Principal review done, requires human merge decision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Premium Cloud TTS Voices — iOS implementation (BYOK, 5 presets)

0 participants