Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ui/components/SideBar/ServerButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ const ServerButton = ({
};

const tooltipContent = `
${title} (${process.platform === 'darwin' ? '⌘' : '^'}+${shortcutNumber})
${title}${shortcutNumber ? ` (${process.platform === 'darwin' ? '⌘' : '^'}+${shortcutNumber})` : ''}
${
hasUnreadMessages
? `
Expand Down
2 changes: 1 addition & 1 deletion src/ui/components/SideBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const SideBar = () => {
: server.title ?? server.url
}
shortcutNumber={
typeof order === 'number' && order <= 9
typeof order === 'number' && order < 9
? String(order + 1)
: null
Comment on lines 105 to 108
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.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify whether server accelerators in the menu bar are still generated
# for every server instead of only 1-9.
# Expected result: If this concern is valid, src/ui/main/menuBar.ts will still show
# an uncapped `CommandOrControl+${i + 1}` mapping.

sed -n '456,483p' src/ui/main/menuBar.ts
rg -nP --type=ts 'accelerator:\s*`CommandOrControl\+\$\{i \+ 1\}`' src/ui/main/menuBar.ts

Repository: RocketChat/Rocket.Chat.Electron

Length of output: 1122


Cap menu-bar accelerators at 9 to match sidebar shortcut display.

The sidebar now limits tooltip shortcuts to servers 1–9 (Line 106), but src/ui/main/menuBar.ts:467 still generates CommandOrControl+${i + 1} for all servers. Add a condition to cap accelerators at 9 so tooltip display and accelerator registration stay in sync.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/ui/components/SideBar/index.tsx` around lines 105 - 108, The menu
accelerator generation in src/ui/main/menuBar.ts still creates
"CommandOrControl+${i + 1}" for every server index i, which can exceed the
sidebar's displayed shortcuts (1–9); update the accelerator creation (the
loop/logic that builds the accelerator string using CommandOrControl+${i + 1})
to only assign an accelerator when i < 9 (i.e., cap at 9) and otherwise leave
the accelerator undefined/null so the registered accelerators match SideBar's
shortcutNumber behavior.

}
Expand Down