Skip to content

feat(site): add voice-to-text input to agent chat#23022

Merged
kylecarbs merged 3 commits intomainfrom
feat/voice-input-chat
Mar 13, 2026
Merged

feat(site): add voice-to-text input to agent chat#23022
kylecarbs merged 3 commits intomainfrom
feat/voice-input-chat

Conversation

@kylecarbs
Copy link
Copy Markdown
Member

Summary

Adds a microphone button to the agent chat input for browser-native voice-to-text transcription using the Web Speech API.

Changes

New: site/src/hooks/useSpeechRecognition.ts

  • Custom React hook wrapping the Web Speech API (SpeechRecognition / webkitSpeechRecognition)
  • Feature-detects browser support via isSupported
  • Provides start(), stop(), and cancel() controls
  • Accumulates real-time transcript from interim and final recognition results
  • Inline TypeScript declarations for the Web Speech API types

Modified: site/src/pages/AgentsPage/AgentChatInput.tsx

  • Mic button: Appears to the right of the image attach button when the browser supports the Speech Recognition API. Shows a microphone icon when idle, X icon when recording.
  • Send button: Transforms into a checkmark during recording to accept the transcription. Always enabled during recording.
  • Editor sync: Live-updates the Lexical editor with the transcription as the user speaks. Preserves any pre-existing text.
  • Cancel: Restores the editor to its pre-recording content.

How it works

  1. User clicks the mic button → recording starts, real-time transcript appears in the editor
  2. User clicks the checkmark (send button) → recording stops, transcribed text stays
  3. User clicks X (mic button) → recording stops, editor reverts to original content

@coder-tasks
Copy link
Copy Markdown
Contributor

coder-tasks bot commented Mar 13, 2026

Documentation Check

Updates Needed

  • docs/ai-coder/tasks.md - Add a note about the voice-to-text input feature in the Tasks chat UI, including the browser compatibility caveat (Web Speech API is supported in Chrome/Edge but not Firefox). Users may be confused when the microphone button does not appear in unsupported browsers.

Automated review via Coder Tasks

@kylecarbs kylecarbs force-pushed the feat/voice-input-chat branch from fb46b7c to 3d5be9e Compare March 13, 2026 01:39
@kylecarbs kylecarbs merged commit 0e7e0a9 into main Mar 13, 2026
24 of 25 checks passed
@kylecarbs kylecarbs deleted the feat/voice-input-chat branch March 13, 2026 12:14
@github-actions github-actions bot locked and limited conversation to collaborators Mar 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants