-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
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.
| "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.
| 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.
| 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.
| "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.
| "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?
…enClineInThisTab - Extract common initialization logic to initializeClineTabProvider() - Extract common panel setup to setupClinePanel() - Both functions now share ~95% of their code through these helpers - Reduces maintenance burden and ensures consistency
daniel-lxs
left a comment
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.
LGTM
|
@roomote-agent can you switch into translate mode and add translations for the new string in all supported languages? |
|
Hi @mrubens! I see your request to add translations for the new "Open In This Tab" command string. I'll switch to translate mode and add the translations for all supported languages. Working on it now! |
Added translations for the new "Open In This Tab" command string to all supported languages: - Catalan (ca) - German (de) - Spanish (es) - French (fr) - Hindi (hi) - Indonesian (id) - Italian (it) - Japanese (ja) - Korean (ko) - Dutch (nl) - Polish (pl) - Portuguese Brazil (pt-BR) - Russian (ru) - Turkish (tr) - Vietnamese (vi) - Simplified Chinese (zh-CN) - Traditional Chinese (zh-TW)
|
Hi @mrubens! ✅ I've successfully added translations for the "Open In This Tab" command to all 17 supported languages: Translations added:
Validation:
The translations maintain consistency with the existing "Open In New Tab" translations and follow the localization guidelines for each language. |
|
Looking at the original issue, I wonder if we should instead figure out why there is an empty tab being created and fix that instead. |
|
@mrubens I'm actually not sure what the issue is, so I guess we can leave this in draft until we figure that out |
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.openInThisTabto package.jsonopenClineInThisTabfunction 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.openInThisTabcommand to open Roo Code in the current tab, enhancing user flexibility.roo-cline.openInThisTabcommand topackage.jsonfor opening Roo Code in the current tab.openClineInThisTabinregisterCommands.tsto open Roo Code in the active editor column.openInThisTabinpackage.nls.json.This description was created by
for 6c6df2f. You can customize this summary. It will automatically update as commits are pushed.