Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jul 21, 2025

This PR implements an experimental setting to prevent file edits from stealing focus, addressing the issue where diff views disrupt the user's workflow.

Summary

When Roo Code edits files, it opens diff views that steal focus from whatever the user is currently working on. This creates a frustrating experience where users cannot work alongside Roo effectively. This PR adds a new experimental setting roo-cline.preventFocusDisruption that prevents this behavior.

Changes

  • Added new configuration property roo-cline.preventFocusDisruption (default: false)
  • Updated DiffViewProvider to check the setting before showing documents or focusing
  • When enabled, file edits happen in the background without disrupting the user's current focus
  • Added comprehensive tests for the new functionality
  • Added localization entry for the setting description

Testing

  • All existing tests pass
  • Added new test suite specifically for the preventFocusDisruption setting
  • Tests cover:
    • Document showing behavior when setting is enabled/disabled
    • Focus preservation in diff views
    • Document restoration on revert

User Experience

When the setting is enabled:

  • File edits happen silently in the background
  • No diff views automatically open or steal focus
  • Users can continue typing uninterrupted while Roo works
  • Changes can be reviewed in the chat or by manually opening files

Fixes #4784


Important

Adds roo-cline.preventFocusDisruption setting to prevent file edits from stealing focus, with updates to DiffViewProvider and new tests.

  • Behavior:
    • Adds roo-cline.preventFocusDisruption setting (default: false) to prevent file edits from stealing focus.
    • Updates DiffViewProvider to respect this setting, allowing file edits to occur in the background.
  • Testing:
    • Adds tests in DiffViewProvider.spec.ts for preventFocusDisruption setting.
    • Tests cover document showing behavior, focus preservation, and document restoration on revert.
  • Localization:
    • Adds localization entry for preventFocusDisruption setting description in package.nls.json.

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

…ling

- Add new configuration property roo-cline.preventFocusDisruption (default: false)
- Update DiffViewProvider to check setting before showing documents or focusing
- Preserve focus when opening diff views if setting is enabled
- Add comprehensive tests for the new functionality
- Add localization entry for the setting description

Fixes #4784
@roomote roomote bot requested review from cte, jr and mrubens as code owners July 21, 2025 21:29
@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
@hannesrudolph hannesrudolph moved this from Triage to PR [Draft / In Progress] in Roo Code Roadmap Jul 21, 2025
@hannesrudolph hannesrudolph added PR - Draft / In Progress and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Jul 21, 2025
@hannesrudolph hannesrudolph moved this from PR [Draft / In Progress] to Triage in Roo Code Roadmap Jul 22, 2025
@hannesrudolph hannesrudolph moved this from Triage to PR [Draft / In Progress] in Roo Code Roadmap Jul 22, 2025
@hannesrudolph hannesrudolph self-assigned this Jul 22, 2025
@github-project-automation github-project-automation bot moved this from PR [Draft / In Progress] to Done in Roo Code Roadmap Jul 23, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 23, 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 PR - Draft / In Progress 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.

Feature Proposal: Option to Prevent Editor Focus Disruption During File Edits

3 participants