feat(daily-prep): add RunDailyPrepNow hub method and expose DailyPrepMaxTasks
This commit is contained in:
@@ -52,6 +52,7 @@ public interface IWorkerClient : INotifyPropertyChanged
|
||||
Task QueuePlanningSubtasksAsync(string parentTaskId, CancellationToken ct = default);
|
||||
Task<string?> GetWeekReportAsync(DateOnly start, DateOnly end);
|
||||
Task<string> GenerateWeekReportAsync(DateOnly start, DateOnly end);
|
||||
Task<bool> RunDailyPrepNowAsync();
|
||||
Task<AppSettingsDto?> GetAppSettingsAsync();
|
||||
Task<List<DailyNoteDto>> GetDailyNotesAsync(DateOnly day);
|
||||
Task<DailyNoteDto?> AddDailyNoteAsync(DateOnly day, string text);
|
||||
|
||||
@@ -334,6 +334,9 @@ public partial class WorkerClient : ObservableObject, IAsyncDisposable, IWorkerC
|
||||
public Task<string> GenerateWeekReportAsync(DateOnly start, DateOnly end)
|
||||
=> _hub.InvokeAsync<string>("GenerateWeekReport", IsoDay(start), IsoDay(end));
|
||||
|
||||
public Task<bool> RunDailyPrepNowAsync()
|
||||
=> _hub.InvokeAsync<bool>("RunDailyPrepNow");
|
||||
|
||||
public async Task<List<DailyNoteDto>> GetDailyNotesAsync(DateOnly day)
|
||||
=> await TryInvokeAsync<List<DailyNoteDto>>("GetDailyNotes", IsoDay(day)) ?? new List<DailyNoteDto>();
|
||||
|
||||
@@ -496,7 +499,8 @@ public sealed record AppSettingsDto(
|
||||
bool WorktreeAutoCleanupEnabled,
|
||||
int WorktreeAutoCleanupDays,
|
||||
string? ReportExcludedPaths,
|
||||
int StandupWeekday);
|
||||
int StandupWeekday,
|
||||
int DailyPrepMaxTasks);
|
||||
|
||||
public sealed record WorktreeCleanupDto(int Removed);
|
||||
public sealed record WorktreeResetDto(int Removed, int TasksAffected, bool Blocked, int RunningTasks);
|
||||
|
||||
@@ -22,6 +22,8 @@ public sealed partial class SettingsModalViewModel : ViewModelBase
|
||||
[ObservableProperty] private bool _isBusy;
|
||||
[ObservableProperty] private string _statusMessage = "";
|
||||
|
||||
private int _loadedDailyPrepMaxTasks = 5;
|
||||
|
||||
public Action? CloseAction { get; set; }
|
||||
|
||||
public SettingsModalViewModel(WorkerClient worker, PrimeClaudeTabViewModel prime,
|
||||
@@ -60,6 +62,7 @@ public sealed partial class SettingsModalViewModel : ViewModelBase
|
||||
: string.Join(Environment.NewLine,
|
||||
System.Text.Json.JsonSerializer.Deserialize<List<string>>(dto.ReportExcludedPaths) ?? new());
|
||||
General.StandupWeekday = dto.StandupWeekday is >= 0 and <= 6 ? dto.StandupWeekday : (int)DayOfWeek.Wednesday;
|
||||
_loadedDailyPrepMaxTasks = dto.DailyPrepMaxTasks < 1 ? 5 : dto.DailyPrepMaxTasks;
|
||||
}
|
||||
else StatusMessage = Loc.T("vm.settingsModal.workerOffline");
|
||||
|
||||
@@ -91,7 +94,8 @@ public sealed partial class SettingsModalViewModel : ViewModelBase
|
||||
System.Text.Json.JsonSerializer.Serialize(
|
||||
General.ReportExcludedPaths
|
||||
.Split('\n').Select(l => l.Trim().TrimEnd('\r')).Where(l => l.Length > 0).ToList()),
|
||||
General.StandupWeekday);
|
||||
General.StandupWeekday,
|
||||
_loadedDailyPrepMaxTasks);
|
||||
await _worker.UpdateAppSettingsAsync(dto);
|
||||
await Prime.SaveAsync();
|
||||
CloseAction?.Invoke();
|
||||
|
||||
Reference in New Issue
Block a user