feat(settings): persist report excluded paths and standup weekday
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -50,6 +50,9 @@ public sealed class AppSettingsRepository
|
||||
? null : updated.CentralWorktreeRoot;
|
||||
row.WorktreeAutoCleanupEnabled = updated.WorktreeAutoCleanupEnabled;
|
||||
row.WorktreeAutoCleanupDays = updated.WorktreeAutoCleanupDays;
|
||||
row.ReportExcludedPaths = string.IsNullOrWhiteSpace(updated.ReportExcludedPaths)
|
||||
? null : updated.ReportExcludedPaths;
|
||||
row.StandupWeekday = updated.StandupWeekday;
|
||||
|
||||
await _context.SaveChangesAsync(ct);
|
||||
}
|
||||
|
||||
@@ -494,7 +494,9 @@ public sealed record AppSettingsDto(
|
||||
string WorktreeStrategy,
|
||||
string? CentralWorktreeRoot,
|
||||
bool WorktreeAutoCleanupEnabled,
|
||||
int WorktreeAutoCleanupDays);
|
||||
int WorktreeAutoCleanupDays,
|
||||
string? ReportExcludedPaths,
|
||||
int StandupWeekday);
|
||||
|
||||
public sealed record WorktreeCleanupDto(int Removed);
|
||||
public sealed record WorktreeResetDto(int Removed, int TasksAffected, bool Blocked, int RunningTasks);
|
||||
|
||||
@@ -10,6 +10,10 @@ public sealed partial class GeneralSettingsTabViewModel : ViewModelBase
|
||||
[ObservableProperty] private int _defaultMaxTurns = 100;
|
||||
[ObservableProperty] private string _defaultPermissionMode = PermissionModeRegistry.DefaultMode;
|
||||
[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> PermissionModes { get; } = PermissionModeRegistry.Modes;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.Linq;
|
||||
using ClaudeDo.Data;
|
||||
using ClaudeDo.Ui.Services;
|
||||
using ClaudeDo.Ui.ViewModels.Modals.Settings;
|
||||
@@ -47,6 +48,11 @@ public sealed partial class SettingsModalViewModel : ViewModelBase
|
||||
Worktrees.CentralWorktreeRoot = dto.CentralWorktreeRoot;
|
||||
Worktrees.WorktreeAutoCleanupEnabled = dto.WorktreeAutoCleanupEnabled;
|
||||
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.";
|
||||
|
||||
@@ -74,7 +80,11 @@ public sealed partial class SettingsModalViewModel : ViewModelBase
|
||||
Worktrees.WorktreeStrategy ?? "sibling",
|
||||
string.IsNullOrWhiteSpace(Worktrees.CentralWorktreeRoot) ? null : Worktrees.CentralWorktreeRoot,
|
||||
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 Prime.SaveAsync();
|
||||
CloseAction?.Invoke();
|
||||
|
||||
@@ -78,6 +78,22 @@
|
||||
<TextBlock Text="How many queued tasks the worker runs at once."
|
||||
Opacity="0.6" FontSize="12"/>
|
||||
</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>
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
|
||||
@@ -29,7 +29,9 @@ public record AppSettingsDto(
|
||||
string WorktreeStrategy,
|
||||
string? CentralWorktreeRoot,
|
||||
bool WorktreeAutoCleanupEnabled,
|
||||
int WorktreeAutoCleanupDays);
|
||||
int WorktreeAutoCleanupDays,
|
||||
string? ReportExcludedPaths,
|
||||
int StandupWeekday);
|
||||
|
||||
public record WorktreeCleanupDto(int Removed);
|
||||
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.CentralWorktreeRoot,
|
||||
row.WorktreeAutoCleanupEnabled,
|
||||
row.WorktreeAutoCleanupDays);
|
||||
row.WorktreeAutoCleanupDays,
|
||||
row.ReportExcludedPaths,
|
||||
row.StandupWeekday);
|
||||
}
|
||||
|
||||
public async Task UpdateAppSettings(AppSettingsDto dto)
|
||||
@@ -232,6 +236,8 @@ public sealed class WorkerHub : Microsoft.AspNetCore.SignalR.Hub
|
||||
CentralWorktreeRoot = dto.CentralWorktreeRoot,
|
||||
WorktreeAutoCleanupEnabled = dto.WorktreeAutoCleanupEnabled,
|
||||
WorktreeAutoCleanupDays = dto.WorktreeAutoCleanupDays,
|
||||
ReportExcludedPaths = dto.ReportExcludedPaths,
|
||||
StandupWeekday = dto.StandupWeekday == 0 ? (int)DayOfWeek.Wednesday : dto.StandupWeekday,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user