Skip to content

Add file-based editing mode to bypass diff view for direct writes #6001

@felixAnhalt

Description

@felixAnhalt

What specific problem does this solve?

Problem Statement

Roo's current editing flow always uses diff-based views, which is helpful for traceability but often unnecessary for simple edits. Users should have the option to skip this step entirely and apply edits directly to the file on disk.

Who is affected:

Users who want faster editing cycles and simpler task execution, especially in low-stakes or non-review-heavy contexts

When:

Whenever Roo performs write/edit operations

Current vs Expected Behavior:

Current: All edits go through a visual diff view

Expected: If file-based editing is enabled, Roo writes changes directly without opening editors. If file-based editing is disabled all edits go through a visual diff view

Impact:

Greatly reduces cognitive overhead and tab churn for rapid development workflows. Also reduces editor clutter and latency.

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.

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 class to write based on fs instead of DiffView.
Add an interface to be able to easily switch between diff-based an file-based editing.
Add a setting to allow to switch between file-based and editor-based file edits for the user.

This will allow users to let roo edit files without having any visual impact (more cli-like feeling).
The new behavior will happen in the background.

How will we know it works? (Acceptance Criteria - REQUIRED if contributing, optional otherwise)

Given I have a file to edit
When I switch file-based editing on
Then roo-code edits the file
But the edit doesn't impact UI

Technical considerations (REQUIRED if contributing, optional otherwise)

Add FileWriter class and IEditingProvider defining an interface with the smallest common denominator neccessary to easily switch between DiffViewProvider and FileWriter.
Add new FileEditingOptions options section inside webview-ui/src/components/settings/SettingsView.tsx (and move diff settings there as well because diff related features directly belong to the file editing process).
Add the setting for fileBasedEditing 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)

Introduces a new settings section which might be conceived as "bloating" up the settings more.
Simultaneous changes by user and roo should be handled the same way as currently handled by DiffViewProvider.

Metadata

Metadata

Assignees

Labels

Issue - In ProgressSomeone is actively working on this. Should link to a PR soon.enhancementNew feature or requestproposal

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions