mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
Addresses all 8 unresolved review threads on PR #1511: 1. **Accumulate local transcript segments** (already fixed) — each streaming partial resets lastTranscriptRef so segments are appended, not replaced. 2. **Flush local speech before shutdown** (already fixed) — worker flushes remaining speech_buf on loop exit. 3. **Scope dictation shortcut to one composer** — new activeComposer module tracks which composer instance last received focus. The ⌘D handler only dispatches to the active instance, preventing duplicate recordings when both channel and thread composers are mounted. 4. **Keep listening through user-stop finalization** (already fixed) — stopRecording no longer calls cleanup(); event listeners stay alive until the native 'stopped' event arrives with the final transcript. 5. **Refresh dictation availability after model downloads** — availability check now polls every 5s until the model is ready, then stops. Covers the fresh-install case where the model downloads in the background. 6. **Stop native engine after startup failures** — catch block now calls invoke('stop_dictation') before cleanup so the native SttEngine doesn't linger when mic permission is denied or AudioWorklet setup fails. 7. **Prevent disabled composers from shortcut-starting** — keydown handler checks disabledRef/isSendBlockedRef before starting dictation. 8. **Batch dictation audio before IPC** — worklet frames are accumulated in a Float32Array batch and flushed every 100ms (~10 IPC calls/s instead of ~375). Also removed the erroneous worklet→destination connection that was playing mic audio back through speakers. Additionally: - Removed the entire dead OpenAI relay proxy (transcribe.rs, routes, config fields, .env.example entries, reqwest dep, bridge.rs visibility widening). - Scoped the keyup event to only fire when ⌘D keydown was actually dispatched (no more spurious events on normal 'd' typing).