Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Aug 5, 2025

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

  • Added keybinding configuration in src/package.json for the roo-cline.newTask command
  • Created a utility function in webview-ui/src/utils/keyboardShortcuts.ts to detect OS and format keyboard shortcuts appropriately
  • Updated ChatView.tsx to display the keyboard shortcut in the "Start New Task" button tooltip
  • The shortcut displays as ⌘R on Mac and Ctrl+R on Windows/Linux

Notes

  • The shortcut will override VSCode's default "Reload Window" command (Cmd+R/Ctrl+R) as requested
  • Users can still customize or remove the keybinding through VSCode's keyboard shortcut settings
  • The tooltip now shows "Begin a new task (⌘R)" or "Begin a new task (Ctrl+R)" depending on the OS

Testing

  • All tests pass successfully
  • Linting and type checking completed without errors

Important

Adds Cmd+R/Ctrl+R shortcut to open new task panel in VSCode extension, with OS-specific formatting and UI tooltip updates.

  • Behavior:
    • Adds Cmd+R/Ctrl+R shortcut to open new task panel in VSCode extension.
    • Overrides VSCode's default "Reload Window" command.
    • Users can customize/remove the keybinding in VSCode settings.
  • Keybindings:
    • Added roo-cline.newTask command keybinding in src/package.json.
  • Utilities:
    • Created getKeyboardShortcut() and getNewTaskShortcut() in keyboardShortcuts.ts to format shortcuts based on OS.
  • UI:
    • Updated ChatView.tsx to show shortcut in "Start New Task" button tooltip.

This description was created by Ellipsis for 476eaa0. You can customize this summary. It will automatically update as commits are pushed.

- 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
@roomote roomote bot requested review from cte, jr and mrubens as code owners August 5, 2025 11:22
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. enhancement New feature or request UI/UX UI/UX related or focused labels Aug 5, 2025
Copy link
Contributor Author

@roomote roomote bot left a 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 @@
/**
Copy link
Contributor Author

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 =
Copy link
Contributor Author

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:

Suggested change
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()})`
Copy link
Contributor Author

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
*/

/**
Copy link
Contributor Author

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.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Aug 5, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Aug 6, 2025
@hannesrudolph hannesrudolph added PR - Needs Preliminary Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Aug 6, 2025
@daniel-lxs
Copy link
Member

This is already possible with the native VSCode keybinds:
image

@daniel-lxs daniel-lxs closed this Aug 12, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Prelim Review] to Done in Roo Code Roadmap Aug 12, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request PR - Needs Preliminary Review size:M This PR changes 30-99 lines, ignoring generated files. UI/UX UI/UX related or focused

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants