Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jul 21, 2025

Summary

This PR adds a new setting diffViewAutoFocus that allows users to control whether diff editors automatically gain focus when opened by Roo.

Changes

  • Added diffViewAutoFocus boolean setting to global settings schema with default value of false
  • Added UI checkbox in the Auto-approve Settings section
  • Updated ExtensionStateContext to manage the setting state
  • Modified DiffViewProvider to use the setting for the preserveFocus parameter
  • Updated Task class to pass the setting value to DiffViewProvider
  • Added comprehensive tests for the new functionality
  • Added i18n translations for the setting

Testing

  • All existing tests pass
  • Added new tests specifically for the diffViewAutoFocus behavior
  • Manually tested the setting toggle in the UI

Screenshots

The new setting appears in the Auto-approve Settings section:

  • When unchecked (default): Diff editors open without stealing focus
  • When checked: Diff editors automatically gain focus when opened

Fixes #6010


Important

Introduces diffViewAutoFocus setting to control diff editor focus, with UI integration, state management, tests, and translations.

  • Behavior:
    • Adds diffViewAutoFocus setting to control focus behavior of diff editors, default false.
    • Integrated into UI with a checkbox in Auto-approve Settings.
    • DiffViewProvider uses setting for preserveFocus parameter.
  • State Management:
    • ExtensionStateContext updated to manage diffViewAutoFocus state.
    • Task class updated to pass setting to DiffViewProvider.
  • Testing:
    • New tests for diffViewAutoFocus in DiffViewProvider.spec.ts and Task.spec.ts.
  • Translations:
    • Added i18n translations for diffViewAutoFocus in multiple language files.

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

…vior

- Added diffViewAutoFocus boolean setting to global settings schema
- Added UI checkbox in AutoApproveSettings component
- Updated ExtensionStateContext to manage the setting state
- Modified DiffViewProvider to use the setting for preserveFocus parameter
- Updated Task class to pass the setting to DiffViewProvider
- Added comprehensive tests for the new functionality
- Added i18n translations for the setting

Fixes #6010
@roomote roomote bot requested review from cte, jr and mrubens as code owners July 21, 2025 13:11
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request UI/UX UI/UX related or focused 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
- Add missing translations for diffViewAutoFocus setting to all 17 locale files
- Remove unused FileEditingSettings.tsx file to fix knip issues
- Fix unit test failures by updating vscode mock with missing exports (Uri, RelativePattern, onDidChangeWorkspaceFolders)
- Ensure mockProvider.getState returns valid response in Task.spec.ts
@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 Triage to Done in Roo Code Roadmap Jul 22, 2025
@github-project-automation github-project-automation bot moved this from New 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. UI/UX UI/UX related or focused

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Add option to disable/enable focus on diff view

4 participants