Commit 0d42beb
authored
🤖 fix: voice input keybind improvements (#846)
_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.1 parent 38d0f2c commit 0d42beb
File tree
2 files changed
+53
-15
lines changed- src/browser
- components/ChatInput
- hooks
2 files changed
+53
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| 176 | + | |
176 | 177 | | |
177 | 178 | | |
178 | 179 | | |
| |||
496 | 497 | | |
497 | 498 | | |
498 | 499 | | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | 500 | | |
512 | | - | |
513 | 501 | | |
514 | 502 | | |
515 | | - | |
516 | 503 | | |
517 | 504 | | |
518 | 505 | | |
| |||
862 | 849 | | |
863 | 850 | | |
864 | 851 | | |
865 | | - | |
| 852 | + | |
866 | 853 | | |
867 | 854 | | |
| 855 | + | |
868 | 856 | | |
869 | 857 | | |
870 | 858 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
19 | 27 | | |
20 | 28 | | |
21 | 29 | | |
| |||
236 | 244 | | |
237 | 245 | | |
238 | 246 | | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
239 | 289 | | |
240 | 290 | | |
241 | 291 | | |
| |||
0 commit comments