feat(settings): persist report excluded paths and standup weekday

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
mika kuns
2026-06-03 09:50:03 +02:00
parent e106b00b16
commit 5b89e3d03f
6 changed files with 45 additions and 4 deletions

View File

@@ -50,6 +50,9 @@ public sealed class AppSettingsRepository
? null : updated.CentralWorktreeRoot; ? null : updated.CentralWorktreeRoot;
row.WorktreeAutoCleanupEnabled = updated.WorktreeAutoCleanupEnabled; row.WorktreeAutoCleanupEnabled = updated.WorktreeAutoCleanupEnabled;
row.WorktreeAutoCleanupDays = updated.WorktreeAutoCleanupDays; row.WorktreeAutoCleanupDays = updated.WorktreeAutoCleanupDays;
row.ReportExcludedPaths = string.IsNullOrWhiteSpace(updated.ReportExcludedPaths)
? null : updated.ReportExcludedPaths;
row.StandupWeekday = updated.StandupWeekday;
await _context.SaveChangesAsync(ct); await _context.SaveChangesAsync(ct);
} }

View File

@@ -494,7 +494,9 @@ public sealed record AppSettingsDto(
string WorktreeStrategy, string WorktreeStrategy,
string? CentralWorktreeRoot, string? CentralWorktreeRoot,
bool WorktreeAutoCleanupEnabled, bool WorktreeAutoCleanupEnabled,
int WorktreeAutoCleanupDays); int WorktreeAutoCleanupDays,
string? ReportExcludedPaths,
int StandupWeekday);
public sealed record WorktreeCleanupDto(int Removed); public sealed record WorktreeCleanupDto(int Removed);
public sealed record WorktreeResetDto(int Removed, int TasksAffected, bool Blocked, int RunningTasks); public sealed record WorktreeResetDto(int Removed, int TasksAffected, bool Blocked, int RunningTasks);

View File

@@ -10,6 +10,10 @@ public sealed partial class GeneralSettingsTabViewModel : ViewModelBase
[ObservableProperty] private int _defaultMaxTurns = 100; [ObservableProperty] private int _defaultMaxTurns = 100;
[ObservableProperty] private string _defaultPermissionMode = PermissionModeRegistry.DefaultMode; [ObservableProperty] private string _defaultPermissionMode = PermissionModeRegistry.DefaultMode;
[ObservableProperty] private int _maxParallelExecutions = 1; [ObservableProperty] private int _maxParallelExecutions = 1;
// Newline-separated path prefixes excluded from the weekly report.
[ObservableProperty] private string _reportExcludedPaths = @"C:\Private";
// 0=Sunday..6=Saturday (System.DayOfWeek); default Wednesday.
[ObservableProperty] private int _standupWeekday = (int)DayOfWeek.Wednesday;
public IReadOnlyList<string> Models { get; } = ModelRegistry.Aliases; public IReadOnlyList<string> Models { get; } = ModelRegistry.Aliases;
public IReadOnlyList<string> PermissionModes { get; } = PermissionModeRegistry.Modes; public IReadOnlyList<string> PermissionModes { get; } = PermissionModeRegistry.Modes;

View File

@@ -1,3 +1,4 @@
using System.Linq;
using ClaudeDo.Data; using ClaudeDo.Data;
using ClaudeDo.Ui.Services; using ClaudeDo.Ui.Services;
using ClaudeDo.Ui.ViewModels.Modals.Settings; using ClaudeDo.Ui.ViewModels.Modals.Settings;
@@ -47,6 +48,11 @@ public sealed partial class SettingsModalViewModel : ViewModelBase
Worktrees.CentralWorktreeRoot = dto.CentralWorktreeRoot; Worktrees.CentralWorktreeRoot = dto.CentralWorktreeRoot;
Worktrees.WorktreeAutoCleanupEnabled = dto.WorktreeAutoCleanupEnabled; Worktrees.WorktreeAutoCleanupEnabled = dto.WorktreeAutoCleanupEnabled;
Worktrees.WorktreeAutoCleanupDays = dto.WorktreeAutoCleanupDays; Worktrees.WorktreeAutoCleanupDays = dto.WorktreeAutoCleanupDays;
General.ReportExcludedPaths = string.IsNullOrWhiteSpace(dto.ReportExcludedPaths)
? @"C:\Private"
: string.Join(Environment.NewLine,
System.Text.Json.JsonSerializer.Deserialize<List<string>>(dto.ReportExcludedPaths) ?? new());
General.StandupWeekday = dto.StandupWeekday == 0 ? (int)DayOfWeek.Wednesday : dto.StandupWeekday;
} }
else StatusMessage = "Worker offline — settings read-only."; else StatusMessage = "Worker offline — settings read-only.";
@@ -74,7 +80,11 @@ public sealed partial class SettingsModalViewModel : ViewModelBase
Worktrees.WorktreeStrategy ?? "sibling", Worktrees.WorktreeStrategy ?? "sibling",
string.IsNullOrWhiteSpace(Worktrees.CentralWorktreeRoot) ? null : Worktrees.CentralWorktreeRoot, string.IsNullOrWhiteSpace(Worktrees.CentralWorktreeRoot) ? null : Worktrees.CentralWorktreeRoot,
Worktrees.WorktreeAutoCleanupEnabled, Worktrees.WorktreeAutoCleanupEnabled,
Worktrees.WorktreeAutoCleanupDays); Worktrees.WorktreeAutoCleanupDays,
System.Text.Json.JsonSerializer.Serialize(
General.ReportExcludedPaths
.Split('\n').Select(l => l.Trim().TrimEnd('\r')).Where(l => l.Length > 0).ToList()),
General.StandupWeekday);
await _worker.UpdateAppSettingsAsync(dto); await _worker.UpdateAppSettingsAsync(dto);
await Prime.SaveAsync(); await Prime.SaveAsync();
CloseAction?.Invoke(); CloseAction?.Invoke();

