refactor(ui): share color-coded diff rendering between per-task and combined diff viewers
Extract the unified-diff parser into UnifiedDiffParser and the styled line renderer into a reusable DiffLinesView control. The combined (planning) diff now parses its unified-diff string and renders color-coded rows (green additions / red deletions, file headers) identical to the per-task viewer instead of dumping plain text into a TextBox. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
19
src/ClaudeDo.Ui/Views/Controls/DiffLinesView.axaml.cs
Normal file
19
src/ClaudeDo.Ui/Views/Controls/DiffLinesView.axaml.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System.Collections;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace ClaudeDo.Ui.Views.Controls;
|
||||
|
||||
public partial class DiffLinesView : UserControl
|
||||
{
|
||||
public static readonly StyledProperty<IEnumerable?> LinesProperty =
|
||||
AvaloniaProperty.Register<DiffLinesView, IEnumerable?>(nameof(Lines));
|
||||
|
||||
public IEnumerable? Lines
|
||||
{
|
||||
get => GetValue(LinesProperty);
|
||||
set => SetValue(LinesProperty, value);
|
||||
}
|
||||
|
||||
public DiffLinesView() => InitializeComponent();
|
||||
}
|
||||
Reference in New Issue
Block a user