Open Tabs in Correct Tab Group if Auto Focus Disabled
Issue Details
What specific problem does this solve?
When Roo opens diff editors or related tabs, they may not appear in the most logical editor group, especially in multi-group VS Code layouts. This can disrupt user workflow, as related files and diffs are not grouped together, making navigation less intuitive.
Who is affected?
Users working with multiple editor groups or split views in VS Code.
When does this happen?
When opening Roo diff editors or related tabs while multiple groups are present.
Current vs. expected behaviour:
Currently, Roo tabs may open in the active group, regardless of context. With this feature, Roo tabs will open beside the original file or in the most logical group (the one having started the task) .
Impact:
Improves navigation and organization for users working with complex editor layouts.
Additional context (optional)
There is already a reference implementation inside #2955 The refence implementation was also already extracted into its own branch. This issue is part of a series of proposed features which came to be by the discussions in said pull request. This issue makes sense after #5672
The proposed complete feature set being:
- Adding file based editing with the (least amount of control visually)
- Adding option to enable/disable autofocus to follow the visual editing process (most control visually)
- Adding option to open tabs in correct tab group if autofocus disabled
- Adding option to open tabs at the end of the tab list in the current tab group
- Adding settings to control tab closing behavior (opening tabs after edits, closing tabs after edits, closing all tabs of files touched
These should reside inside the FileEditingOptions
proposed in Technical considerations
For a look at the complete feature set have a look into #2955
Roo Code Task Links (Optional)
No response
Request checklist
- I've searched existing Issues and Discussions for duplicates
- This describes a specific problem with clear impact and context
Interested in implementing this?
- Yes, I'd like to help implement this feature
Implementation requirements
- I understand this needs approval before implementation begins
How should this be solved? (REQUIRED if contributing, optional otherwise)
Add a user setting openTabsInCorrectGroup (default: false). When enabled, Roo will: For unopened files, focus the last tab in the active group. For already open files, find the original tab and open the diff beside it. Use the correct viewColumn when opening tabs. If disabled, Roo will open tabs in the currently active group.
How will we know it works? (Acceptance Criteria - REQUIRED if contributing, optional otherwise)
Given I have multiple editor groups open in VS Code When I use Roo to open a diff editor for a file that is already open in one of the groups Then the Roo diff tab opens beside the original file in the same group And the original file remains open and focused if appropriate But no tabs are opened in unrelated groups
Given I have multiple editor groups open and open a Roo diff for a file that is not currently open When I trigger the diff operation Then the Roo diff tab opens at the end of the currently active group And the active group remains focused But no tabs are opened or moved in other groups
Given the openTabsInCorrectGroup setting is disabled When I open a Roo diff Then the tab always opens in the currently active group, regardless of the original file’s location And no attempt is made to match the group of the original file But unrelated tabs and groups are not affected
Technical considerations (REQUIRED if contributing, optional otherwise)
Placement logic is handled in DiffViewProvider
or externalized utils class.
The feature uses VSCode’s stable tab and group APIs for compatibility.
Automated tests should verify correct tab placement in various group scenarios.
Add new FileEditingOptions
options section inside webview-ui/src/components/settings/SettingsView.tsx
.
Add the setting for openTabsInCorrectGroup
inside src/core/webview/webviewMessageHandler.ts
etc.
Affected: DiffViewProvider
and webview-ui/src/components/settings/SettingsView.tsx
Trade-offs and risks (REQUIRED if contributing, optional otherwise)
If VSCode changes its tab/group APIs, adjustments may be needed.
Edge cases may arise with unusual editor layouts, but the logic is modular and easily extendable.
Because we are using a ViewColumn
not being ViewColumn.Beside
, vscode ignores preserveFocus
and we need to showTextDocument
for the file the user has worked on prior to the vscode.diff
call. This takes focus away for a short period of time.
Issue Details
Open Tabs in Correct Tab Group if Auto Focus Disabled
What specific problem does this solve?
When Roo opens diff editors or related tabs, they may not appear in the most logical editor group, especially in multi-group VS Code layouts. This can disrupt user workflow, as related files and diffs are not grouped together, making navigation less intuitive.
Who is affected?
Users working with multiple editor groups or split views in VS Code.
When does this happen?
When opening Roo diff editors or related tabs while multiple groups are present.
Current vs. expected behaviour:
Currently, Roo tabs may open in the active group, regardless of context. With this feature, Roo tabs will open beside the original file or in the most logical group (the one having started the task) .
Impact:
Improves navigation and organization for users working with complex editor layouts.
Additional context (optional)
There is already a reference implementation inside #2955 The refence implementation was also already extracted into its own branch. This issue is part of a series of proposed features which came to be by the discussions in said pull request. This issue makes sense after #5672
The proposed complete feature set being:
- Adding file based editing with the (least amount of control visually)
- Adding option to enable/disable autofocus to follow the visual editing process (most control visually)
- Adding option to open tabs in correct tab group if autofocus disabled
- Adding option to open tabs at the end of the tab list in the current tab group
- Adding settings to control tab closing behavior (opening tabs after edits, closing tabs after edits, closing all tabs of files touched
These should reside inside the FileEditingOptions
proposed in Technical considerations
For a look at the complete feature set have a look into #2955
Roo Code Task Links (Optional)
No response
Request checklist
- I've searched existing Issues and Discussions for duplicates
- This describes a specific problem with clear impact and context
Interested in implementing this?
- Yes, I'd like to help implement this feature
Implementation requirements
- I understand this needs approval before implementation begins
How should this be solved? (REQUIRED if contributing, optional otherwise)
Add a user setting openTabsInCorrectGroup (default: false). When enabled, Roo will: For unopened files, focus the last tab in the active group. For already open files, find the original tab and open the diff beside it. Use the correct viewColumn when opening tabs. If disabled, Roo will open tabs in the currently active group.
How will we know it works? (Acceptance Criteria - REQUIRED if contributing, optional otherwise)
Given I have multiple editor groups open in VS Code When I use Roo to open a diff editor for a file that is already open in one of the groups Then the Roo diff tab opens beside the original file in the same group And the original file remains open and focused if appropriate But no tabs are opened in unrelated groups
Given I have multiple editor groups open and open a Roo diff for a file that is not currently open When I trigger the diff operation Then the Roo diff tab opens at the end of the currently active group And the active group remains focused But no tabs are opened or moved in other groups
Given the openTabsInCorrectGroup setting is disabled When I open a Roo diff Then the tab always opens in the currently active group, regardless of the original file’s location And no attempt is made to match the group of the original file But unrelated tabs and groups are not affected
Technical considerations (REQUIRED if contributing, optional otherwise)
Placement logic is handled in DiffViewProvider
or externalized utils class.
The feature uses VSCode’s stable tab and group APIs for compatibility.
Automated tests should verify correct tab placement in various group scenarios.
Add new FileEditingOptions
options section inside webview-ui/src/components/settings/SettingsView.tsx
.
Add the setting for openTabsInCorrectGroup
inside src/core/webview/webviewMessageHandler.ts
etc.
Affected: DiffViewProvider
and webview-ui/src/components/settings/SettingsView.tsx
Trade-offs and risks (REQUIRED if contributing, optional otherwise)
If VSCode changes its tab/group APIs, adjustments may be needed.
Edge cases may arise with unusual editor layouts, but the logic is modular and easily extendable.
Because we are using a ViewColumn
not being ViewColumn.Beside
, vscode ignores preserveFocus
and we need to showTextDocument
for the file the user has worked on prior to the vscode.diff
call. This takes focus away for a short period of time.