Skip to content

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

roomote[bot]
Copy link

@roomote roomote bot commented Aug 13, 2025

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

  • Added new command roo-cline.openInThisTab to package.json
  • Implemented openClineInThisTab function that opens in the current active editor column
  • Added command ID to types and localization strings
  • The command reuses the active editor's view column, avoiding the need to close an empty tab

Related Issue

Closes #5457

Testing

  • TypeScript compilation passes ✅
  • ESLint checks pass ✅
  • All existing tests remain unaffected ✅

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.

  • Behavior:
    • Adds roo-cline.openInThisTab command to package.json for opening Roo Code in the current tab.
    • Implements openClineInThisTab in registerCommands.ts to open in the active editor column or Column One if none.
    • Reuses active editor's view column, preventing empty tab closure.
  • Localization:
    • Adds command.openInThisTab.title to package.nls.json for localization.
  • Testing:
    • TypeScript compilation and ESLint checks pass.
    • Existing tests remain unaffected.

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

- Add new command openInThisTab to package.json
- Implement openClineInThisTab function that opens in current tab
- Add command to types and localization
- Closes #5457
@roomote roomote bot requested review from mrubens, cte and jr as code owners August 13, 2025 17:19
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. enhancement New feature or request labels Aug 13, 2025
Copy link
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 it acceptable. The bar was low.

@@ -39,6 +39,7 @@ export const commandIds = [
"settingsButtonClicked",

"openInNewTab",
"openInThisTab",
Copy link
Author

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 }),
Copy link
Author

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">) => {
Copy link
Author

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",
Copy link
Author

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",
Copy link
Author

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?

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Aug 13, 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 Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:M This PR changes 30-99 lines, ignoring generated files.
Projects
Status: Triage
Development

Successfully merging this pull request may close these issues.

Add command 'Roo Code: Open in This Tab' (very simple)
2 participants