Desktop quality pass: hot-path perf, hands-free races, Windows compatibility#27
Merged
Conversation
- text-writer: stop blocking ~1s on clipboard restore; the one-shot binary pastes and exits, the Electron main process restores the user clipboard on a timer (with correct handling of back-to-back dictations) - keyboard: forward global key events only to webContents that subscribed (shortcut editors) instead of broadcasting every OS keystroke to all windows (perf + privacy) - interactions list: stop shipping raw_audio BLOBs on every list refresh; rows carry has_audio and the renderer fetches audio lazily by id - audio: throttle volume-meter emissions to ~15Hz at the source and skip the RMS pass when throttled; fix awaitDrainComplete leaking listeners and orphaning the first caller on overlapping stops fix(desktop): hands-free state machine edge cases - reconcile pending-tap/hands-free state when the setting is toggled off mid-session (complete or downgrade to push-to-talk instead of orphaning the recording) - serialize stop→start: startSession now waits for an in-flight stop's teardown of the shared controller/recorder (pending tap interrupted by a new shortcut could interleave initialize() with teardown and drop audio) - swallow an accidental double-tap on the hands-free stop tap (refractory window) instead of starting a spurious sub-400ms recording - cancel (not complete) the in-flight session when dictation is globally disabled; remove dead activeShortcutId assignments - +7 regression tests (keyboard 55 green, session manager 31 green) Co-Authored-By: Claude Fable 5 <[email protected]>
Confirmed findings from a Windows-compatibility review: - text-writer/selected-text-reader: send Ctrl+V / Ctrl+C with raw virtual keys (VK_V/VK_C) instead of Key::Unicode — Unicode resolves through the active keyboard layout, so on layouts without v/c keys (Cyrillic, Greek, ...) the chord was never delivered and paste/copy silently failed - global-key-listener: only treat Unknown(179) as the macOS fast-path fn key; on Windows it is the media Play/Pause key and was corrupting the pressed-keys set and getting swallowed when an fn hotkey was registered (same gate on the TS side when registering hotkeys) - permissions: detect the Windows Settings > Privacy > Microphone toggle via getMediaAccessStatus instead of hardcoding true — a denied mic used to pass onboarding and record silence with no diagnostics - packaging: mirror GNU cross-compiled .exes into the MSVC target dir so the local bun build:app:windows flow produces the layout electron-builder and the dev binary resolver expect - app lifecycle: closing the dashboard on Windows now hides to tray (like macOS) instead of quitting — closing settings used to kill background dictation entirely; Quit remains in the tray menu - settings UI: hide the macOS-only 'Mute audio when dictating' toggle on other platforms instead of showing a silent no-op Verified: cargo test workspace green, clippy clean, cross-compile check for x86_64-pc-windows-gnu passes for all three changed crates. Co-Authored-By: Claude Fable 5 <[email protected]>
metaforismo
added a commit
that referenced
this pull request
Jun 11, 2026
Co-Authored-By: Claude Fable 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Multi-reviewer quality pass over the merged desktop code (3 review agents: performance, Windows compatibility, recent-feature correctness), with every applied fix verified against the code first.
Performance (per-dictation hot path)
thread::sleep(1s)on the main thread of the one-shot binary (the comment claimed a background thread) — every dictation held the "processing" pill ~1s longer. The binary now pastes and exits; the Electron main process restores the user's clipboard on a timer, with correct handling of back-to-back dictations (Windows writer had the same bug — also fixed).onKeyEvent— only the shortcut editors receive events, only while mounted.findAllshipped theraw_audioBLOB for every row over IPC on every dictation. The list now uses a summary query (has_audioflag) and the renderer fetches audio lazily by id for play/download.awaitDrainCompleteno longer orphans the first caller and leakserrorlisteners on overlapping stops.Hands-free state machine (follow-up to #62 /
434df45)completeSession()+startSession()in the same tick, and the new session'sinitialize()could interleave with the old session's teardown (dropping the audio-duration check or cancelling the new stream).startSessionnow waits for the in-flight stop's teardown phase (released before the server-response wait, so no added latency).activeShortcutIdassignments.Windows compatibility
Key::Unicode: on layouts without v/c keys (Cyrillic, Greek, …) enigo fell back to sending text, the chord was never delivered, and paste/copy — the app's core function — silently failed.Unknown(179)is only the fn key on macOS; on Windows it's media Play/Pause and was corrupting the pressed-keys set (gated in Rust and TS).checkMicrophonePermissionhardcodedtrueon Windows; it now readsgetMediaAccessStatus, so a denied mic no longer passes onboarding and records silence..exes into the MSVC target dir that electron-builder and the dev resolver expect —bun build:app:windowsproduced a broken layout before.Tests
cargo test --workspace), clippy clean, andcargo check --target x86_64-pc-windows-gnupasses for the three changed crates.🤖 Generated with Claude Code