Skip to content

fix(desktop): gate push-to-talk global shortcut#1306

Closed
wesbillman wants to merge 4 commits into
mainfrom
pinky/ptt-shortcut-settings
Closed

fix(desktop): gate push-to-talk global shortcut#1306
wesbillman wants to merge 4 commits into
mainfrom
pinky/ptt-shortcut-settings

Conversation

@wesbillman

Copy link
Copy Markdown
Collaborator

Summary

  • stop registering the Push to Talk global shortcut at desktop startup
  • register Ctrl+Space only while a huddle is connected/active, Push to Talk mode is selected, and the user has the global shortcut enabled
  • add persistent Push to Talk shortcut enablement settings plus visible Settings and huddle UI states/errors
  • update shortcut copy, accessibility status text, and E2E Tauri mocks

Validation

  • pnpm --dir desktop check
  • pnpm --dir desktop typecheck
  • cargo fmt --check
  • cargo test ptt_shortcut::tests --lib --no-default-features from desktop/src-tauri with temporary empty Tauri sidecar placeholders, removed afterward

Notes

  • The shortcut binding itself remains Ctrl+Space for now, but it is no longer reserved globally unless it can actually transmit audio.
  • The Settings UI makes the global behavior explicit and lets users disable the shortcut when it conflicts with IDEs or other apps.

@wesbillman

Copy link
Copy Markdown
Collaborator Author

@codex please review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +245 to +246
state.ptt_shortcut.enabled.store(enabled, Ordering::Release);
refresh_registration(&app, &state);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@wesbillman wesbillman force-pushed the pinky/ptt-shortcut-settings branch from d79f5f5 to 9a99c2b Compare June 26, 2026 18:58
wesbillman and others added 2 commits June 26, 2026 13:24
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>
@wesbillman wesbillman force-pushed the pinky/ptt-shortcut-settings branch from 2be5445 to 0186a59 Compare June 26, 2026 19:29
Co-authored-by: Pinky <44b8e82baa6e0e254e0208d68f335c283c94e7b78dd1fa10d5a49d3f13dd0435@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
@wesbillman wesbillman force-pushed the pinky/ptt-shortcut-settings branch from 0186a59 to 67eb8dc Compare June 26, 2026 19:35
Co-authored-by: Pinky <44b8e82baa6e0e254e0208d68f335c283c94e7b78dd1fa10d5a49d3f13dd0435@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
@wesbillman wesbillman closed this Jun 26, 2026
@wesbillman wesbillman deleted the pinky/ptt-shortcut-settings branch June 26, 2026 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant