Skip to content

feat(vscode): bind speech-to-text to Cmd/Ctrl+K with hold-to-send - #12798

Merged
marius-kilocode merged 3 commits into
mainfrom
bind-microphone-shortcut-cmd-k
Aug 3, 2026
Merged

feat(vscode): bind speech-to-text to Cmd/Ctrl+K with hold-to-send#12798
marius-kilocode merged 3 commits into
mainfrom
bind-microphone-shortcut-cmd-k

Conversation

@marius-kilocode

@marius-kilocode marius-kilocode commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Voice input in Kilo prompts was previously available only through the microphone button. This adds focused Cmd+K on macOS and Ctrl+K on Windows/Linux across chat prompts, Agent Manager worktree prompts, and review comment fields.

Quick press starts or stops recording. Holding the shortcut while speaking and releasing it stops transcription and submits the focused field. Key-repeat, macOS modifier-release, focus loss, and annotation cleanup are handled so the gesture cannot leave recording active or leak listeners.

The microphone tooltip explains both interactions, and the shortcut text is translated for every supported app locale. The existing editor-only Cmd/Ctrl+K Cmd/Ctrl+A binding remains unaffected.

Speech-to-text shortcut tooltip in Kilo

@marius-kilocode
marius-kilocode enabled auto-merge (squash) August 3, 2026 09:56
Comment thread packages/kilo-vscode/webview-ui/src/components/speech-to-text/shortcut.ts Outdated
Comment thread packages/kilo-vscode/webview-ui/src/components/speech-to-text/shortcut.ts Outdated
@kilo-code-bot

kilo-code-bot Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files, incremental since 3689992)
  • packages/kilo-vscode/webview-ui/src/components/speech-to-text/shortcut.ts - blur listener moved off the capture phase, so element-level blur inside the webview no longer aborts a held gesture; add/remove options now match
  • packages/kilo-vscode/webview-ui/src/components/speech-to-text/SpeechToTextButton.tsx - single Tooltip wrapper with the keybind markup swapped inside value, so the button no longer remounts on idle <-> active transitions and loses focus; title() (label + shortcut hint) is now used only in the idle branch, so error/transcribing tooltips show just their state label
  • packages/kilo-vscode/webview-ui/diff-viewer/review-annotation-speech.tsx - createRoot result is now named dispose; annotation dispose() still calls shortcut.reset(), so window-level keyup/blur/visibilitychange listeners are released

All findings from the previous review round are resolved in these commits. Inline keybind markup matches TooltipKeybind / ThinkingSelector data-slot usage, so tooltip styling is unaffected.

Previous Review Summaries (2 snapshots, latest commit 3689992)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 3689992)

Status: 3 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 2
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
packages/kilo-vscode/webview-ui/src/components/speech-to-text/shortcut.ts 86 Capture-phase blur on window also receives element-level blur from descendants, so any focus change inside the webview during a hold aborts the gesture and stops recording
packages/kilo-vscode/webview-ui/src/components/speech-to-text/SpeechToTextButton.tsx 70 The Show swap between TooltipKeybind and Tooltip remounts the button on every idle ↔ active transition: focus is lost after keyboard activation and the tooltip flickers

SUGGESTION

File Line Issue
packages/kilo-vscode/webview-ui/diff-viewer/review-annotation-speech.tsx 87 createRoot((owner) => …) param is the dispose function and shadows the owner signal; dispose reads correctly
Files Reviewed (24 files, incremental since dbf7823)
  • packages/kilo-vscode/webview-ui/src/components/speech-to-text/shortcut.ts - 1 issue (focus-loss release added; release/ended shadowing resolved)
  • packages/kilo-vscode/webview-ui/src/components/speech-to-text/SpeechToTextButton.tsx - 1 issue (shortcut hint no longer appended to error/transcribing tooltips — previous finding resolved)
  • packages/kilo-vscode/webview-ui/diff-viewer/review-annotation-speech.tsx - 1 issue (dispose() now calls shortcut.reset(), so the previously reported keyup listener leak is resolved)
  • image.png - removed from the repo root, previous finding resolved
  • 20 locale files under packages/kilo-vscode/webview-ui/src/i18n/ - speechToText.tooltip.shortcut added to every non-en dictionary, key placement and nesting consistent

