Skip to content

Conversation

@felixAnhalt
Copy link

@felixAnhalt felixAnhalt commented Jul 25, 2025

Related GitHub Issue

Closes: #6001

Description

This PR adds file-based editing as an alternative to the default diff-based editing flow in Roo. The implementation introduces a new FileWriter class and an IEditingProvider interface, allowing switching between DiffViewProvider and direct file editing. Users can enable file-based editing via an experimental setting in webview-ui/src/components/settings/ExperimentalSettings.tsx, which applies edits directly to disk without UI impact.

Test Procedure

Automated testing:
Unit tests for editing logic and settings integration.

Manual testing:
Enable file-based editing in Experimental Settings.
Edit files and verify changes are applied directly, with no diff view.
Disable file-based editing and confirm diff view is used.
Do this while a task is being executed to see that the editing approached can be changed in-between.

Pre-Submission Checklist:

[x] Issue Linked
[x] Scope: Focused on the linked issue
[x] Self-Review
[x] Testing: New/updated tests added
[x] Documentation Impact considered
[x] Contribution Guidelines read and agreed

Screenshots / Videos

File-based editing in action:

Screen.Recording.2025-07-25.at.20.47.30.1.mov

Experimental setting:

image

Documentation Updates

Yes, documentation updates are required. Probably here for the supported experimental features.

Additional Notes

Feature is found under experimental as asked for here by @daniel-lxs .
There is an idea of an UI overhaul for all file editing related settings in #2955 which I would like to promote if the feature comes out of the experimental stage.

I intend to add translations for the other languages after the PRs code is formally accepted so it doesn't bloat up the PRs size. If there's a wish to get them earlier I can provide them.

Get in Touch

discord: icy_ice_pls


Important

Introduces experimental file-based editing feature with FileWriter class and IEditingProvider interface, allowing direct file edits without UI impact.

  • Behavior:
    • Introduces file-based editing as an experimental feature, allowing direct file edits without UI impact.
    • Adds FileWriter class and IEditingProvider interface to switch between DiffViewProvider and file-based editing.
    • Controlled via experimental setting in ExperimentalSettings.tsx.
  • Core Changes:
    • Updates Task class in Task.ts to use EditingProviderFactory for editing provider selection.
    • Modifies tools like applyDiffTool, insertContentTool, writeToFileTool, and searchAndReplaceTool to use IEditingProvider.
  • Tests:
    • Adds tests for EditingProviderFactory and FileWriter.
    • Updates existing tests to accommodate new editing provider logic.
  • Misc:
    • Adds fileBasedEditing to experiment.ts and experiments.ts.
    • Updates settings.json for new experimental feature description.

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

…e-based-editing-experimental

# Conflicts:
#	src/core/task/Task.ts
#	src/package.json
#	webview-ui/src/components/settings/ApiOptions.tsx
#	webview-ui/src/i18n/locales/ca/settings.json
#	webview-ui/src/i18n/locales/de/settings.json
#	webview-ui/src/i18n/locales/en/settings.json
#	webview-ui/src/i18n/locales/es/settings.json
#	webview-ui/src/i18n/locales/fr/settings.json
#	webview-ui/src/i18n/locales/hi/settings.json
#	webview-ui/src/i18n/locales/id/settings.json
#	webview-ui/src/i18n/locales/it/settings.json
#	webview-ui/src/i18n/locales/ja/settings.json
#	webview-ui/src/i18n/locales/ko/settings.json
#	webview-ui/src/i18n/locales/nl/settings.json
#	webview-ui/src/i18n/locales/pl/settings.json
#	webview-ui/src/i18n/locales/pt-BR/settings.json
#	webview-ui/src/i18n/locales/ru/settings.json
#	webview-ui/src/i18n/locales/tr/settings.json
#	webview-ui/src/i18n/locales/vi/settings.json
#	webview-ui/src/i18n/locales/zh-CN/settings.json
#	webview-ui/src/i18n/locales/zh-TW/settings.json
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jul 25, 2025
@felixAnhalt felixAnhalt marked this pull request as ready for review July 25, 2025 19:24
@felixAnhalt felixAnhalt requested review from cte, jr and mrubens as code owners July 25, 2025 19:24
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. documentation Improvements or additions to documentation enhancement New feature or request labels Jul 25, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Jul 25, 2025
@hannesrudolph hannesrudolph added PR - Needs Preliminary Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Jul 25, 2025
@daniel-lxs
Copy link
Member

Hey @felixAnhalt It seems like some translations are missing.

I'm also working on something similar but I think losing the diagnostics is a big downside, do you have any thoughts about it?

@daniel-lxs daniel-lxs moved this from PR [Needs Prelim Review] to PR [Changes Requested] in Roo Code Roadmap Jul 28, 2025
@daniel-lxs
Copy link
Member

Closing for now as this was already introduced as background edits

@daniel-lxs daniel-lxs closed this Aug 5, 2025
@github-project-automation github-project-automation bot moved this from PR [Changes Requested] to Done in Roo Code Roadmap Aug 5, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Aug 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request PR - Changes Requested 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.

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

3 participants