fix(ui): duplizierter Confirm-Dialog mit "Delete"-Knopf – zusammenfuehren und lokalisieren
F4: DetailsIslandView/TasksIslandView hatten je eine view-lokale Confirm/Error-Dialog-Kopie, teils mit hartkodiertem "Delete"-Knopf fuer jede Aktion (inkl. der Stash+Merge-Bestaetigung, die nichts loescht). Beide Kopien entfernt; DetailsIslandViewModel/TasksIslandViewModel routen Confirm/Error jetzt durch den geteilten Dialogs-Seam (IDialogService, propagiert vom Shell wie schon bei Lists/Tasks) statt ueber eine vom Code-behind gesetzte Func-Property. IDialogService.ConfirmAsync bekommt einen optionalen confirmLabel-Parameter (Default: lokalisiertes "Confirm"); nur die echten Delete-Aktionen (Task loeschen, abgeschlossene Tasks leeren) uebergeben das lokalisierte "Delete"-Label. F5: "Cancel"/"Confirm"/"Delete"/"OK" und die Titel "Confirm"/"Error" durch Loc.T mit neuen Keys unter "dialog.*" ersetzt (en.json + de.json). Mission Controls eigene Dialog-Kopie bleibt bestehen (eigenes Fenster, WindowDialogService ist an den Haupt-Owner gebunden) — nur ihre Labels wurden lokalisiert. Out of scope (siehe Task-Beschreibung): die Nachrichtentexte der Dialoge bleiben unlokalisiert.
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
using ClaudeDo.Data;
|
||||
using ClaudeDo.Ui.Services;
|
||||
using ClaudeDo.Ui.Services.Interfaces;
|
||||
using ClaudeDo.Ui.ViewModels;
|
||||
using ClaudeDo.Ui.ViewModels.Conflicts;
|
||||
using ClaudeDo.Ui.ViewModels.Modals;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace ClaudeDo.Ui.Tests;
|
||||
@@ -31,3 +34,43 @@ public sealed class StubNotesApi : INotesApi
|
||||
|
||||
/// <summary><see cref="StubWorkerClient"/> is abstract — this is the concrete no-op subclass.</summary>
|
||||
public sealed class DefaultStub : StubWorkerClient { }
|
||||
|
||||
/// <summary>
|
||||
/// Records the message/label of the last Confirm/Error call and returns a configurable
|
||||
/// Confirm result. Covers the ViewModels (DetailsIsland, TasksIsland, ...) that take their
|
||||
/// dialog seam via a settable <c>Dialogs</c> property instead of a per-call constructor arg.
|
||||
/// </summary>
|
||||
public sealed class RecordingDialogService : IDialogService
|
||||
{
|
||||
public bool ConfirmResult { get; set; } = true;
|
||||
public string? LastConfirmMessage { get; private set; }
|
||||
public string? LastConfirmLabel { get; private set; }
|
||||
public string? LastErrorMessage { get; private set; }
|
||||
|
||||
public Task<bool> ConfirmAsync(string message, string? confirmLabel = null)
|
||||
{
|
||||
LastConfirmMessage = message;
|
||||
LastConfirmLabel = confirmLabel;
|
||||
return Task.FromResult(ConfirmResult);
|
||||
}
|
||||
|
||||
public Task ShowErrorAsync(string message)
|
||||
{
|
||||
LastErrorMessage = message;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public Task ShowAboutAsync(AboutModalViewModel vm) => throw new NotImplementedException();
|
||||
public Task ShowWeeklyReportAsync(WeeklyReportModalViewModel vm) => throw new NotImplementedException();
|
||||
public Task ShowUsageMonitorAsync(UsageMonitorModalViewModel vm) => throw new NotImplementedException();
|
||||
public Task ShowSettingsAsync(SettingsModalViewModel vm) => throw new NotImplementedException();
|
||||
public Task ShowListSettingsAsync(ListSettingsModalViewModel vm) => throw new NotImplementedException();
|
||||
public Task ShowRepoImportAsync(RepoImportModalViewModel vm) => throw new NotImplementedException();
|
||||
public Task ShowWorktreesOverviewAsync(WorktreesOverviewModalViewModel vm) => throw new NotImplementedException();
|
||||
public Task<IReadOnlyList<string>?> ShowMergeHelperSelectionAsync(MergeHelperSelectionModalViewModel vm) => throw new NotImplementedException();
|
||||
public Task ShowWorkerConnectionAsync(WorkerConnectionModalViewModel vm) => throw new NotImplementedException();
|
||||
public Task ShowConflictResolverAsync(ConflictResolverViewModel vm) => throw new NotImplementedException();
|
||||
public Task ShowLogVisualizerAsync(LogVisualizerViewModel vm) => throw new NotImplementedException();
|
||||
public void ShowMissionControl(MissionControlViewModel vm) => throw new NotImplementedException();
|
||||
public void ShowCheatSheets(CheatSheetsViewModel vm) => throw new NotImplementedException();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user