fix(desktop): reserve PTT shortcut only during active huddle#1315
Merged
Conversation
80f9ca7 to
8f803f0
Compare
The push-to-talk Ctrl+Space global shortcut was registered with the OS at startup and held for the entire app lifetime, conflicting with IDEs and other apps even when no huddle was running. Register the shortcut only while a huddle is Connected/Active and the voice input mode is push-to-talk; unregister on teardown or when switching to VAD. Registration is synced from huddle state at the existing state-change chokepoint plus the voice-mode switch. Gate the global-shortcut plugin behind cfg(not(test)) so the lib-test binary never links it — that link is what made the Windows test executable fail to load with STATUS_ENTRYPOINT_NOT_FOUND. Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co> Signed-off-by: Wes <wesbillman@users.noreply.github.com>
8f803f0 to
a569f97
Compare
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.
Summary
Fixes the original push-to-talk keyboard-shortcut conflict:
Ctrl+Spacewas registered as a global shortcut at app startup and reserved with the OS for the entire app lifetime, so it conflicted with IDEs and other apps even when no huddle was running.This is a clean, minimal redo of #1306 (closed) — without the Cargo feature,
ci.ymlchange, capability removal, or settings-UI/persistence layer that PR had accumulated.What changed
ptt_shortcut.rs(new):sync_registration()reservesCtrl+Spacewith the OS only while a huddle isConnected/Activeand the voice input mode is push-to-talk; unregisters otherwise. Idempotent and best-effort (failures logged, never fatal — VAD mode still works without it).lib.rs: removed the unconditional startup registration block (the bug). The global-shortcut plugin is now gated behind#[cfg(not(test))]so the lib-test binary never links it.app_state.rs:sync_registrationis called at the end ofemit_huddle_state_changed— the single chokepoint hit by every huddle phase transition, including teardown.huddle/mod.rs: one extrasync_registrationcall inset_voice_input_mode(the one state change that doesn't emit).Why the
cfg(not(test))gateThe previous PR's Windows failures (
STATUS_ENTRYPOINT_NOT_FOUND,0xc0000139) came fromtauri-plugin-global-shortcutbeing linked into the Windows lib-test executable, which then failed to load before any test ran. Excluding the plugin fromcfg(test)builds removes that link entirely — no Cargo feature, noci.ymledit, no capability changes needed.Validation (local)
just desktop-tauri-test— 729 passed, 0 failed; the test binary compiles with the plugin excluded.just desktop-tauri-check(real app, plugin included) — compiles clean.cargo fmt --check— clean.Note
mainis currently red on some Desktop / E2E jobs independent of this change, so those may fail here too. The signal for this PR is Windows Rust and Unit Tests.