Notes: useSpeechToText.stop() is guarded on starting/recording, so the new finish(false) call from focus loss is a no-op in transcribing/error states. The shortcut unit tests run without a DOM (typeof window === "undefined"), so the new blur/visibilitychange paths are not exercised by use-speech-to-text.test.ts.

Fix these issues in Kilo Cloud

Previous review (commit dbf7823)

Status: 5 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 2
SUGGESTION 3
Issue Details (click to expand)

WARNING

File Line Issue
packages/kilo-vscode/webview-ui/diff-viewer/review-annotation-speech.tsx 115 node.dispose() never calls shortcut.reset(), so a node disposed mid-gesture leaks the window-level keyup capture listener and its closure
image.png - 47KB binary committed at the repo root, unreferenced by the docs or any code — looks like an accidental git add. Binary files cannot take inline comments, so it is reported here

SUGGESTION

File Line Issue
packages/kilo-vscode/webview-ui/src/components/speech-to-text/shortcut.ts 70 Losing webview focus mid-hold (e.g. Cmd+Tab) never delivers keyup, leaving the mic recording indefinitely; consider a blur/visibilitychange release
packages/kilo-vscode/webview-ui/src/components/speech-to-text/shortcut.ts 80 const release boolean shadows the release keyup handler used by disarm()
packages/kilo-vscode/webview-ui/src/components/speech-to-text/SpeechToTextButton.tsx 26 Shortcut hint is appended to every tooltip state, including error text and "Transcribing... Click to cancel."
Files Reviewed (12 files)
  • .changeset/quiet-speech-shortcut.md - user-facing description reads well
  • image.png - 1 issue
  • packages/kilo-docs/pages/code-with-ai/features/speech-to-text.md - matches implemented behavior
  • packages/kilo-vscode/tests/unit/use-speech-to-text.test.ts - exercises the real hook and state machine, no mock-heavy paths
  • packages/kilo-vscode/webview-ui/agent-manager/NewWorktreeDialog.tsx
  • packages/kilo-vscode/webview-ui/diff-viewer/review-annotation-speech.tsx - 1 issue
  • packages/kilo-vscode/webview-ui/diff-viewer/review-annotations.ts
  • packages/kilo-vscode/webview-ui/src/components/chat/PromptInput.tsx
  • packages/kilo-vscode/webview-ui/src/components/speech-to-text/SpeechToTextButton.tsx - 1 issue
  • packages/kilo-vscode/webview-ui/src/components/speech-to-text/shortcut.ts - 2 issues
  • packages/kilo-vscode/webview-ui/src/components/speech-to-text/useSpeechToText.ts - pending stop-during-startup queue is cleared on every cleanup()/cancel()/fail() path
  • packages/kilo-vscode/webview-ui/src/i18n/en.ts - other locales fall back to en through the base merge in context/language.tsx, so an English-only key is fine

Notes: ctrl+k ctrl+a in package.json is gated on editorTextFocus, so the new webview binding does not break that chord. PromptInput's finish path reuses transcribeAndSend's ready staleness guard; NewWorktreeDialog submits without one, which is acceptable because the dialog closes on submit.

Fix these issues in Kilo Cloud


Reviewed by claude-opus-5 · Input: 40 · Output: 9.1K · Cached: 1M

Review guidance: REVIEW.md from base branch main

Comment thread packages/kilo-vscode/webview-ui/src/components/speech-to-text/shortcut.ts Outdated
Comment thread packages/kilo-vscode/webview-ui/diff-viewer/review-annotation-speech.tsx Outdated
@marius-kilocode
marius-kilocode merged commit dfc1607 into main Aug 3, 2026
26 checks passed
@marius-kilocode
marius-kilocode deleted the bind-microphone-shortcut-cmd-k branch August 3, 2026 14:35
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
…lo-Org#12798)

* feat(vscode): bind speech-to-text to Cmd/Ctrl+K with hold-to-send

* fix(vscode): complete speech shortcut localization and cleanup

* fix(vscode): preserve speech shortcut focus and tooltip state
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.

2 participants