Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

@ammar-agent ammar-agent commented Dec 2, 2025

Generated with mux

Fixes several voice input UX issues:

Space key hold causing gibberish sends

  • Track spaceHeld in a ref, require release before space can trigger send
  • Prevents rapid start→send when user holds space

Ctrl+D not working globally during recording

  • Moved recording keybinds into useVoiceInput hook (owns state machine, should own keybinds)
  • Uses matchesKeybind(e, KEYBINDS.TOGGLE_VOICE_INPUT) as source of truth

Space requiring focus to send

  • Use capture phase (addEventListener(..., true)) to intercept before focused elements consume the event
  • Now space/escape/ctrl+d work regardless of focus during recording

Design is more correct by construction: listeners only added when state === 'recording', auto-cleanup on state change.

@chatgpt-codex-connector

This comment has been minimized.

@ammar-agent ammar-agent force-pushed the voice-input-mode branch 6 times, most recently from 8eef247 to 21afe5b Compare December 2, 2025 17:08
More correct by construction: the hook owns the state machine, so it
should own the keyboard interactions for that state.

- Add useRecordingKeybinds option to useVoiceInput
- Track spaceHeld in a ref that persists correctly
- Listeners added only when state === 'recording', auto-cleanup on state change
- Removes duplicate keybind code from ChatInput
@ammar-agent ammar-agent changed the title 🤖 fix: ignore key repeat on space for voice input 🤖 fix: voice input keybind improvements Dec 2, 2025
@ammario ammario merged commit 0d42beb into main Dec 2, 2025
13 checks passed
@ammario ammario deleted the voice-input-mode branch December 2, 2025 17:17
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