Add global summon hotkey (Cmd/Ctrl+Shift+M)
Facebook Messenger on your desktop, without the Facebook clutter
Brought to you by:
kristoffer-r
Originally created by: kristofferR
A system-wide keyboard shortcut — Cmd+Shift+M on macOS, Ctrl+Shift+M on Windows/Linux — that shows and focuses Carrier from anywhere, or hides it when it's already visible and focused (the same toggle a tray click does). Off by default so it can't clash with other apps' shortcuts.
Ref [#52] (part of epic [#59])
tauri-plugin-global-shortcut v2 added; the shortcut is registered purely from Rust, so no capability changes are needed.global_hotkey bool in the Settings struct (default false), surfaced as a "Global Hotkey" checkbox under Settings → General.apply_settings calls a new sync_global_hotkey that registers/unregisters CmdOrCtrl+Shift+M to match the setting, so toggling takes effect immediately without a restart. Registration is best-effort (another app may own the combination) and pressing the hotkey reuses the existing toggle_main.cargo fmt && cargo clippy --all-targets -- -D warnings && cargo test --lib (44 passed) and node --check inject/messenger.js all clean.global-hotkey 0.8's parser accepts the CmdOrCtrl modifier (maps to Cmd on macOS, Ctrl elsewhere).Other feature PRs from this batch touch the same Settings struct / settings.html FIELDS/TABS arrays, so trivial merge conflicts with them are expected.
https://claude.ai/code/session_01Pqw8xaJrGLhgSo2YR68ov5
Originally posted by: kristofferR
@coderabbitai review
Originally posted by: coderabbitai[bot]
✅ Action performed
Review finished. > Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.Originally posted by: coderabbitai[bot]
📝 Walkthrough
## Walkthrough Adds an optional, off-by-default global hotkey (Cmd/Ctrl+Shift+M) to show/hide Carrier from anywhere, using a new `tauri-plugin-global-shortcut` dependency, a `global_hotkey` settings field with registration/sync logic in Rust, a settings UI checkbox, and README documentation. ### Changes **Global Hotkey Feature** |Layer / File(s)|Summary| |---|---| |**Dependency and settings model**`src-tauri/Cargo.toml`, `src-tauri/src/lib.rs`|Adds the `tauri-plugin-global-shortcut` dependency and a `global_hotkey: bool` field to `Settings`, defaulting to `false`.| |**Registration and sync logic**
`src-tauri/src/lib.rs`|Registers the global shortcut plugin at startup and adds `sync_global_hotkey` invoked from `apply_settings` to (un)register `SUMMON_SHORTCUT` and toggle the main window.| |**Settings UI checkbox**
`dist/settings.html`|Adds a `global_hotkey` field definition with label/hint and includes it in the General tab's field list.| |**Documentation**
`README.md`|Documents the new global hotkey feature, settings toggle, and keyboard shortcut entry.| **Estimated code review effort:** 2 (Simple) | ~10 minutes ### Sequence Diagram(s) :::mermaid sequenceDiagram participant App participant ApplySettings participant SyncGlobalHotkey participant GlobalShortcutPlugin participant MainWindow App->>GlobalShortcutPlugin: register plugin at startup ApplySettings->>SyncGlobalHotkey: call with global_hotkey setting SyncGlobalHotkey->>GlobalShortcutPlugin: register/unregister SUMMON_SHORTCUT GlobalShortcutPlugin-->>MainWindow: toggle_main on shortcut press **Possibly related issues** - [kristofferR/Carrier#52](https://github.com/kristofferR/Carrier/issues/52): Requests the same system-wide show/hide hotkey with an optional settings toggle via tauri-plugin-global-shortcut, matching this PR's implementation.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
| Check name | Status | Explanation | | :------------------------: | :------- | :--------------------------------------------------------------------------------------------------------- | | Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. | | Title check | ✅ Passed | The title clearly matches the main change: adding a global summon hotkey with Cmd/Ctrl+Shift+M. | | Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. | | Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |✨ Finishing Touches
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests - [ ] Commit unit tests in branch `feature/global-summon-hotkey`Comment
@coderabbitai helpto get the list of available commands.Related
Commit: [3e8a4b]
Originally posted by: kristofferR
@coderabbitai review
Originally posted by: coderabbitai[bot]
✅ Action performed
Review finished. > Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.Originally posted by: kristofferR
@coderabbitai review
Originally posted by: coderabbitai[bot]
✅ Action performed
Review finished. > Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.Ticket changed by: kristofferR