Skip to content

feat: add Toggle Dictation App Intent for Siri and Shortcuts - #162

Closed
claude[bot] wants to merge 2 commits into
mainfrom
feat/toggle-dictation-app-intent
Closed

feat: add Toggle Dictation App Intent for Siri and Shortcuts#162
claude[bot] wants to merge 2 commits into
mainfrom
feat/toggle-dictation-app-intent

Conversation

@claude

@claude claude Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Requested by Alex Kroman · Slack thread

What & why

Before: a dictation can only be started or stopped with the hotkey.
After: a "Toggle Dictation" action appears in the Shortcuts app, and Siri can trigger it by voice — e.g. "Hey Siri" from AirPods — so a dictation can be started and stopped hands-free.

How: ToggleDictationIntent (an AppIntent) calls a new AppCoordinator.toggleDictation(), which submits .release when capturing and .press otherwise through the same fire-and-forget DictationSession.submit(_:) command feed the key tap drives, so commands stay in emit order. openAppWhenRun stays false so Siri runs it without foregrounding Blurt (which would steal focus from the app being dictated into). A BlurtAppShortcuts provider registers built-in phrases so it works with no setup. No URL scheme, no Info.plist or entitlement changes — App Intents need none. Known benign desync, noted in the doc comment: a programmatic start leaves the key-tap gate idle, so the next physical tap follows the gate's own latch logic; the gate is already re-synced on every terminal phase.

Placement note: the intent types live at the bottom of AppDelegate.swift (beside the NSApp.delegate they reach through) rather than a new Intents/ file, because this change was authored in a Linux sandbox where xcodegen can't run — a new source file would leave the committed project.pbxproj behind and fail the drift check. If you'd rather have Intents/ToggleDictationIntent.swift, it's a file move plus xcodegen generate on a Mac.

How to use with Siri

  • Out of the box: "Toggle Blurt dictation" / "Start Blurt dictation" / "Stop Blurt dictation" — Apple requires the app name in built-in phrases.
  • Custom phrase: wrap the Toggle Dictation action in a Shortcut named anything (e.g. "start blurting") and say that to Siri.

How it was tested

Authored on Linux, so no local build/test — CI on macOS is the authority here. scripts/check.sh --portable passes (repo-integrity guards, settled-decision invariants, portability, linters, evals). Not validated locally: the macOS build, actually invoking the intent from Siri/Shortcuts, and periphery's view of the reflectively-discovered intent types (both carry periphery:ignore, matching the repo's practice for reflection-only symbols). The shell has no unit-test target and the engine coverage gate doesn't reach app-target code, so no new tests per repo convention.

  • scripts/check.sh passes (or CI will, if I'm not on a Mac)
  • I read AGENTS.md and this doesn't reintroduce anything deliberately removed
  • Docs updated if behavior changed

🤖 Generated with Claude Code

https://claude.ai/code/session_01Wd3oRQC3j1M4BC7vbT49NV


Generated by Claude Code

claude added 2 commits August 25, 2026 22:46
Expose the hotkey's tap-to-toggle behaviour as an App Intent so a
dictation can be started or stopped by voice (Siri, e.g. from AirPods)
or from the Shortcuts app. The intent runs without foregrounding Blurt
and drives the same DictationSession command feed as the key tap.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wd3oRQC3j1M4BC7vbT49NV
…ned_doc_comment

SwiftLint's orphaned_doc_comment rule fires when a doc comment is separated
from its declaration by a plain comment, which is exactly where the two
periphery:ignore commands sat. Above the doc block they stay in the
declaration's leading trivia, so periphery still honors them.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wd3oRQC3j1M4BC7vbT49NV
@claude claude Bot closed this Aug 25, 2026
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