Add voice mute shortcut and recording activity indicators (#43651)

## What changed

- Add `Ctrl+X` to toggle the microphone for the active voice session on the current thread, with a footer hint and guards for modals, popups, and repeated key events.
- Show a recording dot in the terminal title's activity indicator while the microphone is listening, respecting title settings and clearing it when capture stops.
- Replace the microphone and speaker bars with compact Braille meters showing four recent amplitude samples.
- Briefly show `heard` when voice input interrupts speech, when animations are enabled.

## Testing

Add regression tests for shortcut routing, amplitude glyphs, interruption acknowledgment, and terminal title lifecycle, plus updated voice footer snapshots.

GitOrigin-RevId: e1dc0c1744667e646e0040e247c5a0409b416075
This commit is contained in:
Benjamin Carlsson authored and copyberry committed 2026-09-08 02:29:17 +00:00
1 parent 6fee98cc85
commit 4b0d9669cc
13 files changed
+774 -290

No files matched your search

@@ -0,0 +1,33 @@
//! Bounded real amplitude histories for voice recording controls.
#[cfg(test)]
#[path = "realtime_split_flap_tests.rs"]
mod tests;
/// Four bounded, calibrated amplitude samples; this is not frequency analysis.
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
pub(super) struct VoiceAmplitudeHistory([usize; 4]);
impl VoiceAmplitudeHistory {
pub(super) fn push(&mut self, level: usize) {
self.0.rotate_left(/*mid*/ 1);
self.0[3] = level.min(/*other*/ 5);
}
pub(super) fn glyphs(&self) -> String {
const LEFT_DOTS: [u32; 6] = [0, 0x40, 0x44, 0x46, 0x47, 0x47];
const RIGHT_DOTS: [u32; 6] = [0, 0x80, 0xa0, 0xb0, 0xb8, 0xb8];
self.0
.chunks_exact(/*chunk_size*/ 2)
.map(|levels| {
char::from_u32(0x2800 | LEFT_DOTS[levels[0]] | RIGHT_DOTS[levels[1]])
.unwrap_or('\u{2800}')
})
.collect()
}
pub(super) fn peak(&self) -> usize {
self.0.iter().copied().max().unwrap_or_default()
}
}