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.
44 lines
2.2 KiB
C#
44 lines
2.2 KiB
C#
using System.Threading.Tasks;
|
|
using ClaudeDo.Ui.ViewModels;
|
|
using ClaudeDo.Ui.ViewModels.Conflicts;
|
|
using ClaudeDo.Ui.ViewModels.Modals;
|
|
|
|
namespace ClaudeDo.Ui.Services;
|
|
|
|
/// <summary>
|
|
/// Single seam for opening modal dialogs. Replaces the per-modal <c>Show*Modal</c>
|
|
/// Func callbacks that were previously wired separately on the shell and the lists
|
|
/// island (and the Confirm/Error dialogs duplicated in both code-behinds). The view
|
|
/// layer supplies the implementation (<see cref="ClaudeDo.Ui.Views.WindowDialogService"/>);
|
|
/// callers build + initialize the VM and hand it here to be shown.
|
|
/// </summary>
|
|
public interface IDialogService
|
|
{
|
|
Task ShowAboutAsync(AboutModalViewModel vm);
|
|
Task ShowWeeklyReportAsync(WeeklyReportModalViewModel vm);
|
|
Task ShowUsageMonitorAsync(UsageMonitorModalViewModel vm);
|
|
Task ShowSettingsAsync(SettingsModalViewModel vm);
|
|
Task ShowListSettingsAsync(ListSettingsModalViewModel vm);
|
|
Task ShowRepoImportAsync(RepoImportModalViewModel vm);
|
|
Task ShowWorktreesOverviewAsync(WorktreesOverviewModalViewModel vm);
|
|
|
|
/// <summary>Merge-helper task picker. Returns the ordered selected task ids, or null on cancel.</summary>
|
|
Task<IReadOnlyList<string>?> ShowMergeHelperSelectionAsync(MergeHelperSelectionModalViewModel vm);
|
|
Task ShowWorkerConnectionAsync(WorkerConnectionModalViewModel vm);
|
|
Task ShowConflictResolverAsync(ConflictResolverViewModel vm);
|
|
Task ShowLogVisualizerAsync(LogVisualizerViewModel vm);
|
|
|
|
/// <summary>Modal yes/no confirmation. Returns true only when confirmed. <paramref name="confirmLabel"/>
|
|
/// overrides the default localized "Confirm" button text (e.g. a localized "Delete" for destructive actions).</summary>
|
|
Task<bool> ConfirmAsync(string message, string? confirmLabel = null);
|
|
|
|
/// <summary>Modal error notice with a single dismiss button.</summary>
|
|
Task ShowErrorAsync(string message);
|
|
|
|
/// <summary>Show (or re-show + focus) the modeless Mission Control window. Lazily created; hides on close.</summary>
|
|
void ShowMissionControl(MissionControlViewModel vm);
|
|
|
|
/// <summary>Show (or re-show + focus) the modeless cheat-sheet window for the shell's shared VM.</summary>
|
|
void ShowCheatSheets(CheatSheetsViewModel vm);
|
|
}
|