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:
mika kuns
2026-06-04 17:56:06 +02:00
parent a3f407b0e5
commit 22a1ba7f30
7 changed files with 230 additions and 162 deletions

View File

@@ -66,14 +66,7 @@
<Grid Grid.Column="1" Background="{DynamicResource VoidBrush}">
<ScrollViewer HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto">
<TextBox Text="{Binding DisplayedDiff, Mode=OneWay}"
IsReadOnly="True"
AcceptsReturn="True"
FontFamily="{DynamicResource MonoFont}"
FontSize="{StaticResource FontSizeBody}"
Background="Transparent"
BorderThickness="0"
Padding="8"/>
<ctl:DiffLinesView Lines="{Binding DiffLines}"/>
</ScrollViewer>
</Grid>