Skip to content

feat: add diff strategy selection in chat text area#525

Closed
monotykamary wants to merge 5 commits intoRooCodeInc:mainfrom
monotykamary:feat/diff-strategy-chat-text-area
Closed

feat: add diff strategy selection in chat text area#525
monotykamary wants to merge 5 commits intoRooCodeInc:mainfrom
monotykamary:feat/diff-strategy-chat-text-area

Conversation

@monotykamary
Copy link
Contributor

@monotykamary monotykamary commented Jan 24, 2025

Description

This PR introduces a new "Diff Strategy" dropdown to the chat input area in ChatTextArea.tsx. This dropdown allows users to dynamically control the diff strategy used for code edits directly from the chat interface.

The following options are available in the dropdown:

  • Disable Diff (whole): Disables the diffing feature, reverting to whole-file replacements.
  • Search Replace Diff (search-replace): Enables the default diff strategy, utilizing search and replace for efficient code modifications.
  • Unified Diff (Experimental) (unified-diff): Activates the experimental unified diff strategy, potentially improving diff accuracy but with a risk of unexpected behavior.

This enhancement provides users with more granular control over the code editing process and allows for easier experimentation with different diff strategies.

Type of change

  • New feature
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

This change has been manually tested by:

  • Verifying that the new "Diff Strategy" dropdown appears in the chat input area.
  • Confirming that changing the dropdown options correctly updates the diff behavior (disabling diff, using search-replace, and using unified-diff strategies).
  • Ensuring that the initial value of the dropdown reflects the current diff settings.

Checklist:

  • My code follows the patterns of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

Additional context

BEFORE:
image

AFTER:
image
image

Related Issues

Reviewers


Important

Adds a "Diff Strategy" dropdown in ChatTextArea.tsx for selecting code diff strategies, updating state based on user selection.

  • Behavior:
    • Adds "Diff Strategy" dropdown in ChatTextArea.tsx for selecting diff strategies: "Disable Diff (whole)", "Search Replace Diff (search-replace)", and "Unified Diff (Experimental) (unified-diff)".
    • Updates diffStrategy state based on diffEnabled and experimentalDiffStrategy from useExtensionState().
    • Dropdown changes update diffEnabled and experimentalDiffStrategy states accordingly.
  • UI:
    • Dropdown is disabled when textAreaDisabled is true.
    • Dropdown is styled with selectStyle and caretContainerStyle.

This description was created by Ellipsis for 0afe08d. It will automatically update as commits are pushed.

@changeset-bot
Copy link

changeset-bot bot commented Jan 24, 2025

⚠️ No Changeset found

Latest commit: 5ced55c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

monotykamary and others added 3 commits January 24, 2025 16:21
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
@mrubens
Copy link
Collaborator

mrubens commented Jan 25, 2025

I like the idea of making this option more visible than where it currently is, but I think the chat text area is too prominent for the amount that I expect people will need to change this.

I’ve been thinking about what a middle ground would be, and think it might be something like showing it and other advanced options in the area above the chat input when a task is not active - more visible, but out of your way when you’re actually working on a task. Not sure the details and there are other options too, but just wanted to share my perspective. What do you think?

@monotykamary
Copy link
Contributor Author

Same thoughts. Maybe an aider approach would be a bit better, where we can assign modes to their own edit strategy and replace the current checklist into this dropdown 🤔

@mrubens
Copy link
Collaborator

mrubens commented Jan 28, 2025

Same thoughts. Maybe an aider approach would be a bit better, where we can assign modes to their own edit strategy and replace the current checklist into this dropdown 🤔

Oh interesting - so maybe we add dropdown for diff type in the API configuration profiles?

@hannesrudolph hannesrudolph moved this to To triage in Roo Code Roadmap Mar 5, 2025
@hannesrudolph hannesrudolph moved this from To triage to PR - Needs Approval in Roo Code Roadmap Mar 6, 2025
@mrubens mrubens moved this from PR [Unverified] to PR [Deferred] in Roo Code Roadmap Mar 10, 2025
@cte
Copy link
Collaborator

cte commented Apr 15, 2025

We're moving the diff option to be per-profile, and we've converged on a single diff strategy, so I think that covers the spirit of this.

@cte cte closed this Apr 15, 2025
@github-project-automation github-project-automation bot moved this from PR [Deferred] to Done in Roo Code Roadmap Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants