Skip to content

feat: escape cancel countdown with 3-second progress bar - #5

Merged
rsslldnphy merged 2 commits into
mainfrom
005-escape-cancel-countdown
Mar 29, 2026
Merged

feat: escape cancel countdown with 3-second progress bar#5
rsslldnphy merged 2 commits into
mainfrom
005-escape-cancel-countdown

Conversation

@rsslldnphy

Copy link
Copy Markdown
Owner

Summary

  • Pressing Escape during recording now shows a "Cancelling..." HUD with a draining orange progress bar (3 seconds) instead of immediately switching to transcribing
  • Second Escape during the countdown reverses the decision → transitions to "Transcribing..." and pastes normally
  • Countdown expiry → HUD disappears silently, transcription runs in the background, result saved to log with wasPasted = false (no paste triggered)
  • Short recordings (< 0.5 s) skip the countdown and are silently discarded as before
  • Transcription failures after a cancelled recording are silently discarded with no notification

Changes

  • AppState.cancelling — new state with transitions recording→cancelling, cancelling→processing, cancelling→idle
  • IndicatorState.cancelling — new HUD state with orange label + CABasicAnimation fill bar (sublayer-based to avoid Auto Layout conflicts)
  • TranscriptionLogEntry.wasPasted: Bool — backward-compatible (absent JSON key → true)
  • TranscriptionLogStore.append(wasPasted:) — new parameter with default true
  • AppDelegatebeginCancelCountdown(), restoreFromCancelling(), commitCancelledTranscription(), silentlyResetToIdle(); cancelRecording() removed
  • LogView — "not pasted" caption annotation on cancelled entries

Test plan

  • Record dictation → press Escape → verify "Cancelling..." HUD with draining orange bar appears
  • Let countdown expire → verify HUD disappears, no text is pasted, entry appears in log with "not pasted"
  • Record dictation → press Escape → press Escape again → verify HUD switches to "Transcribing...", result is pasted, log entry has no "not pasted" annotation
  • Record < 0.5 s → press Escape → verify no countdown shown, silent discard
  • Normal hotkey flow (no Escape) → verify zero regressions
  • swift test → 131 tests, 0 failures

🤖 Generated with Claude Code

rsslldnphy and others added 2 commits March 29, 2026 09:41
Pressing Escape during recording now shows a "Cancelling..." overlay
with a draining orange progress bar instead of immediately switching to
transcribing. The user has 3 seconds to reverse the decision:

- Second Escape during countdown: cancels countdown, transitions to
  "Transcribing...", and pastes the result as normal
- Countdown expires: HUD disappears silently, transcription runs in the
  background, result saved to log with wasPasted = false (no paste)
- Short recordings (< 0.5 s): countdown skipped, silently discarded
- Transcription failures after cancel: silently discarded, no notification

Log entries now carry a wasPasted flag (backward-compatible JSON decode
defaults to true). Not-pasted entries show a "not pasted" annotation in
the log window.

New state: AppState.cancelling (recording → cancelling → processing/idle)
New indicator: IndicatorState.cancelling with CABasicAnimation fill bar

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rsslldnphy
rsslldnphy merged commit 7401798 into main Mar 29, 2026
1 check failed
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.

1 participant