Skip to content

feat(shortcuts): warn when macOS Mission Control captures digit chords - #14734

Merged
nwparker merged 2 commits into
stablyai:mainfrom
pythonstrup:feat/mission-control-shortcut-conflict-warning
Aug 15, 2026
Merged

nwparker merged 2 commits into
stablyai:mainfrom
pythonstrup:feat/mission-control-shortcut-conflict-warning

Conversation

@pythonstrup

@pythonstrup pythonstrup commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

On macOS, an enabled “Switch to Desktop 1–9” symbolic shortcut can consume a digit chord before Orca receives it. Settings → Shortcuts now warns only when Orca confirms that the local system owns the same effective chord.

This PR does not change shortcut defaults.

Product decision and scope

Orca introduced the macOS Ctrl+1–9 tab default on May 30 in #3193 and made it remappable on June 19 in #5789. The linked issue #14733 was filed nine minutes after this PR’s first implementation commit, so it is useful reproduction evidence—not independent proof of a longstanding regression.

Changing the default now would require a migration and a broader redesign of Orca’s separate tab and workspace digit ranges. This PR keeps the current defaults and makes verified OS conflicts visible; a default migration can be evaluated separately.

Fixes #14733.

What changed

  • Reads live local macOS symbolic-hotkey preferences through a Darwin-only main-process probe with a 500 ms process-group timeout.
  • Validates the exact known preference shape, physical digit-row keycodes, supported modifier bits, and bounded numeric values. Unknown or malformed data fails silent.
  • Resolves physical keys through a fresh active keyboard-layout map. It does not guess a US layout or reuse stale layout data.
  • Probes immediately and again when the window regains focus, so following the remediation in System Settings updates the warning without remounting Settings.
  • Serializes refreshes, coalesces focus bursts to one trailing probe, rejects stale results, clears failed reads, and removes the listener on cleanup.
  • Routes the warning through the existing conflict UI, including the Conflicts filter/count. Helper text wraps instead of truncating.
  • Ships concise warning copy in English, Spanish, Japanese, Korean, and Chinese.
  • Probes the local Electron client for desktop SSH workspaces because that Mac receives the keystroke. Paired web stays silent locally. No remote-wire contract changes.

Visual proof

Conflict detected from the local macOS preference and active layout; the full remediation is visible and Conflicts is 1:

Conflict detected

After the preference is cleared and Orca regains focus, the warning disappears without remounting and Conflicts returns to 0:

Cleared after focus refresh

A 600 px viewport check also confirmed the helper wraps to two lines without clipping.

Verification

  • Full local suite: 5,636 test files passed, 22 skipped; 52,833 tests passed, 123 skipped.
  • Final rebased head: 37 focused tests passed across parsing, IPC wiring, layout resolution, focus refresh/coalescing, localization, and helper rendering.
  • pnpm lint
  • pnpm typecheck
  • pnpm build
  • Localization catalog, extraction, and coverage gates
  • Max-lines ratchet and git diff --check
  • Three independent readiness passes: correctness/security, performance/UI lifecycle, and compatibility/packaging; no P0/P1/P2 findings remain.
  • Electron CDP validation attached to the intended worktree and checked both the rendered state and backing IPC/state. Six enabled desktop-switch chords produced one range conflict; clearing them and refocusing cleared the rendered warning.

Compatibility and failure behavior

  • Windows/Linux return before any macOS command.
  • Desktop SSH correctly uses the local client’s Mission Control state.
  • Paired web returns no warning and does not query the paired host.
  • Missing APIs, rejected layout-map reads, malformed preferences, subprocess failures, and timeouts all return no warning.
  • No persisted-state, mobile, RPC, relay, Git-provider, dependency, native-module, or remote-wire changes.

Checklist

  • Manually tested in the rendered Electron app
  • Automated regression coverage added
  • Cross-platform, SSH, paired-web, localization, lifecycle, and failure paths reviewed
  • Full tests, lint, typecheck, build, and localization gates pass

AI disclosure

AI-assisted implementation and review. The maintainer directed the product decision, reviewed the diff, and verified the automated and rendered evidence.

@coderabbitai

coderabbitai Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The change adds macOS symbolic hotkey parsing and conflict detection for Mission Control digit shortcuts. The main process probes macOS settings and exposes captured chords through IPC and preload APIs. The shortcuts pane loads the chords and adds conflicts to the shortcut catalog. Web clients return an empty chord list. Tests cover parsing, modifier decoding, malformed input, layout resolution, probe lifecycle, rendering, localization, and conflict matching.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.09% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The implementation detects Mission Control digit hotkeys, matches effective Select Tab 1–9 bindings, and displays persistent conflict warnings as required by issue #14733.
Out of Scope Changes check ✅ Passed The changes remain focused on Mission Control conflict detection, shortcut warnings, supporting APIs, localization, layout handling, and related tests.
Title check ✅ Passed The title clearly identifies the main change: warnings for macOS Mission Control capturing digit chords.
Description check ✅ Passed The description clearly covers the change, rationale, linked issue, visual proof, testing, compatibility, checklist, and AI disclosure.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: dc8eb309-4d7d-4074-a508-cefeaaacb9f5

📥 Commits

Reviewing files that changed from the base of the PR and between b849099 and c153a1774634bfb68ec66f3d2f579816a44dd687.

📒 Files selected for processing (9)
  • src/main/ipc/app.ts
  • src/main/ipc/macos-symbolic-hotkeys-probe.ts
  • src/preload/api/app-api.ts
  • src/preload/index.ts
  • src/renderer/src/components/settings/ShortcutsPane.tsx
  • src/renderer/src/components/settings/shortcut-definition-catalog.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/shared/macos-symbolic-hotkeys.test.ts
  • src/shared/macos-symbolic-hotkeys.ts

