Skip to content

Allow hotkey to dismiss error overlay and restart dictation#56

Merged
sebsto merged 4 commits intomainfrom
issue-52-hotkey-dismiss-error
Apr 17, 2026
Merged

Allow hotkey to dismiss error overlay and restart dictation#56
sebsto merged 4 commits intomainfrom
issue-52-hotkey-dismiss-error

Conversation

@sebsto
Copy link
Copy Markdown
Owner

@sebsto sebsto commented Apr 17, 2026

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(): added if case .error = appState { await resetToIdle() } before the existing guard — clears the error so recording can proceed
  • toggleRecording(): split .error out of the ignore case to call resetToIdle() then beginRecording() for hands-free mode

StateManagerTests.swift (3 tests)

  • testBeginRecordingDismissesError — verifies error is dismissed on hotkey (push-to-talk)
  • testToggleRecordingDismissesError — verifies error is dismissed via toggle path
  • testToggleRecordingDismissesErrorHandsFree — 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

sebsto added 3 commits April 17, 2026 12:56
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
Copilot AI review requested due to automatic review settings April 17, 2026 11:04
Copy link
Copy Markdown
Contributor

@amazon-q-developer amazon-q-developer Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@sebsto sebsto self-assigned this Apr 17, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 StateManager to reset from .error.idle before 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.

Comment thread wispr/Services/StateManager.swift
Comment thread wisprTests/StateManagerTests.swift
Comment thread wisprTests/StateManagerTests.swift Outdated
Comment thread wisprTests/StateManagerTests.swift
Comment thread .kiro/refactor/issue-52-hotkey-dismiss-error.md Outdated
Comment thread social-media-posts.md Outdated
Comment thread wispr.xcodeproj/project.pbxproj
@sebsto sebsto merged commit 2e048c1 into main Apr 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Start new dictation when accidentially released to early

2 participants