-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat: add "Roo Code: Open in This Tab" command #7051
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
base: main
Are you sure you want to change the base?
Conversation
- Add new command openInThisTab to package.json - Implement openClineInThisTab function that opens in current tab - Add command to types and localization - Closes #5457
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 it acceptable. The bar was low.
@@ -39,6 +39,7 @@ export const commandIds = [ | |||
"settingsButtonClicked", | |||
|
|||
"openInNewTab", | |||
"openInThisTab", |
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.
Good addition to the command IDs list. The placement is logical, right after the related 'openInNewTab' command.
@@ -129,6 +129,7 @@ const getCommandsMap = ({ context, outputChannel, provider }: RegisterCommandOpt | |||
return openClineInNewTab({ context, outputChannel }) | |||
}, | |||
openInNewTab: () => openClineInNewTab({ context, outputChannel }), | |||
openInThisTab: () => openClineInThisTab({ context, outputChannel }), |
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.
The command registration looks good, following the same pattern as openInNewTab.
@@ -298,3 +299,68 @@ | |||
|
|||
return tabProvider | |||
} | |||
|
|||
export const openClineInThisTab = async ({ context, outputChannel }: Omit<RegisterCommandOptions, "provider">) => { |
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 notice there's significant code duplication between this new function and openClineInNewTab
above. About 90% of the code is identical. Could we refactor these into a shared helper function that accepts parameters for the differences (view column selection and editor group locking)?
Also, is it intentional that this function doesn't lock the editor group like openClineInNewTab
does? Without the lock, clicking on files might open them over the Roo Code panel.
@@ -115,6 +115,11 @@ | |||
"title": "%command.openInNewTab.title%", | |||
"category": "%configuration.title%" | |||
}, | |||
{ | |||
"command": "roo-cline.openInThisTab", |
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.
Command definition looks good and follows the existing pattern.
@@ -15,6 +15,7 @@ | |||
"command.settings.title": "Settings", | |||
"command.documentation.title": "Documentation", | |||
"command.openInNewTab.title": "Open In New Tab", | |||
"command.openInThisTab.title": "Open In This Tab", |
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.
English localization added correctly. Should we also update the other language files in the locales directory (zh-CN, ja, etc.) with translations for this new command title?
This PR adds a new command "Roo Code: Open in This Tab" that opens Roo Code in the current tab instead of creating a new one.
Summary
roo-cline.openInThisTab
to package.jsonopenClineInThisTab
function that opens in the current active editor columnRelated Issue
Closes #5457
Testing
How it works
The new command opens Roo Code in the current active editor column (or Column One if no editor is active), while the existing "Open in New Tab" command continues to open in a new column to the right.
This provides users with the flexibility to choose whether they want to replace the current tab or open in a new one, addressing the issue where users had to close an empty tab after using "Open in New Tab".
Important
Adds
roo-cline.openInThisTab
command to open Roo Code in the current tab, enhancing user flexibility.roo-cline.openInThisTab
command topackage.json
for opening Roo Code in the current tab.openClineInThisTab
inregisterCommands.ts
to open in the active editor column or Column One if none.command.openInThisTab.title
topackage.nls.json
for localization.This description was created by
for 2fef294. You can customize this summary. It will automatically update as commits are pushed.