refactor(diff): render planning mode per file and retire DiffLinesView
This commit is contained in:
@@ -56,7 +56,8 @@ public sealed partial class DiffViewerViewModel : ViewModelBase
|
||||
|
||||
// ── Right pane ──────────────────────────────────────────────────────────
|
||||
[ObservableProperty] private DiffFileViewModel? _selectedFile; // Files mode
|
||||
public ObservableCollection<DiffLineViewModel> DiffLines { get; } = new(); // Planning mode
|
||||
// Planning mode: one entry per file so each gets its own editor and grammar.
|
||||
public ObservableCollection<DiffFileViewModel> PlanningFiles { get; } = new();
|
||||
[ObservableProperty] private string _displayedDiff = "";
|
||||
[ObservableProperty] private string? _statusMessage;
|
||||
|
||||
@@ -250,9 +251,9 @@ public sealed partial class DiffViewerViewModel : ViewModelBase
|
||||
|
||||
partial void OnDisplayedDiffChanged(string value)
|
||||
{
|
||||
DiffLines.Clear();
|
||||
foreach (var line in UnifiedDiffParser.Flatten(UnifiedDiffParser.Parse(value)))
|
||||
DiffLines.Add(line);
|
||||
PlanningFiles.Clear();
|
||||
foreach (var file in UnifiedDiffParser.Parse(value))
|
||||
PlanningFiles.Add(file);
|
||||
}
|
||||
|
||||
// ── Merge (Files mode, branch source) ───────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user