Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jul 21, 2025

This PR implements the auto-close Roo tabs feature as requested in #6003. It adds two new settings that allow users to automatically close tabs that were opened by Roo after saving changes.

New Settings

  • autoCloseRooTabs: When enabled, automatically closes the tab of the file that was just edited and saved
  • autoCloseAllRooTabs: When enabled, automatically closes ALL tabs that were opened by Roo during the current session

Implementation Details

  • Added new settings to global-settings.ts schema
  • Created FileEditingOptions React component for the settings UI
  • Updated SettingsView and webviewMessageHandler to support the new settings
  • Created PostEditBehaviorUtils class to handle tab closing operations
  • Updated DiffViewProvider to track which tabs were opened by Roo and close them after save
  • Added focus restoration to return to the pre-edit active editor

Testing

  • Added unit tests for PostEditBehaviorUtils (some mocking issues remain to be resolved)
  • Manually tested the feature with various scenarios

Closes #6003


Important

Introduces auto-close feature for Roo-opened tabs with new settings, UI components, and utility functions.

  • Behavior:
    • Adds autoCloseRooTabs and autoCloseAllRooTabs settings to global-settings.ts for automatic tab closure after editing.
    • Implements tab closure logic in PostEditBehaviorUtils with methods closeRooTabs() and restoreFocus().
    • Updates DiffViewProvider to track and close tabs based on new settings.
  • UI:
    • Adds FileEditingOptions component to manage new settings in the UI.
    • Updates SettingsView to include file editing options.
  • Testing:
    • Adds unit tests for PostEditBehaviorUtils in PostEditBehaviorUtils.spec.ts.

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

- Add autoCloseRooTabs and autoCloseAllRooTabs settings to global settings
- Create PostEditBehaviorUtils class to handle tab closing logic
- Update DiffViewProvider to track Roo-opened tabs and close them after save
- Add FileEditingOptions component for settings UI
- Update SettingsView and webviewMessageHandler to support new settings
- Add tests for PostEditBehaviorUtils (some mocking issues to be resolved)

Closes #6003
@roomote roomote bot requested review from cte, jr and mrubens as code owners July 21, 2025 14:26
@roomote roomote bot mentioned this pull request Jul 21, 2025
4 tasks
@dosubot dosubot bot added size:XL This PR changes 500-999 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
- Fixed logic to only close the edited file when autoCloseRooTabs is true but autoCloseAllRooTabs is false
- Updated tests to properly mock vscode.window.tabGroups.close() method
- Added isDirty property to test tab mocks
@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:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Auto-close Roo Tabs

4 participants