Voice-to-text: wire existing mic button to SFSpeechRecognizer #23
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Completed ✅
Delivered 2026-06-24
Problem
The mic icon in AddTaskSheet (Quick Add) was a bare
Image(systemName: "mic")— no Button wrapper, no action, no speech infrastructure.Implementation
New file:
KisaniCal/Managers/SpeechRecognizer.swift@MainActor ObservableObjectwrappingSFSpeechRecognizer+AVAudioEngine@Published transcriptreset()cleans up on sheet dismiss[VOICE]log trail: tapped → granted → started → transcript → savedTodayView.swift— AddTaskSheet@StateObject private var speech = SpeechRecognizer()onChange(speech.transcript)writes torawText(task field)Image→Button { speech.toggle() }withmic.fill+ pulse animation.safeAreaInsetred error banner on permission denialsubmit()stops recording before saving.onDisappear { speech.reset() }project.ymlNSMicrophoneUsageDescriptionNSSpeechRecognitionUsageDescriptionVerified
i am okay with this function in test