refactor: collapse single-implementation interfaces
Nine interfaces had exactly one implementation and no test double — they existed only to be named twice in a DI registration: IFindingsStore, IFindingsStoreLocator, IPrimeScheduleSignal, IRefineRunner, IWeekReportService, IMergeCoordinator, IMissionControlPane, IOnlineLoginService, ITaskListFilter. Consumers now depend on the concrete type; the DTO records that shared those files moved next to their implementation. IInteractiveLaunchSpecService stays — it carries 54 lines of contract documentation, which is not ceremony. IMergeCoordinator in particular had a redundant null object: MergeCoordinator with a null Handler already no-ops, and every test used the real class with Handler set. Filtering/ collapses from 8 files to 1. ITaskListFilter and TaskListFilterBase were a double abstraction over four predicates, with MatchesAsContext => false declared in both. SmartFlagFilter also compiled its expression twice (its own _flag plus the inherited Matches cache) — it now uses the cache. StaticTokenAuthProvider was in src but production uses ZitadelAuthProvider; it is a test double, so it moves to the test project. Its own test goes away with it.
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
namespace ClaudeDo.Ui.Services;
|
||||
|
||||
public sealed record OnlineLoginResult(bool Success, string? RefreshToken, string? Error, string? Warning = null);
|
||||
|
||||
public interface IOnlineLoginService
|
||||
{
|
||||
Task<OnlineLoginResult> LoginAsync(
|
||||
string authority, string clientId, string scope, string redirectUri,
|
||||
CancellationToken ct = default);
|
||||
}
|
||||
+4
-12
@@ -6,20 +6,12 @@ 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. The shell wires
|
||||
/// <see cref="MergeCoordinator.Handler"/> once at composition; invokers depend only on
|
||||
/// this interface (injected via DI).
|
||||
/// </summary>
|
||||
public interface IMergeCoordinator
|
||||
{
|
||||
Task ResolveConflictAsync(string taskId, string targetBranch);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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 the interface, the shell sets <see cref="Handler"/> after it is built.
|
||||
/// cycle: islands depend on this type, the shell sets <see cref="Handler"/> after it is built.
|
||||
/// </summary>
|
||||
public sealed class MergeCoordinator : IMergeCoordinator
|
||||
public sealed class MergeCoordinator
|
||||
{
|
||||
/// Set once at composition to the shell's resolver entry. Null (headless/tests) ⇒ no-op.
|
||||
public Func<string, string, Task>? Handler { get; set; }
|
||||
@@ -6,7 +6,9 @@ using Duende.IdentityModel.OidcClient.Browser;
|
||||
|
||||
namespace ClaudeDo.Ui.Services;
|
||||
|
||||
public sealed class OnlineLoginService : IOnlineLoginService
|
||||
public sealed record OnlineLoginResult(bool Success, string? RefreshToken, string? Error, string? Warning = null);
|
||||
|
||||
public sealed class OnlineLoginService
|
||||
{
|
||||
public async Task<OnlineLoginResult> LoginAsync(
|
||||
string authority, string clientId, string scope, string redirectUri,
|
||||
|
||||
Reference in New Issue
Block a user