Skip to content

fix: add Cmd+, shortcut to open Preferences on macOS#3340

Open
jeanfbrito wants to merge 1 commit into
RocketChat:masterfrom
jeanfbrito:fix/3325-preferences-shortcut-macos
Open

fix: add Cmd+, shortcut to open Preferences on macOS#3340
jeanfbrito wants to merge 1 commit into
RocketChat:masterfrom
jeanfbrito:fix/3325-preferences-shortcut-macos

Conversation

@jeanfbrito
Copy link
Copy Markdown
Member

@jeanfbrito jeanfbrito commented May 22, 2026

Description

Adds the standard macOS keyboard shortcut Cmd+, (Command+Comma) to open Preferences/Settings. This is a universal macOS convention — most native apps support it.

Changes

  1. src/i18n/en.i18n.json: Added menus.preferences"Preferences" translation key
  2. src/ui/main/menuBar.ts: Inserted Preferences menu item in the macOS app menu (inside process.platform === 'darwin' block) with:
    • Label: Preferences
    • Accelerator: Command+,
    • Action: dispatches SIDE_BAR_SETTINGS_BUTTON_CLICKED (same as clicking Settings in the sidebar)

Menu order (macOS only)

About Rocket.Chat
---
Preferences...   Cmd+,
---
Services
---
Hide Rocket.Chat
Hide Others
Show All
---
Quit Rocket.Chat   Cmd+Q

Testing checklist

  • Command+, is not used by any other menu item
  • Only applies on macOS (process.platform === 'darwin' block)
  • Click dispatches the same action as navigating to Settings
  • Translation key added in en.i18n.json

Closes #3325

Summary by CodeRabbit

  • New Features
    • Added a new Preferences menu item to the main application menu (macOS only)
    • Preferences menu item can be accessed using the Command+, keyboard shortcut
    • Selecting Preferences opens the application settings panel

Review Change Stack

Add standard macOS Preferences menu item with 'Command+,' accelerator
in the app menu. Opens the Settings view, matching existing behavior.

- Add 'preferences' translation key
- Insert Preferences item in macOS app menu between About and Services
- Uses standard Electron 'Command+,' accelerator
- macOS-only (inside process.platform === 'darwin' block)
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 22, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fc928fb9-cf38-465f-ae8b-8dba97e0caa0

📥 Commits

Reviewing files that changed from the base of the PR and between c2b584b and 230e9c9.

📒 Files selected for processing (2)
  • src/i18n/en.i18n.json
  • src/ui/main/menuBar.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: check (macos-latest)
  • GitHub Check: check (windows-latest)
  • GitHub Check: check (ubuntu-latest)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Use TypeScript for all new code in this codebase unless explicitly told otherwise
Use Fuselage components from @rocket.chat/fuselage for all UI work — only create custom components when Fuselage doesn't provide the needed functionality
Check Theme.d.ts for valid color tokens when working with Fuselage components
Use optional chaining with fallbacks for platform-specific APIs instead of mocks (e.g., process.getuid?.() ?? 1000) to ensure code works across all platforms without requiring mocks
TypeScript code must use strict mode
Use React functional components with hooks instead of class components
Redux actions must follow the FSA (Flux Standard Action) pattern
Use camelCase for file naming
Use PascalCase for component file names (React components)
Write self-documenting code through clear naming — avoid unnecessary comments

Files:

  • src/ui/main/menuBar.ts
🔇 Additional comments (2)
src/i18n/en.i18n.json (1)

395-395: LGTM!

src/ui/main/menuBar.ts (1)

67-81: LGTM!


Walkthrough

This PR adds a native macOS Preferences menu item to the application menu. A new translation key menus.preferences is defined, and a corresponding menu entry is registered with the Command+, keyboard accelerator. Clicking the menu item or pressing the shortcut focuses the main window and dispatches an event to open the settings sidebar.

Changes

macOS Preferences Menu

Layer / File(s) Summary
Menu item and translation
src/i18n/en.i18n.json, src/ui/main/menuBar.ts
Translation key menus.preferences is added and used by a new macOS Preferences menu item. The menu entry includes a Command+, accelerator and an async click handler that focuses the root window and dispatches SIDE_BAR_SETTINGS_BUTTON_CLICKED to open settings.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Suggested labels

type: feature

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Linked Issues check ❓ Inconclusive The PR implements a macOS Preferences menu item with Cmd+, shortcut, which is a preliminary feature supporting the Click-to-Call objective. However, it addresses only the keyboard-shortcut infrastructure and not the telephony-specific objectives outlined in #3325. Clarify whether this PR is intended as preparatory infrastructure for #3325 or verify that all telephony feature objectives from #3325 are fully implemented in the code changes.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main change: adding the Cmd+, keyboard shortcut to open Preferences on macOS.
Out of Scope Changes check ✅ Passed All changes are focused on adding a Preferences menu item and translation; no out-of-scope modifications to unrelated functionality are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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 and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant