Allow hotkey to dismiss error overlay and restart dictation#56
Conversation
When the user presses the hotkey during an error state (e.g. 'no speech detected'), the error is now dismissed and a new recording starts immediately instead of being silently ignored for 5 seconds. - beginRecording(): reset to idle if in error state before the guard - toggleRecording(): handle .error case separately to restart recording - Updated 3 tests to verify the new behavior
There was a problem hiding this comment.
The implementation correctly addresses issue #52 by allowing the hotkey to dismiss error overlays and immediately restart dictation. The changes are minimal, focused, and well-tested with comprehensive test coverage for both push-to-talk and hands-free modes. The state machine logic properly handles error dismissal before transitioning to idle and then recording, which is the correct approach.
You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.
There was a problem hiding this comment.
Pull request overview
Updates the dictation state machine so pressing the hotkey while in an error state dismisses the error and immediately starts a new recording (fix for #52), instead of ignoring the hotkey until the auto-dismiss timer fires.
Changes:
- Update
StateManagerto reset from.error→.idlebefore starting a new recording (both push-to-talk and hands-free toggle paths). - Add/adjust unit tests to validate dismissing the error state when the hotkey is pressed.
- Bump app/project versions and add new markdown docs/content.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
wispr/Services/StateManager.swift |
Handle .error in beginRecording() and toggleRecording() by resetting to idle before re-attempting recording. |
wisprTests/StateManagerTests.swift |
Replace/add tests for the new “hotkey dismisses error” behavior. |
wispr.xcodeproj/project.pbxproj |
Version bump (MARKETING_VERSION / CURRENT_PROJECT_VERSION). |
social-media-posts.md |
New marketing/social post content file. |
.kiro/refactor/issue-52-hotkey-dismiss-error.md |
New/updated internal refactor note describing the issue and fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Fixes #52 — pressing the hotkey during an error state (e.g. "no speech detected") now dismisses the error and starts a new recording immediately, instead of being silently ignored for 5 seconds.
Changes
StateManager.swift(2 lines)beginRecording(): addedif case .error = appState { await resetToIdle() }before the existing guard — clears the error so recording can proceedtoggleRecording(): split.errorout of the ignore case to callresetToIdle()thenbeginRecording()for hands-free modeStateManagerTests.swift(3 tests)testBeginRecordingDismissesError— verifies error is dismissed on hotkey (push-to-talk)testToggleRecordingDismissesError— verifies error is dismissed via toggle pathtestToggleRecordingDismissesErrorHandsFree— verifies error is dismissed (hands-free mode)All StateManager tests pass (0 failures).
What was not changed
HotkeyMonitor, RecordingOverlayView, and wisprApp overlay visibility — they already handle all state transitions correctly. The overlay dismisses automatically when state moves from
.error→.idle→.recording.Closes #52