refactor(agent-config): single AgentConfigEditor for list + task scopes

This commit is contained in:
Mika Kuns
2026-06-23 08:52:49 +02:00
parent 60eb671e8f
commit eb0ddb56d3
14 changed files with 761 additions and 482 deletions

View File

@@ -9,6 +9,7 @@ using ClaudeDo.Ui.Helpers;
using ClaudeDo.Ui.Localization;
using ClaudeDo.Ui.Services;
using ClaudeDo.Ui.Services.Interfaces;
using ClaudeDo.Ui.ViewModels.Agent;
using ClaudeDo.Ui.ViewModels.Modals;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
@@ -56,7 +57,7 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase, IDisposable
private readonly IMergeCoordinator _merge;
// ── Section view models ───────────────────────────────────────────────────
public AgentSettingsSectionViewModel AgentSettings { get; }
public AgentConfigEditorViewModel AgentSettings { get; }
public MergeSectionViewModel Merge { get; }
public PrepPanelViewModel Prep { get; }
@@ -425,7 +426,7 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase, IDisposable
_notesApi = notesApi;
_merge = merge;
AgentSettings = new AgentSettingsSectionViewModel(worker);
AgentSettings = new AgentConfigEditorViewModel(worker, AgentConfigScope.Task);
Merge = new MergeSectionViewModel(worker, services);
Prep = new PrepPanelViewModel(worker);
@@ -436,7 +437,7 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase, IDisposable
AgentSettings.PropertyChanged += (_, e) =>
{
if (e.PropertyName == nameof(AgentSettingsSectionViewModel.EffectiveMaxTurns))
if (e.PropertyName == nameof(AgentConfigEditorViewModel.EffectiveMaxTurns))
OnPropertyChanged(nameof(TurnsText));
};
@@ -685,8 +686,7 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase, IDisposable
Merge.SyncWorktree(WorktreePath, WorktreeBaseCommit, WorktreeHeadCommit,
WorktreeStateLabel, _listWorkingDir);
AgentSettings.TaskId = row.Id;
await AgentSettings.LoadAsync(entity, ct);
await AgentSettings.LoadForTaskAsync(entity, ct);
ct.ThrowIfCancellationRequested();
var runRepo = new TaskRunRepository(ctx);