-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: add Cmd+R/Ctrl+R keyboard shortcut for new task #6719
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Added keybinding configuration in package.json for roo-cline.newTask command - Created utility function to detect OS and format keyboard shortcuts - Updated ChatView.tsx to display keyboard shortcut in tooltip - Shortcut shows as ⌘R on Mac and Ctrl+R on Windows/Linux
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reviewed my own code and found 5 things wrong with it. Classic me.
| @@ -0,0 +1,30 @@ | |||
| /** | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This utility file needs unit tests to ensure the OS detection logic works correctly across different platforms. Could we add tests for Mac, Windows, and Linux detection?
| */ | ||
| export function getKeyboardShortcut(commandKey: string): string { | ||
| // Check if we're on macOS | ||
| const isMac = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is using both navigator.platform and navigator.userAgent intentional? Since navigator.platform is deprecated, we might want to consider using navigator.userAgentData when available:
| const isMac = | |
| const isMac = navigator.userAgentData?.platform === 'macOS' || | |
| navigator.platform.toUpperCase().indexOf("MAC") >= 0 || navigator.userAgent.toUpperCase().indexOf("MAC") >= 0 |
| ? t("chat:runCommand.tooltip") | ||
| : primaryButtonText === t("chat:startNewTask.title") | ||
| ? t("chat:startNewTask.tooltip") | ||
| ? `${t("chat:startNewTask.tooltip")} (${getNewTaskShortcut()})` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For better accessibility, could we consider adding an aria-label that includes the keyboard shortcut? This would help screen reader users know about the shortcut when the button receives focus.
| * Utility functions for handling keyboard shortcuts | ||
| */ | ||
|
|
||
| /** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add a JSDoc comment explaining that this function respects keyboard layouts? The current comment is good, but mentioning keyboard layout support would be helpful for future maintainers.

This PR adds a keyboard shortcut (Cmd+R on Mac, Ctrl+R on Windows/Linux) to open the new task panel in the VSCode extension.
Changes Made
src/package.jsonfor theroo-cline.newTaskcommandwebview-ui/src/utils/keyboardShortcuts.tsto detect OS and format keyboard shortcuts appropriatelyChatView.tsxto display the keyboard shortcut in the "Start New Task" button tooltipNotes
Testing
Important
Adds Cmd+R/Ctrl+R shortcut to open new task panel in VSCode extension, with OS-specific formatting and UI tooltip updates.
roo-cline.newTaskcommand keybinding insrc/package.json.getKeyboardShortcut()andgetNewTaskShortcut()inkeyboardShortcuts.tsto format shortcuts based on OS.ChatView.tsxto show shortcut in "Start New Task" button tooltip.This description was created by
for 476eaa0. You can customize this summary. It will automatically update as commits are pushed.