fix(desktop): gate push-to-talk global shortcut#1306
Conversation
|
@codex please review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5db27eb8ed
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| state.ptt_shortcut.enabled.store(enabled, Ordering::Release); | ||
| refresh_registration(&app, &state); |
There was a problem hiding this comment.
Honor disabled PTT setting in the shortcut handler
When disabling the shortcut during an active push-to-talk huddle, this persists enabled=false and then relies on refresh_registration to unregister the OS shortcut. If that unregister call fails (the new error path leaves registered=true and returns settings with an error), the global-shortcut handler in lib.rs still only checks huddle phase/mode, so Ctrl+Space can continue setting ptt_active even though the user disabled the global shortcut. Gate the handler on ptt_shortcut.enabled as well, or force events inactive when unregister fails.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 6c0de24: the shortcut handler now gates on the same enabled + huddle active + Push to Talk predicate used for registration, so if unregistering fails after the user disables the shortcut, any still-delivered global events are ignored.
d79f5f5 to
9a99c2b
Compare
Register the push-to-talk shortcut only while it can transmit audio: a huddle is active, Push to Talk mode is selected, and the user has the shortcut enabled. Persist the enablement setting and expose it in Settings so users can disable the global reservation when it conflicts with other apps. Update huddle controls and accessibility copy to show the current shortcut state and registration errors. Co-authored-by: Pinky <44b8e82baa6e0e254e0208d68f335c283c94e7b78dd1fa10d5a49d3f13dd0435@sprout-oss.stage.blox.sqprod.co> Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Gate incoming global shortcut events on the same PTT shortcut settings predicate used for registration. If unregistering fails after the user disables the shortcut, any still-delivered OS events are ignored instead of toggling push-to-talk. Co-authored-by: Pinky <44b8e82baa6e0e254e0208d68f335c283c94e7b78dd1fa10d5a49d3f13dd0435@sprout-oss.stage.blox.sqprod.co> Signed-off-by: Wes <wesbillman@users.noreply.github.com>
2be5445 to
0186a59
Compare
Co-authored-by: Pinky <44b8e82baa6e0e254e0208d68f335c283c94e7b78dd1fa10d5a49d3f13dd0435@sprout-oss.stage.blox.sqprod.co> Signed-off-by: Wes <wesbillman@users.noreply.github.com>
0186a59 to
67eb8dc
Compare
Co-authored-by: Pinky <44b8e82baa6e0e254e0208d68f335c283c94e7b78dd1fa10d5a49d3f13dd0435@sprout-oss.stage.blox.sqprod.co> Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Summary
Ctrl+Spaceonly while a huddle is connected/active, Push to Talk mode is selected, and the user has the global shortcut enabledValidation
pnpm --dir desktop checkpnpm --dir desktop typecheckcargo fmt --checkcargo test ptt_shortcut::tests --lib --no-default-featuresfromdesktop/src-tauriwith temporary empty Tauri sidecar placeholders, removed afterwardNotes
Ctrl+Spacefor now, but it is no longer reserved globally unless it can actually transmit audio.