chore(claude-do): RepoImportFolders auf den WorkerHub-Pfad umziehen (Ui schrei

## Befund (am Code verifiziert 2026-08-06)

`AppSettingsEntity.RepoImportFolders` (`src/ClaudeDo.Data/Models/AppSettingsEntity.cs:26`, JSON-Array als TEXT) ist **nicht** Teil des `AppSettingsDto` in `src/ClaudeDo.Worker/Hub/WorkerHub.cs:32-49` und wird weder von `GetAppSettings` (~:375-393) noch von `UpdateAppSettings` (~:396-424) transportiert.

Stattdessen liest und schreibt die Ui das Feld dire

ClaudeDo-Task: 64fbe15d-ae7e-4d81-b8c1-045baa7e3c87
This commit is contained in:
mika kuns
2026-08-06 11:18:00 +02:00
parent cfd2936c25
commit 75561930d7
12 changed files with 245 additions and 8 deletions
+2 -1
View File
@@ -676,7 +676,8 @@
"worktreesOverview": { "titleAll": "Worktrees", "titleList": "Worktrees — {0}", "listFallback": "Liste", "cleanupFailed": "Aufräumen fehlgeschlagen.", "cleanupFailedDetailed": "Aufräumen fehlgeschlagen: {0}", "removed": "{0} Worktree(s) entfernt.", "discardFailed": "Worktree konnte nicht verworfen werden.", "keepFailed": "Worktree konnte nicht behalten werden.", "cannotForceRunning": "Eine laufende Aufgabe kann nicht zwangsweise entfernt werden.", "forceRemoveFailed": "Zwangsentfernung fehlgeschlagen.", "forceRemoveFailedDetailed": "Zwangsentfernung fehlgeschlagen: {0}", "batchProgress": "Merge {0}/{1}…", "batchDone": "{0} gemergt, {1} zu lösen." },
"listSettings": { "untitled": "Unbenannt" },
"detailsIsland": { "verifyFailed": "Merge ist erfolgt, aber das Verifikationskommando der Liste ist fehlgeschlagen — die Aufgabe wurde nicht auf 'Erledigt' gesetzt." },
"lists": { "localSuffix": "{0} / lokal", "smartMyDay": "Mein Tag", "smartImportant": "Wichtig", "smartPlanned": "Geplant", "virtualQueue": "Warteschlange", "virtualRunning": "Läuft", "virtualReview": "Prüfung", "newList": "Neue Liste" }
"lists": { "localSuffix": "{0} / lokal", "smartMyDay": "Mein Tag", "smartImportant": "Wichtig", "smartPlanned": "Geplant", "virtualQueue": "Warteschlange", "virtualRunning": "Läuft", "virtualReview": "Prüfung", "newList": "Neue Liste" },
"repoImport": { "loadFailed": "Gespeicherte Ordner konnten nicht geladen werden: {0}", "saveFailed": "Ordner konnten nicht gespeichert werden: {0}" }
},
"usage": {
"pill": {
+2 -1
View File
@@ -676,7 +676,8 @@
"worktreesOverview": { "titleAll": "Worktrees", "titleList": "Worktrees — {0}", "listFallback": "list", "cleanupFailed": "Cleanup failed.", "cleanupFailedDetailed": "Cleanup failed: {0}", "removed": "Removed {0} worktree(s).", "discardFailed": "Failed to discard worktree.", "keepFailed": "Failed to keep worktree.", "cannotForceRunning": "Cannot force-remove a running task.", "forceRemoveFailed": "Force remove failed.", "forceRemoveFailedDetailed": "Force remove failed: {0}", "batchProgress": "Merging {0}/{1}…", "batchDone": "Merged {0}, {1} need resolution." },
"listSettings": { "untitled": "Untitled" },
"detailsIsland": { "verifyFailed": "Merge landed, but the list's verify command failed — the task was kept out of Done." },
"lists": { "localSuffix": "{0} / local", "smartMyDay": "My Day", "smartImportant": "Important", "smartPlanned": "Planned", "virtualQueue": "Queue", "virtualRunning": "Running", "virtualReview": "Review", "newList": "New list" }
"lists": { "localSuffix": "{0} / local", "smartMyDay": "My Day", "smartImportant": "Important", "smartPlanned": "Planned", "virtualQueue": "Queue", "virtualRunning": "Running", "virtualReview": "Review", "newList": "New list" },
"repoImport": { "loadFailed": "Couldn't load remembered folders: {0}", "saveFailed": "Couldn't save folders: {0}" }
},
"usage": {
"pill": {
@@ -59,6 +59,11 @@ public interface IWorkerClient : INotifyPropertyChanged
Task<SeedResultDto?> RestoreDefaultAgentsAsync();
Task<ListConfigDto?> GetListConfigAsync(string listId);
Task UpdateTaskAgentSettingsAsync(UpdateTaskAgentSettingsDto dto);
/// <summary>Repo-import folders remembered for the "Add repos as lists" dialog. Throws on
/// a failed hub call — the caller surfaces the failure rather than showing an empty list.</summary>
Task<List<string>> GetRepoImportFoldersAsync();
/// <summary>Persists the repo-import folder list. Throws on a failed hub call.</summary>
Task SetRepoImportFoldersAsync(List<string> folders);
Task<List<SessionSkillDto>> GetSessionSkillsAsync();
Task<List<string>> InstallSessionSkillAsync(string url);
Task UpdateSessionSkillAsync(string sourceUrl);
+6
View File
@@ -444,6 +444,12 @@ public partial class WorkerClient : ObservableObject, IAsyncDisposable, IWorkerC
await _hub.InvokeAsync("UpdateTaskAgentSettings", dto);
}
public async Task<List<string>> GetRepoImportFoldersAsync()
=> await _hub.InvokeAsync<List<string>>("GetRepoImportFolders");
public Task SetRepoImportFoldersAsync(List<string> folders)
=> _hub.InvokeAsync("SetRepoImportFolders", folders);
public async Task<List<SessionSkillDto>> GetSessionSkillsAsync()
=> await TryInvokeAsync<List<SessionSkillDto>>("GetSessionSkills") ?? [];
@@ -30,6 +30,9 @@ public sealed partial class ListsIslandViewModel : ViewModelBase, IDisposable
public event EventHandler? FocusSearchRequested;
public void RequestFocusSearch() => FocusSearchRequested?.Invoke(this, EventArgs.Empty);
// mirrors TasksIslandViewModel.ErrorReported — surfaces modal-owned failures in the footer strip.
public event Action<string>? ErrorReported;
public IDialogService? Dialogs { get; set; }
[RelayCommand]
@@ -58,6 +61,7 @@ public sealed partial class ListsIslandViewModel : ViewModelBase, IDisposable
{
if (Dialogs is null || _services is null) return;
var vm = _services.GetRequiredService<RepoImportModalViewModel>();
vm.ErrorReported += msg => ErrorReported?.Invoke(msg);
await vm.LoadAsync();
await Dialogs.ShowRepoImportAsync(vm);
await LoadAsync();
@@ -237,6 +237,7 @@ public sealed partial class IslandsShellViewModel : ViewModelBase, IDisposable
Tasks.NotesRequested += () => Details.ShowNotes();
Tasks.PrepRequested += () => Details.ShowPrep();
Tasks.ErrorReported += FlashFooterError;
Lists.ErrorReported += FlashFooterError;
Tasks.OpenConPtySessionRequested += taskId =>
{
OpenMissionControl();
@@ -3,6 +3,7 @@ using System.ComponentModel;
using ClaudeDo.Data;
using ClaudeDo.Data.Models;
using ClaudeDo.Data.Repositories;
using ClaudeDo.Ui.Localization;
using ClaudeDo.Ui.Services;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
@@ -28,12 +29,14 @@ public sealed partial class RepoImportItemViewModel : ViewModelBase
public sealed partial class RepoImportModalViewModel : ViewModelBase
{
private readonly IDbContextFactory<ClaudeDoDbContext> _dbFactory;
private readonly IWorkerClient _workerClient;
private readonly HashSet<string> _existingDirs = new(StringComparer.OrdinalIgnoreCase);
private readonly List<string> _folders = new();
public ObservableCollection<RepoImportItemViewModel> Repos { get; } = new();
public Action? CloseAction { get; set; }
public event Action<string>? ErrorReported;
[ObservableProperty] private string _searchText = "";
@@ -42,9 +45,10 @@ public sealed partial class RepoImportModalViewModel : ViewModelBase
public string CreateButtonText => $"Create {CreateCount} list(s)";
public bool HasFolders => _folders.Count > 0;
public RepoImportModalViewModel(IDbContextFactory<ClaudeDoDbContext> dbFactory)
public RepoImportModalViewModel(IDbContextFactory<ClaudeDoDbContext> dbFactory, IWorkerClient workerClient)
{
_dbFactory = dbFactory;
_workerClient = workerClient;
}
public async Task LoadAsync(CancellationToken ct = default)
@@ -61,9 +65,15 @@ public sealed partial class RepoImportModalViewModel : ViewModelBase
_existingDirs.Add(l.WorkingDir!);
}
var settings = new AppSettingsRepository(ctx);
foreach (var f in await settings.GetRepoImportFoldersAsync(ct))
AddFolderToSet(f);
try
{
foreach (var f in await _workerClient.GetRepoImportFoldersAsync())
AddFolderToSet(f);
}
catch (Exception ex)
{
ErrorReported?.Invoke(Loc.T("vm.repoImport.loadFailed", ex.Message));
}
ScanAndAdd(_folders);
OnPropertyChanged(nameof(HasFolders));
@@ -155,8 +165,14 @@ public sealed partial class RepoImportModalViewModel : ViewModelBase
private async Task SaveFoldersAsync()
{
await using var ctx = await _dbFactory.CreateDbContextAsync();
await new AppSettingsRepository(ctx).SetRepoImportFoldersAsync(_folders);
try
{
await _workerClient.SetRepoImportFoldersAsync(_folders);
}
catch (Exception ex)
{
ErrorReported?.Invoke(Loc.T("vm.repoImport.saveFailed", ex.Message));
}
}
private void ClearRepos()
+12
View File
@@ -424,6 +424,18 @@ public sealed class WorkerHub : Microsoft.AspNetCore.SignalR.Hub
});
}
public async Task<List<string>> GetRepoImportFolders()
{
using var ctx = _dbFactory.CreateDbContext();
return await new AppSettingsRepository(ctx).GetRepoImportFoldersAsync(Context.ConnectionAborted);
}
public async Task SetRepoImportFolders(List<string> folders)
{
using var ctx = _dbFactory.CreateDbContext();
await new AppSettingsRepository(ctx).SetRepoImportFoldersAsync(folders ?? new List<string>(), Context.ConnectionAborted);
}
public async Task<List<SessionSkillDto>> GetSessionSkills()
{
var rows = await _skillRegistry.ListAsync(Context.ConnectionAborted);