Commit 28e8803
fix(tui): plain V no longer hijacks typing; voice PTT is Alt+V only
Closes #49.
The press-half of voice "hold-to-talk" lived at app.rs:4641-4656 and
fired on plain `v` (no modifiers) whenever the prompt was in vim
Insert mode — i.e., the mode the user is in while typing. Every
literal `v` character ("review", "verify", "/coven", …) started a
recording instead of going to the prompt buffer. The release-half
at app.rs:7174-7185 was gated behind crossterm Press/Release event
delivery, which only works on platforms with the kitty keyboard
enhancement (mostly Windows). On macOS/Linux without it the press
fires, the release never does, and the recording sticks on,
silently eating every subsequent keystroke.
Both handlers are removed. The voice recorder is still wired up
when `voice_enabled: true` is set in `~/.coven-code/ui-settings.json`,
but the only way to start a recording is now the explicit Alt+V
chord (app.rs:~4588). Alt+V is press-only and toggles record-on /
record-off, so it works the same on every platform.
Also adds `COVEN_CODE_VOICE=0` (or `=false`) as a per-launch
opt-out, requested in #49. Set it to disable voice for the
current run without editing the persisted settings file.
Refactoring:
* App::new()'s inline voice-bootstrap block is extracted to
`voice_recorder_from_env_and_settings()` so the env-var/file
resolution can be reused and tested.
* New `voice_explicitly_disabled()` helper recognises
COVEN_CODE_VOICE=0/false.
Tests:
* `issue_49_plain_v_does_not_start_voice_recording`: with a real
VoiceRecorder attached, typing "voice" lands in the prompt
buffer and never trips `app.voice_recording`. Before this fix
the first `v` would have set `voice_recording = true`.
* `issue_49_coven_code_voice_env_opt_out_is_respected`: pins the
COVEN_CODE_VOICE=0/false → disabled, =1/unset → enabled matrix.
cargo fmt --all -- --check ✅
cargo check --workspace ✅
cargo clippy -- -D warnings ✅
cargo test --workspace ✅ 1551 passing, 0 failing (+2 new)
Live tmux smoke test against the release build with
`voice_enabled: true`: TUI launches without auto-recording, `/coven`
keystrokes reach the input, slash command fires and reports daemon
state. fixes #49.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 4ff873d commit 28e8803
2 files changed
Lines changed: 139 additions & 55 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 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 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
255 | 306 | | |
256 | 307 | | |
257 | 308 | | |
| |||
1825 | 1876 | | |
1826 | 1877 | | |
1827 | 1878 | | |
1828 | | - | |
1829 | | - | |
1830 | | - | |
1831 | | - | |
1832 | | - | |
1833 | | - | |
1834 | | - | |
1835 | | - | |
1836 | | - | |
1837 | | - | |
1838 | | - | |
1839 | | - | |
1840 | | - | |
1841 | | - | |
1842 | | - | |
1843 | | - | |
1844 | | - | |
1845 | | - | |
1846 | | - | |
1847 | | - | |
1848 | | - | |
1849 | | - | |
1850 | | - | |
1851 | | - | |
1852 | | - | |
1853 | | - | |
| 1879 | + | |
1854 | 1880 | | |
1855 | 1881 | | |
1856 | 1882 | | |
| |||
4638 | 4664 | | |
4639 | 4665 | | |
4640 | 4666 | | |
4641 | | - | |
4642 | | - | |
4643 | | - | |
4644 | | - | |
4645 | | - | |
4646 | | - | |
4647 | | - | |
4648 | | - | |
4649 | | - | |
4650 | | - | |
4651 | | - | |
4652 | | - | |
4653 | | - | |
4654 | | - | |
4655 | | - | |
4656 | | - | |
| 4667 | + | |
| 4668 | + | |
| 4669 | + | |
| 4670 | + | |
| 4671 | + | |
| 4672 | + | |
| 4673 | + | |
| 4674 | + | |
| 4675 | + | |
| 4676 | + | |
| 4677 | + | |
| 4678 | + | |
4657 | 4679 | | |
4658 | 4680 | | |
4659 | 4681 | | |
| |||
7167 | 7189 | | |
7168 | 7190 | | |
7169 | 7191 | | |
7170 | | - | |
7171 | | - | |
7172 | | - | |
7173 | | - | |
| 7192 | + | |
| 7193 | + | |
| 7194 | + | |
| 7195 | + | |
| 7196 | + | |
| 7197 | + | |
| 7198 | + | |
| 7199 | + | |
7174 | 7200 | | |
7175 | | - | |
7176 | | - | |
7177 | | - | |
7178 | | - | |
7179 | | - | |
7180 | | - | |
7181 | | - | |
7182 | | - | |
7183 | | - | |
7184 | 7201 | | |
7185 | 7202 | | |
7186 | 7203 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1625 | 1625 | | |
1626 | 1626 | | |
1627 | 1627 | | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
1628 | 1695 | | |
0 commit comments