@nwparker nwparker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Holding this pending both a product decision and correctness fixes.

The premise needs a more adversarial treatment: Orca introduced the colliding macOS Ctrl+1–9 tab default on May 30 in #3193, made it remappable on June 19 in #5789, and the linked issue #14733 was created nine minutes after this implementation commit was authored. That issue is therefore not independent evidence of a longstanding regression. Please explain why a permanent macOS-preferences probe is preferable to revisiting or migrating the relatively recent default.

Blocking findings are inline: the parser can report false conflicts on non-US layouts, the rendered helper truncates the remediation, and the warning remains stale after the user follows the remediation. The user-facing string also needs localization and plural-safe concise copy. I also called out the overlong inline comment.

Validation performed: 24 focused tests passed; touched-file oxlint/oxfmt, React changed-file lint, full typecheck, and localization verification passed. In the real Electron surface, six captured chords produced one conflict, but the visible warning ended at “before…” and remained after the live IPC probe returned an empty list; remounting the pane finally cleared it.

Comment thread src/shared/macos-symbolic-hotkeys.ts Resolved
@nwparker
nwparker force-pushed the feat/mission-control-shortcut-conflict-warning branch from c153a17 to 5a16220 Compare August 15, 2026 10:14
@nwparker
nwparker requested a review from brennanb2025 as a code owner August 15, 2026 10:14
@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@nwparker
nwparker force-pushed the feat/mission-control-shortcut-conflict-warning branch from 5a16220 to 55d80cd Compare August 15, 2026 10:17
@nwparker
nwparker dismissed their stale review August 15, 2026 10:19

All blocking findings are addressed on the rebased head; readiness, full tests, static gates, build, and rendered evidence are green.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 884fa3f8-0547-4997-ac83-70c815c6d5ea

📥 Commits

Reviewing files that changed from the base of the PR and between 931cb03 and 5a16220415ce4f4e59e17454cd671743dcdb1d3c.

📒 Files selected for processing (20)
  • src/main/ipc/app.ts
  • src/main/ipc/macos-symbolic-hotkeys-probe.ts
  • src/preload/api/app-api.ts
  • src/preload/index.ts
  • src/renderer/src/components/settings/ShortcutCommandBlock.test.tsx
  • src/renderer/src/components/settings/ShortcutCommandBlock.tsx
  • src/renderer/src/components/settings/ShortcutsPane.tsx
  • src/renderer/src/components/settings/shortcut-definition-catalog.test.ts
  • src/renderer/src/components/settings/shortcut-definition-catalog.ts
  • src/renderer/src/components/settings/shortcut-groups.test.ts
  • src/renderer/src/components/settings/use-mac-captured-digit-chords.test.ts
  • src/renderer/src/components/settings/use-mac-captured-digit-chords.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/web/web-preload-api.ts
  • src/shared/macos-symbolic-hotkeys.test.ts
  • src/shared/macos-symbolic-hotkeys.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/renderer/src/web/web-preload-api.ts
  • src/renderer/src/components/settings/ShortcutsPane.tsx
  • src/preload/index.ts
  • src/preload/api/app-api.ts
  • src/renderer/src/components/settings/shortcut-definition-catalog.ts

pythonstrup and others added 2 commits August 15, 2026 04:32
Mission Control's Switch to Desktop shortcuts (Ctrl+digit by default,
present whenever the user has multiple Spaces) are consumed by
WindowServer before the app receives the event, so Orca's digit-range
shortcuts silently do nothing and the app can never observe the press.
Detect the conflict instead: probe com.apple.symbolichotkeys through
the live-prefs pipeline on Shortcuts pane mount and surface a standing
conflict warning on the affected rows, counted into the Conflicts stat.

Non-Darwin and the web client return no chords, and any probe failure
yields an empty result so a missing signal can never show a false
warning.

Co-Authored-By: Claude Fable 5 <[email protected]>
@nwparker
nwparker force-pushed the feat/mission-control-shortcut-conflict-warning branch from 55d80cd to d51c473 Compare August 15, 2026 11:33
@pythonstrup

Copy link
Copy Markdown
Contributor Author

@nwparker Thank you for the hardening pass — emitting physical DigitN codes and resolving them through the active layout map is a much cleaner boundary than my keycode→digit mapping (the AZERTY false positive was a real miss on my part), and the focus re-probe closes the stale-warning gap I'd left open. Appreciate you rebasing and carrying this through; I'll keep the logical-vs-physical key distinction in mind for future shortcut work here.

@nwparker
nwparker merged commit a234123 into stablyai:main Aug 15, 2026
45 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
stablyai#14734)

* feat(shortcuts): warn when macOS Mission Control captures digit chords

Mission Control's Switch to Desktop shortcuts (Ctrl+digit by default,
present whenever the user has multiple Spaces) are consumed by
WindowServer before the app receives the event, so Orca's digit-range
shortcuts silently do nothing and the app can never observe the press.
Detect the conflict instead: probe com.apple.symbolichotkeys through
the live-prefs pipeline on Shortcuts pane mount and surface a standing
conflict warning on the affected rows, counted into the Conflicts stat.

Non-Darwin and the web client return no chords, and any probe failure
yields an empty result so a missing signal can never show a false
warning.

Co-Authored-By: Claude Fable 5 <[email protected]>

* fix(shortcuts): harden Mission Control conflict warnings

---------

Co-authored-by: Claude Fable 5 <[email protected]>
Co-authored-by: Neil <[email protected]>
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.

[Bug]: Select Tab 1–9 (⌃1–⌃9) silently does nothing on macOS when Mission Control Spaces shortcuts are enabled

2 participants