Skip to content

Conversation

@roomote
Copy link
Collaborator

@roomote roomote commented Jun 30, 2025

Summary

This PR implements a comprehensive solution for GitHub issue #5207, adding side-by-side diff preview capability to the multi-file apply_diff experiment in the Roo-Code repository.

Changes Made

New Components

  • SideBySideDiffViewer: A new React component that provides both unified and split-view diff rendering
  • Test Coverage: Comprehensive test suite for the new component

Enhanced Components

  • BatchDiffApproval: Modified to include view mode toggles between traditional and side-by-side views
  • CSS Variables: Added VSCode diff editor color variables for proper theming

Technical Improvements

  • Diff Parsing: Advanced logic to convert search/replace format to structured diff data
  • View Modes: Support for both unified and split-view diff rendering
  • File Navigation: Controls for multi-file operations with expand/collapse functionality
  • Color Coding: Proper highlighting for additions, deletions, and unchanged lines
  • VSCode Integration: Full integration with VSCode's color scheme and UI patterns

Testing & Configuration

  • Vitest Configuration: Fixed to support React development mode for testing
  • Test Suite: Added comprehensive tests covering all major functionality

Features

The implementation provides:

  • 📁 File navigation controls for multi-file operations
  • 📊 Parallel columns showing original vs modified content
  • 🎨 Color coding for additions, deletions, and unchanged lines
  • 📋 Summary view showing all affected files
  • 🔄 Toggle between traditional search/replace and modern side-by-side views
  • 🎯 Expand/collapse functionality for individual files
  • 📱 Responsive design that works with VSCode's theming

Testing

All tests pass successfully:

  • Component rendering tests
  • File summary display tests
  • Multi-file handling tests
  • Edge case handling (empty/undefined files)

Screenshots

The new side-by-side diff viewer provides a modern, intuitive interface for reviewing multi-file changes, significantly improving the user experience when working with the apply_diff tool.

Fixes #5207


Important

Adds side-by-side diff preview capability for multi-file diffs with new components, enhanced theming, and comprehensive testing.

  • New Components:
    • SideBySideDiffViewer: New React component for unified and split-view diff rendering.
    • Comprehensive test suite for SideBySideDiffViewer in SideBySideDiffViewer.spec.tsx.
  • Enhanced Components:
    • BatchDiffApproval: Added view mode toggles for traditional and side-by-side views.
    • Added VSCode diff editor color variables in index.css for theming.
  • Technical Improvements:
    • parseDiffContent() in SideBySideDiffViewer.tsx: Parses search/replace format to structured diff data.
    • Supports unified and split-view rendering with file navigation and color coding.
  • Testing & Configuration:
    • Updated vitest.config.ts to support React development mode.
    • Added tests for component rendering, file summary display, and edge cases.

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

…apply_diff

- Created SideBySideDiffViewer component with unified and split-view modes
- Added view mode toggle to BatchDiffApproval component
- Integrated VSCode diff editor color variables for proper theming
- Added comprehensive test coverage for the new component
- Fixed vitest configuration to support React development mode for testing

The implementation provides:
- File navigation controls for multi-file operations
- Parallel columns showing original vs modified content
- Color coding for additions, deletions, and unchanged lines
- Summary view showing all affected files
- Toggle between traditional search/replace and modern side-by-side views
@roomote roomote requested review from cte, jr and mrubens as code owners June 30, 2025 02:45
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. enhancement New feature or request labels Jun 30, 2025
@delve-auditor
Copy link

delve-auditor bot commented Jun 30, 2025

No security or compliance issues detected. Reviewed everything up to 944cb4e.

Security Overview
  • 🔎 Scanned files: 5 changed file(s)
Detected Code Changes

The diff is too large to display a summary of code changes.

Reply to this PR with @delve-auditor followed by a description of what change you want and we'll auto-submit a change to this PR to implement it.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jun 30, 2025
@KJ7LNW
Copy link
Contributor

KJ7LNW commented Jun 30, 2025

I am already working on this in #3055 which will also remove a lot of duplicated code across tools

@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jul 7, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 7, 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:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

multi file apply_diff: missing side-by-side diff preview capability

4 participants