refactor(diff): single DiffViewer replaces DiffModal + WorktreeModal + PlanningDiff
This commit is contained in:
@@ -61,7 +61,7 @@ public sealed partial class WorktreesGroupViewModel : ViewModelBase
|
||||
public sealed partial class WorktreesOverviewModalViewModel : ViewModelBase
|
||||
{
|
||||
private readonly IWorkerClient _worker;
|
||||
private readonly Func<WorktreeModalViewModel> _diffVmFactory;
|
||||
private readonly Func<DiffViewerViewModel> _diffVmFactory;
|
||||
private readonly IMergeCoordinator _merge;
|
||||
|
||||
[ObservableProperty] private string? _listIdFilter;
|
||||
@@ -81,13 +81,13 @@ public sealed partial class WorktreesOverviewModalViewModel : ViewModelBase
|
||||
public ObservableCollection<WorktreeOverviewRowViewModel> ConflictRows { get; } = new();
|
||||
|
||||
public Action? CloseAction { get; set; }
|
||||
public Action<WorktreeModalViewModel>? ShowDiffAction { get; set; }
|
||||
public Action<DiffViewerViewModel>? ShowDiffAction { get; set; }
|
||||
public Action<string, string>? JumpToTaskAction { get; set; }
|
||||
public Func<string, Task<bool>>? ConfirmAction { get; set; }
|
||||
public Func<MergeModalViewModel>? ResolveMergeVm { get; set; }
|
||||
public Func<MergeModalViewModel, Task>? ShowMergeAction { get; set; }
|
||||
|
||||
public WorktreesOverviewModalViewModel(IWorkerClient worker, Func<WorktreeModalViewModel> diffVmFactory, IMergeCoordinator merge)
|
||||
public WorktreesOverviewModalViewModel(IWorkerClient worker, Func<DiffViewerViewModel> diffVmFactory, IMergeCoordinator merge)
|
||||
{
|
||||
_worker = worker;
|
||||
_diffVmFactory = diffVmFactory;
|
||||
@@ -177,8 +177,7 @@ public sealed partial class WorktreesOverviewModalViewModel : ViewModelBase
|
||||
{
|
||||
if (row is null) return;
|
||||
var diffVm = _diffVmFactory();
|
||||
diffVm.WorktreePath = row.Path;
|
||||
diffVm.BaseCommit = string.IsNullOrEmpty(row.BaseCommit) ? null : row.BaseCommit;
|
||||
diffVm.ConfigureWorktree(row.Path, row.BaseCommit);
|
||||
ShowDiffAction?.Invoke(diffVm);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user