chore(claude-do): [A3] Settings + Update-Check: OperationStatus für Skill-Inst

Vorgaben: `docs/superpowers/plans/2026-08-11-operation-feedback.md`, Gruppe A, Entwurf A3. P0-1 ist gemergt: `src/ClaudeDo.Ui/Services/OperationStatus.cs` + `src/ClaudeDo.Ui/Views/Controls/OperationIndicator.axaml`.

SCOPE-ÄNDERUNG (Nutzer, 2026-08-12): OnlineInbox Sign-In/Sign-Out ist AUS DEM SCOPE GENOMMEN — vorerst unwichtig. `ViewModels/Modals/Settings/OnlineInboxSettingsViewModel.cs` und die

ClaudeDo-Task: 2356806f-f16e-4652-b615-4562e95c3a65
This commit is contained in:
Mika Kuns
2026-08-12 09:55:04 +02:00
parent 5fca459579
commit ec4cbcbaf9
12 changed files with 201 additions and 54 deletions
@@ -33,6 +33,8 @@ public sealed partial class RepoImportModalViewModel : ViewModelBase
private readonly HashSet<string> _existingDirs = new(StringComparer.OrdinalIgnoreCase);
private readonly List<string> _folders = new();
public OperationStatus ScanOp { get; } = new();
public ObservableCollection<RepoImportItemViewModel> Repos { get; } = new();
public Action? CloseAction { get; set; }
@@ -96,6 +98,7 @@ public sealed partial class RepoImportModalViewModel : ViewModelBase
private async Task ScanAndAddAsync(IEnumerable<string> folders)
{
using var op = ScanOp.Begin(Loc.T("ops.repoImport.scanning"));
var current = new HashSet<string>(
Repos.Select(r => r.FullPath), StringComparer.OrdinalIgnoreCase);
@@ -11,8 +11,9 @@ public sealed partial class FilesSettingsTabViewModel : ViewModelBase
{
private readonly IWorkerClient _worker;
public OperationStatus RestoreOp { get; } = new();
[ObservableProperty] private string _statusMessage = "";
[ObservableProperty] private bool _isBusy;
[ObservableProperty] private bool _hasCustomizedPrompts;
[ObservableProperty] private string? _viewedKindName;
[ObservableProperty] private string _viewedContent = "";
@@ -30,12 +31,19 @@ public sealed partial class FilesSettingsTabViewModel : ViewModelBase
{
_worker = worker;
RefreshCustomizedPrompts();
RestoreOp.PropertyChanged += (_, e) =>
{
if (e.PropertyName == nameof(OperationStatus.IsRunning)) RestoreDefaultAgentsCommand.NotifyCanExecuteChanged();
};
}
[RelayCommand]
private bool CanRestoreDefaultAgents() => !RestoreOp.IsRunning;
[RelayCommand(CanExecute = nameof(CanRestoreDefaultAgents))]
private async Task RestoreDefaultAgents()
{
IsBusy = true; StatusMessage = "";
StatusMessage = "";
using var op = RestoreOp.Begin(Loc.T("ops.skills.restoringDefaults"));
try
{
var r = await _worker.RestoreDefaultAgentsAsync();
@@ -46,7 +54,6 @@ public sealed partial class FilesSettingsTabViewModel : ViewModelBase
await _worker.RefreshAgentsAsync();
}
catch (Exception ex) { StatusMessage = Loc.T("vm.filesTab.restoreFailed", ex.Message); }
finally { IsBusy = false; }
}
[RelayCommand]
@@ -10,6 +10,9 @@ public sealed partial class SessionSkillsSettingsTabViewModel : ViewModelBase
{
private readonly IWorkerClient _worker;
public OperationStatus InstallOp { get; } = new();
public OperationStatus UpdateOp { get; } = new();
[ObservableProperty] private string _installUrl = "";
[ObservableProperty] private string _statusMessage = "";
[ObservableProperty] private bool _isBusy;
@@ -17,7 +20,18 @@ public sealed partial class SessionSkillsSettingsTabViewModel : ViewModelBase
public ObservableCollection<SessionSkillDto> Skills { get; } = new();
public SessionSkillsSettingsTabViewModel(IWorkerClient worker) => _worker = worker;
public SessionSkillsSettingsTabViewModel(IWorkerClient worker)
{
_worker = worker;
InstallOp.PropertyChanged += (_, e) =>
{
if (e.PropertyName == nameof(OperationStatus.IsRunning)) InstallCommand.NotifyCanExecuteChanged();
};
UpdateOp.PropertyChanged += (_, e) =>
{
if (e.PropertyName == nameof(OperationStatus.IsRunning)) UpdateCommand.NotifyCanExecuteChanged();
};
}
public async Task LoadAsync()
{
@@ -32,11 +46,14 @@ public sealed partial class SessionSkillsSettingsTabViewModel : ViewModelBase
finally { IsBusy = false; }
}
[RelayCommand]
private bool CanInstall() => !InstallOp.IsRunning;
[RelayCommand(CanExecute = nameof(CanInstall))]
private async Task InstallAsync()
{
if (string.IsNullOrWhiteSpace(InstallUrl)) return;
IsBusy = true; StatusMessage = "";
StatusMessage = "";
using var op = InstallOp.Begin(Loc.T("ops.skills.installing"));
try
{
var installed = await _worker.InstallSessionSkillAsync(InstallUrl.Trim());
@@ -45,14 +62,16 @@ public sealed partial class SessionSkillsSettingsTabViewModel : ViewModelBase
await LoadAsync();
}
catch (Exception ex) { StatusMessage = Loc.T("vm.sessionSkillsTab.installFailed", ex.Message); }
finally { IsBusy = false; }
}
[RelayCommand]
private bool CanUpdate(string? sourceUrl) => !UpdateOp.IsRunning;
[RelayCommand(CanExecute = nameof(CanUpdate))]
private async Task UpdateAsync(string? sourceUrl)
{
if (string.IsNullOrWhiteSpace(sourceUrl)) return;
IsBusy = true; StatusMessage = "";
StatusMessage = "";
using var op = UpdateOp.Begin(Loc.T("ops.skills.updating"));
try
{
await _worker.UpdateSessionSkillAsync(sourceUrl);
@@ -60,7 +79,6 @@ public sealed partial class SessionSkillsSettingsTabViewModel : ViewModelBase
await LoadAsync();
}
catch (Exception ex) { StatusMessage = Loc.T("vm.sessionSkillsTab.updateFailed", ex.Message); }
finally { IsBusy = false; }
}
[RelayCommand]