Fix dead record button after mic permission denial

The watch app's permission-denied state was a computed property reading
AVAudioApplication.shared.recordPermission — external state Observation
cannot track — so after a denied prompt the UI never flipped to the
'Microphone access is off' screen and the record button silently did
nothing. Store the denied flag as a tracked property instead, updated
on every permission request.

Also: log (instead of swallow) recorder start failures, drop phantom
recordings when no file was written (the watch simulator has no audio
input device), sweep orphaned metadata sidecars on reconcile, and add a
DEBUG-only 'autorecord' launch argument for CLI-driven testing.

Claude-Session: https://claude.ai/code/session_01GKfAiKiQKLDTmbiGva4FGE
This commit is contained in:
2026-07-15 14:58:57 -04:00
parent 86d74806c9
commit 3a9c36d843
4 changed files with 47 additions and 8 deletions
+9 -1
View File
@@ -11,7 +11,15 @@ struct NotesWatchApp: App {
RecordView()
}
.environment(services)
.task { services.bootstrap() }
.task {
services.bootstrap()
#if DEBUG
// CLI-driven repro of the record button (simctl launch autorecord).
if ProcessInfo.processInfo.arguments.contains("autorecord") {
await services.startRecording()
}
#endif
}
.onOpenURL { url in services.handleDeepLink(url) }
}
.onChange(of: scenePhase) { _, phase in