Files
ClaudeDo/src/ClaudeDo.Ui/Services/MergeCoordinator.cs
T
mika kunsandClaude Sonnet 5.5 feb0afa33a fix(merge): pass the stash consent to the conflict resolver so it opens on a dirty target
The resolver restarts the merge via StartConflictMerge, which had no autostash.
After a stash-retry approve reported 'conflict', the restart hit the same dirty
target, got 'dirty_target' and the resolver silently never opened. Thread the
consent through the hub, client, coordinator and resolver; surface a refusal in
the footer instead of dropping it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-02 17:25:52 +02:00

24 lines
1.1 KiB
C#

using System;
using System.Threading.Tasks;
namespace ClaudeDo.Ui.Services;
/// <summary>
/// Single entry point for handing a conflicting merge to the in-app 3-pane resolver.
/// Replaces the per-VM <c>RequestConflictResolution</c> Func seams that used to be
/// hand-threaded shell → details → merge-section → diff → merge-modal.
///
/// DI singleton holding the resolver entry. The holder breaks the shell↔island construction
/// cycle: islands depend on this type, the shell sets <see cref="Handler"/> after it is built.
/// </summary>
public sealed class MergeCoordinator
{
/// Set once at composition to the shell's resolver entry. Null (headless/tests) ⇒ no-op.
public Func<string, string, bool, Task>? Handler { get; set; }
/// <summary>Opens the resolver for <paramref name="taskId"/>; <paramref name="autostash"/> is the
/// caller's stash consent, repeated because the resolver restarts the merge on its own.</summary>
public Task ResolveConflictAsync(string taskId, string targetBranch, bool autostash = false) =>
Handler?.Invoke(taskId, targetBranch, autostash) ?? Task.CompletedTask;
}