View File

@@ -78,6 +78,22 @@
<TextBlock Text="How many queued tasks the worker runs at once." <TextBlock Text="How many queued tasks the worker runs at once."
Opacity="0.6" FontSize="12"/> Opacity="0.6" FontSize="12"/>
</StackPanel> </StackPanel>
<StackPanel Spacing="4">
<TextBlock Classes="field-label" Text="Bericht: ausgeschlossene Pfade (einer pro Zeile)"/>
<TextBox AcceptsReturn="True" MinHeight="60" Text="{Binding General.ReportExcludedPaths, Mode=TwoWay}"/>
</StackPanel>
<StackPanel Spacing="4">
<TextBlock Classes="field-label" Text="Standup-Wochentag"/>
<ComboBox SelectedIndex="{Binding General.StandupWeekday, Mode=TwoWay}" HorizontalAlignment="Left">
<ComboBoxItem>Sonntag</ComboBoxItem>
<ComboBoxItem>Montag</ComboBoxItem>
<ComboBoxItem>Dienstag</ComboBoxItem>
<ComboBoxItem>Mittwoch</ComboBoxItem>
<ComboBoxItem>Donnerstag</ComboBoxItem>
<ComboBoxItem>Freitag</ComboBoxItem>
<ComboBoxItem>Samstag</ComboBoxItem>
</ComboBox>
</StackPanel>
</StackPanel> </StackPanel>
</ScrollViewer> </ScrollViewer>
</TabItem> </TabItem>

View File

@@ -29,7 +29,9 @@ public record AppSettingsDto(
string WorktreeStrategy, string WorktreeStrategy,
string? CentralWorktreeRoot, string? CentralWorktreeRoot,
bool WorktreeAutoCleanupEnabled, bool WorktreeAutoCleanupEnabled,
int WorktreeAutoCleanupDays); int WorktreeAutoCleanupDays,
string? ReportExcludedPaths,
int StandupWeekday);
public record WorktreeCleanupDto(int Removed); public record WorktreeCleanupDto(int Removed);
public record WorktreeResetDto(int Removed, int TasksAffected, bool Blocked, int RunningTasks); public record WorktreeResetDto(int Removed, int TasksAffected, bool Blocked, int RunningTasks);
@@ -213,7 +215,9 @@ public sealed class WorkerHub : Microsoft.AspNetCore.SignalR.Hub
row.WorktreeStrategy, row.WorktreeStrategy,
row.CentralWorktreeRoot, row.CentralWorktreeRoot,
row.WorktreeAutoCleanupEnabled, row.WorktreeAutoCleanupEnabled,
row.WorktreeAutoCleanupDays); row.WorktreeAutoCleanupDays,
row.ReportExcludedPaths,
row.StandupWeekday);
} }
public async Task UpdateAppSettings(AppSettingsDto dto) public async Task UpdateAppSettings(AppSettingsDto dto)
@@ -232,6 +236,8 @@ public sealed class WorkerHub : Microsoft.AspNetCore.SignalR.Hub
CentralWorktreeRoot = dto.CentralWorktreeRoot, CentralWorktreeRoot = dto.CentralWorktreeRoot,
WorktreeAutoCleanupEnabled = dto.WorktreeAutoCleanupEnabled, WorktreeAutoCleanupEnabled = dto.WorktreeAutoCleanupEnabled,
WorktreeAutoCleanupDays = dto.WorktreeAutoCleanupDays, WorktreeAutoCleanupDays = dto.WorktreeAutoCleanupDays,
ReportExcludedPaths = dto.ReportExcludedPaths,
StandupWeekday = dto.StandupWeekday == 0 ? (int)DayOfWeek.Wednesday : dto.StandupWeekday,
}); });
} }