Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jul 21, 2025

Summary

This PR implements the feature requested in #6005 to add an openTabsInCorrectGroup setting that controls where Roo diff tabs are opened in VS Code.

Changes

  • Added openTabsInCorrectGroup setting to global-settings.ts (default: false)
  • Modified DiffViewProvider to:
    • Accept the setting in its constructor
    • Find existing tabs when the setting is enabled
    • Open diff tabs in the same group as the original file when found
    • Fall back to the active group when the file is not already open
  • Updated Task class to pass the setting to DiffViewProvider
  • Added comprehensive tests for the new functionality

Behavior

When openTabsInCorrectGroup is enabled:

  • For files already open in an editor group: The diff tab opens in the same group as the original file
  • For files not currently open: The diff tab opens in the currently active group

When openTabsInCorrectGroup is disabled (default):

  • All diff tabs open in the currently active group (preserves existing behavior)

Testing

  • Added unit tests to verify the correct viewColumn is used based on the setting
  • All existing tests pass
  • Linting and type checking pass

Related Issues

Fixes #6005

Acceptance Criteria Met

✅ Setting added with default value of false
✅ When enabled, diff tabs for open files appear beside the original in the same group
✅ When enabled, diff tabs for unopened files appear in the active group
✅ When disabled, all tabs open in the active group
✅ No unrelated tabs or groups are affected


Important

Adds openTabsInCorrectGroup setting to control diff tab placement in VS Code, with UI and state management updates.

  • Behavior:
    • Adds openTabsInCorrectGroup setting to global-settings.ts (default: false).
    • Modifies DiffViewProvider to open diff tabs in the same group as the original file if openTabsInCorrectGroup is enabled, otherwise in the active group.
    • Updates Task class to pass the setting to DiffViewProvider.
  • UI Components:
    • Adds checkbox for openTabsInCorrectGroup in AutoApproveSettings.tsx and SettingsView.tsx.
    • Updates i18n strings in settings.json for new setting.
  • State Management:
    • Updates ExtensionStateContext.tsx to include openTabsInCorrectGroup in state and provide setter.
    • Handles openTabsInCorrectGroup in webviewMessageHandler.ts for state updates.
  • Testing:
    • Adds unit tests to verify correct behavior based on the setting.
    • Ensures all existing tests pass.

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

@roomote roomote bot requested review from cte, jr and mrubens as code owners July 21, 2025 12:35
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Jul 21, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jul 21, 2025
@roomote roomote bot force-pushed the feature/open-tabs-in-correct-group branch from db4834e to 8faa2a5 Compare July 21, 2025 13:16
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The added 'fileEditingOptions' entries are still in English rather than Russian. Please update these strings with appropriate Russian translations.

This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new 'fileEditingOptions' section is still in English. Please provide proper Turkish translations for these texts.

This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'fileEditingOptions' block (including its description and the 'openTabsInCorrectGroup' texts) remains untranslated (in English). Please localize these strings into Vietnamese.

This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new 'fileEditingOptions' section and its 'openTabsInCorrectGroup' strings are still in English. Please provide the appropriate Simplified Chinese translations.

This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'fileEditingOptions' block (including description and 'openTabsInCorrectGroup' texts) remains in English. Please update these to proper Traditional Chinese translations.

Suggested change
"description": "Configure how Roo opens and manages files in the editor",
"description": "設定 Roo 如何在編輯器中開啟和管理檔案",

This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.

@roomote roomote bot force-pushed the feature/open-tabs-in-correct-group branch 2 times, most recently from 2b178bb to 78c3b9d Compare July 21, 2025 14:22
- Added openTabsInCorrectGroup setting to GlobalState type definition
- Created UI toggle in AutoApproveSettings component within File Editing Options section
- Added translation strings for the new UI elements
- Implemented message handler in webviewMessageHandler.ts
- Modified DiffViewProvider to accept provider reference and implement tab placement logic
- Updated Task.ts to pass provider to DiffViewProvider
- Added setting to ExtensionState and WebviewMessage types
- Fixed TypeScript errors by adding openTabsInCorrectGroup to ClineProvider getState()

This feature allows Roo to open diff editors and related tabs in the most logical editor group when working with multiple VS Code editor groups, improving navigation and organization for users with complex editor layouts.

Fixes #6005
@roomote roomote bot force-pushed the feature/open-tabs-in-correct-group branch from 78c3b9d to 9dd88bb Compare July 21, 2025 15:21
@daniel-lxs
Copy link
Member

To be implemented by @felixAnhalt, closing

@daniel-lxs daniel-lxs closed this Jul 22, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 22, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jul 22, 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:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Open Tabs in Correct Tab Group if Auto Focus Disabled

4 participants