Compare commits
69 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
00ef11ac33 | ||
|
|
312b411654 | ||
|
|
364a037cb3 | ||
|
|
2fbf054a57 | ||
|
|
350a89f364 | ||
|
|
086c6f6c45 | ||
|
|
070f5de1b1 | ||
|
|
f529a5ff22 | ||
|
|
6a85d82fcf | ||
|
|
35ad1715d3 | ||
|
|
3c40bb5ea3 | ||
|
|
d95d55e6b8 | ||
|
|
d22b50e171 | ||
|
|
a83a0c41e8 | ||
|
|
9efde2bf88 | ||
|
|
8dc8b8ba8e | ||
|
|
baeea9c2a7 | ||
|
|
a935bf9664 | ||
|
|
2d55f88a41 | ||
|
|
a8d8a8bd65 | ||
|
|
0bc3d2a6c4 | ||
|
|
b886d58c07 | ||
|
|
a8943a9f7a | ||
|
|
eccd06e182 | ||
|
|
731c291d61 | ||
|
|
c8b5ed3912 | ||
|
|
9bf44da13b | ||
|
|
b748c1569e | ||
|
|
74fc39f1a6 | ||
|
|
ccd2ee2cc7 | ||
|
|
5b89e3d03f | ||
|
|
e106b00b16 | ||
|
|
d7558ef451 | ||
|
|
4aa4353d11 | ||
|
|
50d84f12c9 | ||
|
|
e2271b5a50 | ||
|
|
bec87b3d6f | ||
|
|
4cb7ad8dfa | ||
|
|
992fbf0763 | ||
|
|
1d7b86dbef | ||
|
|
036586e736 | ||
|
|
d9e5d2600b | ||
|
|
10d86b4bd6 | ||
|
|
f72cfae7d9 | ||
|
|
e5a2ed250d | ||
|
|
536d819328 | ||
|
|
869cf72abe | ||
|
|
f1715a34fa | ||
|
|
26998f05ff | ||
|
|
7db8f213d8 | ||
|
|
37738e3c8f | ||
|
|
81fd186fb2 | ||
|
|
3127930454 | ||
|
|
bed4255a5e | ||
|
|
dff06d9e35 | ||
|
|
0efad7a004 | ||
|
|
eaf27e8b3a | ||
|
|
13c3393e3a | ||
|
|
4704a28e5d | ||
|
|
1cb5171fba | ||
|
|
4684a0af76 | ||
|
|
6c27ffbdca | ||
|
|
21f1cf2a85 | ||
|
|
c88ed9d5eb | ||
|
|
9c1f20f2d9 | ||
|
|
e8d018dd54 | ||
|
|
1ca32a6bdd | ||
|
|
b86677d554 | ||
|
|
3e072fae66 |
@@ -35,7 +35,7 @@ Two-process system communicating over SignalR (`127.0.0.1:47821`):
|
||||
- EF Core migrations manage schema (Migrations/ folder in ClaudeDo.Data)
|
||||
- `IDbContextFactory<ClaudeDoDbContext>` used by singleton consumers (e.g. Worker)
|
||||
- Entity configuration via `IEntityTypeConfiguration<T>` in Configuration/ folder
|
||||
- Task status flow: Idle | Queued -> Running -> Done | Failed | Cancelled
|
||||
- Task status flow: Idle | Queued -> Running -> WaitingForReview -> Done | Failed | Cancelled. A standalone task's successful run lands in WaitingForReview (planning children go straight to Done); from review you can approve (Done), reject-rerun (Queued, resumes the session with feedback), reject-park (Idle), or cancel (Cancelled).
|
||||
- Worktree state flow: Active -> Merged | Discarded | Kept
|
||||
- The queue picker claims tasks by `Status=Queued` (with `BlockedByTaskId IS NULL`); the legacy tag system was removed
|
||||
- Interfaces live in an `Interfaces/` subfolder beside their consumers (namespace unchanged)
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<Project Path="src/ClaudeDo.Worker/ClaudeDo.Worker.csproj" />
|
||||
<Project Path="src/ClaudeDo.Installer/ClaudeDo.Installer.csproj" />
|
||||
<Project Path="src/ClaudeDo.Releases/ClaudeDo.Releases.csproj" />
|
||||
<Project Path="src/ClaudeDo.Localization/ClaudeDo.Localization.csproj" />
|
||||
</Folder>
|
||||
<Folder Name="/tests/">
|
||||
<Project Path="tests/ClaudeDo.Data.Tests/ClaudeDo.Data.Tests.csproj" />
|
||||
@@ -13,5 +14,6 @@
|
||||
<Project Path="tests/ClaudeDo.Worker.Tests/ClaudeDo.Worker.Tests.csproj" />
|
||||
<Project Path="tests/ClaudeDo.Installer.Tests/ClaudeDo.Installer.Tests.csproj" />
|
||||
<Project Path="tests/ClaudeDo.Releases.Tests/ClaudeDo.Releases.Tests.csproj" />
|
||||
<Project Path="tests/ClaudeDo.Localization.Tests/ClaudeDo.Localization.Tests.csproj" />
|
||||
</Folder>
|
||||
</Solution>
|
||||
|
||||
175
docs/superpowers/plans/2026-06-01-waiting-for-review-state.md
Normal file
175
docs/superpowers/plans/2026-06-01-waiting-for-review-state.md
Normal file
@@ -0,0 +1,175 @@
|
||||
# Waiting for Review — Task State — Implementation Plan
|
||||
|
||||
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
|
||||
|
||||
**Goal:** Add a `WaitingForReview` lifecycle state that standalone tasks enter after a successful run, with approve / reject-rerun / reject-park / cancel exits, exposed via UI and MCP.
|
||||
|
||||
**Architecture:** New enum value + nullable `ReviewFeedback` column. `TaskStateService` gains review transitions. `TaskRunner.HandleSuccess` routes standalone-task success to review. `QueueService.RunInSlotAsync` resumes the Claude session when re-running a rejected task. New MCP `review_task` tool + UI commands.
|
||||
|
||||
**Tech Stack:** .NET 8, EF Core (SQLite, TEXT enum), SignalR, Avalonia MVVM, xUnit.
|
||||
|
||||
**Scope decision (locked):** Only standalone tasks (`ParentTaskId == null`) route to `WaitingForReview`. Planning **child** tasks continue to `Done` on success so the sequential planning chain (which advances on *terminal* states) is unaffected. Flagged for user confirmation.
|
||||
|
||||
---
|
||||
|
||||
## Task 1: Data layer — enum, converter, column
|
||||
|
||||
**Files:**
|
||||
- Modify: `src/ClaudeDo.Data/Models/TaskEntity.cs`
|
||||
- Modify: `src/ClaudeDo.Data/Configuration/TaskEntityConfiguration.cs`
|
||||
- Create: EF migration via CLI
|
||||
|
||||
- [ ] **Step 1:** Add `WaitingForReview` to `TaskStatus` enum (after `Running`) and add `public string? ReviewFeedback { get; set; }` to `TaskEntity`.
|
||||
- [ ] **Step 2:** In `TaskEntityConfiguration`, add `TaskStatus.WaitingForReview => "waiting_for_review"` to `StatusToString` and `"waiting_for_review" => TaskStatus.WaitingForReview` to `StatusFromString`; map the column: `builder.Property(t => t.ReviewFeedback).HasColumnName("review_feedback");`
|
||||
- [ ] **Step 3:** Create migration: `dotnet ef migrations add AddReviewFeedback --project src/ClaudeDo.Data/ClaudeDo.Data.csproj`. Verify it only adds the `review_feedback` TEXT column (nullable). If `dotnet ef` unavailable, hand-write the migration + designer following the latest migration in `Migrations/`.
|
||||
- [ ] **Step 4:** Build `dotnet build src/ClaudeDo.Data/ClaudeDo.Data.csproj`. Expected: success.
|
||||
- [ ] **Step 5:** Commit.
|
||||
|
||||
## Task 2: Worker — review transitions in TaskStateService
|
||||
|
||||
**Files:**
|
||||
- Modify: `src/ClaudeDo.Worker/State/TaskStateService.cs`
|
||||
- Modify: `src/ClaudeDo.Worker/State/Interfaces/ITaskStateService.cs` (add new method signatures)
|
||||
- Test: `tests/ClaudeDo.Worker.Tests/...` (state transition tests)
|
||||
|
||||
New methods (all return `TransitionResult`, broadcast `TaskUpdated`):
|
||||
|
||||
- `SubmitForReviewAsync(taskId, finishedAt, result, ct)` — guard `Status == Running`; set `Status=WaitingForReview, FinishedAt, Result`. Does NOT call `OnChildTerminalAsync` (review is non-terminal; only invoked for standalone tasks anyway).
|
||||
- `ApproveReviewAsync(taskId, ct)` — guard `Status == WaitingForReview`; set `Status=Done`.
|
||||
- `RejectToQueueAsync(taskId, feedback, ct)` — reject empty/whitespace feedback (`TransitionResult(false, "Feedback is required to reject for re-run.")`); guard `Status == WaitingForReview`; set `Status=Queued, ReviewFeedback=feedback`; `_waker.Wake()`.
|
||||
- `RejectToIdleAsync(taskId, ct)` — guard `Status == WaitingForReview`; set `Status=Idle, ReviewFeedback=null` (leave `Result` intact).
|
||||
- `ClearReviewFeedbackAsync(taskId, ct)` — set `ReviewFeedback=null` (no status change, no guard); used by the runner after consuming feedback.
|
||||
- Extend `CancelAsync` guard: `(Status == Running || Status == Queued || Status == WaitingForReview)`.
|
||||
|
||||
- [ ] **Step 1:** Write failing tests in a new `tests/ClaudeDo.Worker.Tests/State/ReviewTransitionTests.cs` (follow existing TaskStateService test setup). Cover: submit-for-review from Running; approve from WaitingForReview→Done; reject-to-queue stores feedback + status Queued; empty feedback rejected; reject-to-idle clears feedback + keeps Result; cancel from WaitingForReview→Cancelled; invalid (approve from Idle) returns `!Ok`.
|
||||
- [ ] **Step 2:** Run tests, expect FAIL (methods missing).
|
||||
- [ ] **Step 3:** Implement the methods + interface signatures + CancelAsync guard.
|
||||
- [ ] **Step 4:** Run tests, expect PASS.
|
||||
- [ ] **Step 5:** Commit.
|
||||
|
||||
## Task 3: Worker — route standalone success to review
|
||||
|
||||
**Files:**
|
||||
- Modify: `src/ClaudeDo.Worker/Runner/TaskRunner.cs` (`HandleSuccess`)
|
||||
|
||||
- [ ] **Step 1:** In `HandleSuccess`, after commit, branch:
|
||||
```csharp
|
||||
var finishedAt = DateTime.UtcNow;
|
||||
if (task.ParentTaskId is null)
|
||||
{
|
||||
await _state.SubmitForReviewAsync(task.Id, finishedAt, result.ResultMarkdown, CancellationToken.None);
|
||||
await _broadcaster.WorkerLog($"Finished \"{task.Title}\" (waiting for review)", WorkerLogLevel.Success, DateTime.UtcNow);
|
||||
await _broadcaster.TaskFinished(slot, task.Id, "waiting_for_review", finishedAt);
|
||||
}
|
||||
else
|
||||
{
|
||||
await _state.CompleteAsync(task.Id, finishedAt, result.ResultMarkdown, CancellationToken.None);
|
||||
await _broadcaster.WorkerLog($"Finished \"{task.Title}\" (done)", WorkerLogLevel.Success, DateTime.UtcNow);
|
||||
await _broadcaster.TaskFinished(slot, task.Id, "done", finishedAt);
|
||||
}
|
||||
```
|
||||
- [ ] **Step 2:** Build worker. Expected: success.
|
||||
- [ ] **Step 3:** Commit.
|
||||
|
||||
## Task 4: Worker — resume-aware re-run in QueueService
|
||||
|
||||
**Files:**
|
||||
- Modify: `src/ClaudeDo.Worker/Queue/QueueService.cs` (`RunInSlotAsync`)
|
||||
- Test: `tests/ClaudeDo.Worker.Tests/...`
|
||||
|
||||
- [ ] **Step 1:** In `RunInSlotAsync`, after loading `task`:
|
||||
```csharp
|
||||
if (!string.IsNullOrWhiteSpace(task.ReviewFeedback))
|
||||
{
|
||||
var feedback = task.ReviewFeedback!;
|
||||
string? sessionId;
|
||||
using (var ctx = _dbFactory.CreateDbContext())
|
||||
sessionId = (await new TaskRunRepository(ctx).GetLatestByTaskIdAsync(taskId, ct))?.SessionId;
|
||||
await _state.ClearReviewFeedbackAsync(taskId, ct); // inject ITaskStateService
|
||||
if (sessionId is not null)
|
||||
{
|
||||
await _runner.ContinueAsync(taskId, feedback, "queue", ct);
|
||||
return;
|
||||
}
|
||||
task.Description = string.IsNullOrWhiteSpace(task.Description)
|
||||
? $"Reviewer feedback: {feedback}"
|
||||
: $"{task.Description}\n\nReviewer feedback: {feedback}";
|
||||
}
|
||||
await _runner.RunAsync(task, "queue", ct);
|
||||
```
|
||||
Inject `ITaskStateService _state` into `QueueService` (add to ctor + DI already provides it).
|
||||
- [ ] **Step 2:** Build worker, expect success.
|
||||
- [ ] **Step 3:** Commit.
|
||||
|
||||
## Task 5: MCP — review_task tool + status reference
|
||||
|
||||
**Files:**
|
||||
- Modify: `src/ClaudeDo.Worker/External/ExternalMcpService.cs`
|
||||
|
||||
- [ ] **Step 1:** Add `review_task` tool:
|
||||
```csharp
|
||||
[McpServerTool, Description(
|
||||
"Review a task that is WaitingForReview. decision: 'approve' (→ Done), " +
|
||||
"'reject_rerun' (→ Queued, resumes the agent session with feedback — feedback required), " +
|
||||
"'reject_park' (→ Idle for manual editing), 'cancel' (→ Cancelled). ")]
|
||||
public async Task<TaskDto> ReviewTask(string taskId, string decision, string? feedback, CancellationToken cancellationToken)
|
||||
{
|
||||
var task = await _tasks.GetByIdAsync(taskId, cancellationToken)
|
||||
?? throw new InvalidOperationException($"Task {taskId} not found.");
|
||||
TransitionResult r = decision.ToLowerInvariant() switch
|
||||
{
|
||||
"approve" => await _state.ApproveReviewAsync(taskId, cancellationToken),
|
||||
"reject_rerun" => await _state.RejectToQueueAsync(taskId, feedback ?? "", cancellationToken),
|
||||
"reject_park" => await _state.RejectToIdleAsync(taskId, cancellationToken),
|
||||
"cancel" => await _state.CancelAsync(taskId, DateTime.UtcNow, cancellationToken),
|
||||
_ => throw new InvalidOperationException($"Unknown decision '{decision}'. Use approve, reject_rerun, reject_park, or cancel."),
|
||||
};
|
||||
if (!r.Ok) throw new InvalidOperationException(r.Reason ?? "Review action failed.");
|
||||
return ToDto((await _tasks.GetByIdAsync(taskId, cancellationToken))!);
|
||||
}
|
||||
```
|
||||
- [ ] **Step 2:** Add `WaitingForReview` to `GetTaskStatusValues` list; update the validation strings in `ListTasks` and the lifecycle text in `GetTask`/`UpdateTaskStatus` to include `WaitingForReview`.
|
||||
- [ ] **Step 3:** Build worker, expect success.
|
||||
- [ ] **Step 4:** Commit.
|
||||
|
||||
## Task 6: UI — client + hub methods
|
||||
|
||||
**Files:**
|
||||
- Modify: `src/ClaudeDo.Worker/Hub/WorkerHub.cs`
|
||||
- Modify: `src/ClaudeDo.Ui/Services/Interfaces/IWorkerClient.cs`
|
||||
- Modify: `src/ClaudeDo.Ui/Services/WorkerClient.cs`
|
||||
- Modify: `tests/ClaudeDo.Ui.Tests/StubWorkerClient.cs`
|
||||
|
||||
- [ ] **Step 1:** Hub: add `ApproveReview(taskId)`, `RejectReviewToQueue(taskId, feedback)`, `RejectReviewToIdle(taskId)`, `CancelReview(taskId)` — each calls the matching `_state` method via `HubGuard`-style mapping (`if (!result.Ok) throw new HubException(...)`).
|
||||
- [ ] **Step 2:** `IWorkerClient` + `WorkerClient`: add `ApproveReviewAsync`, `RejectReviewToQueueAsync(taskId, feedback)`, `RejectReviewToIdleAsync`, `CancelReviewAsync` invoking the hub methods. Add no-op/stub impls to `StubWorkerClient`.
|
||||
- [ ] **Step 3:** Build App + Ui.Tests. Expected: success.
|
||||
- [ ] **Step 4:** Commit.
|
||||
|
||||
## Task 7: UI — converter, row VM, view buttons
|
||||
|
||||
**Files:**
|
||||
- Modify: `src/ClaudeDo.Ui/Converters/StatusColorConverter.cs`
|
||||
- Modify: `src/ClaudeDo.Ui/ViewModels/Islands/TaskRowViewModel.cs`
|
||||
- Modify: `src/ClaudeDo.Ui/ViewModels/Islands/TasksIslandViewModel.cs` (commands)
|
||||
- Modify: the task row/detail AXAML to surface Approve / Reject / Park / Cancel when `IsWaitingForReview`
|
||||
|
||||
- [ ] **Step 1:** `StatusColorConverter`: add `"waiting_for_review" => Brushes.MediumPurple,` (placeholder — user does visual pass).
|
||||
- [ ] **Step 2:** `TaskRowViewModel`: add `public bool IsWaitingForReview => Status == TaskStatus.WaitingForReview;`, raise it in `OnStatusChanged`, and add `(TaskStatus.WaitingForReview, _) => "review"` to `StatusChipClass`.
|
||||
- [ ] **Step 3:** `TasksIslandViewModel`: add relay commands `ApproveReview`, `RejectReviewRerun` (prompts for feedback), `RejectReviewPark`, `CancelReview` operating on the selected/target row, calling the new client methods.
|
||||
- [ ] **Step 4:** Add buttons to the relevant view bound to those commands, visible when `IsWaitingForReview`. Reject-rerun uses a text-input flyout/dialog for required feedback.
|
||||
- [ ] **Step 5:** Build App + Ui.Tests. Expected: success. (Visual layout: flagged for user's visual pass — cannot render here.)
|
||||
- [ ] **Step 6:** Commit.
|
||||
|
||||
## Task 8: Docs + full verification
|
||||
|
||||
**Files:**
|
||||
- Modify: root `CLAUDE.md`, `src/ClaudeDo.Data/CLAUDE.md`, `src/ClaudeDo.Worker/CLAUDE.md`
|
||||
|
||||
- [ ] **Step 1:** Update status flow lines + worker transition table to include `WaitingForReview` and the new transitions.
|
||||
- [ ] **Step 2:** Build all projects (csproj individually — `.slnx` needs .NET 9) and run `dotnet test tests/ClaudeDo.Worker.Tests`, `tests/ClaudeDo.Ui.Tests`, `tests/ClaudeDo.Data.Tests`. Expected: all green.
|
||||
- [ ] **Step 3:** Commit.
|
||||
|
||||
## Self-Review notes
|
||||
|
||||
- Spec coverage: §1 state machine → Tasks 2,3; §2 data → Task 1; §3 transitions → Task 2; §4 resume → Task 4; §5 MCP → Task 5; §6 hub → Task 6; §7 UI → Tasks 6,7; §8 docs → Task 8; testing → Tasks 2,4,8.
|
||||
- Method names consistent across tasks: `SubmitForReviewAsync`, `ApproveReviewAsync`, `RejectToQueueAsync`, `RejectToIdleAsync`, `ClearReviewFeedbackAsync` (state); `ApproveReview`/`RejectReviewToQueue`/`RejectReviewToIdle`/`CancelReview` (hub); `ApproveReviewAsync`/`RejectReviewToQueueAsync`/`RejectReviewToIdleAsync`/`CancelReviewAsync` (client).
|
||||
983
docs/superpowers/plans/2026-06-02-prime-recurring-weekdays.md
Normal file
983
docs/superpowers/plans/2026-06-02-prime-recurring-weekdays.md
Normal file
@@ -0,0 +1,983 @@
|
||||
# Prime Recurring Weekday Schedule — Implementation Plan
|
||||
|
||||
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
|
||||
|
||||
**Goal:** Replace the Prime schedule's date-range model with a recurring weekday model — pick a set of weekdays plus a time, and the ping fires on the next eligible day the worker is running.
|
||||
|
||||
**Architecture:** A `[Flags] PrimeDays` weekday bitmask stored as a single `days_of_week` int column replaces `StartDate`/`EndDate`/`WorkdaysOnly`. `NextDueCalculator` walks forward to the next selected weekday; the existing 30-minute catch-up and already-fired-today logic are untouched. UI swaps the range picker + Mon–Fri checkbox for seven toggle buttons. Both SignalR DTO copies carry a single `int Days`.
|
||||
|
||||
**Tech Stack:** .NET 8, EF Core (SQLite), Avalonia 12 (CommunityToolkit.Mvvm), SignalR, xUnit.
|
||||
|
||||
**Spec:** `docs/superpowers/specs/2026-06-02-prime-recurring-weekdays-design.md`
|
||||
|
||||
**Build/test note:** `dotnet build ClaudeDo.slnx` needs .NET 9; on .NET 8 build individual csproj. Commands in this plan use the per-project form.
|
||||
|
||||
---
|
||||
|
||||
## File Structure
|
||||
|
||||
- `src/ClaudeDo.Data/Models/PrimeDays.cs` — **new**, `[Flags]` enum.
|
||||
- `src/ClaudeDo.Data/Models/PrimeScheduleEntity.cs` — swap fields.
|
||||
- `src/ClaudeDo.Data/Configuration/PrimeScheduleEntityConfiguration.cs` — column mapping.
|
||||
- `src/ClaudeDo.Data/Migrations/*` — new migration + snapshot.
|
||||
- `src/ClaudeDo.Data/Repositories/PrimeScheduleRepository.cs` — upsert fields + ordering.
|
||||
- `src/ClaudeDo.Worker/Prime/PrimeScheduleDto.cs` — `int Days`.
|
||||
- `src/ClaudeDo.Worker/Prime/NextDueCalculator.cs` — weekday eligibility.
|
||||
- `src/ClaudeDo.Worker/Prime/PrimeScheduler.cs` — `ToDto` mapping.
|
||||
- `src/ClaudeDo.Worker/Hub/WorkerHub.cs` — list/upsert mapping.
|
||||
- `src/ClaudeDo.Ui/Services/PrimeScheduleDto.cs` — `int Days`.
|
||||
- `src/ClaudeDo.Ui/ViewModels/Modals/Settings/PrimeScheduleRowViewModel.cs` — 7 day bools.
|
||||
- `src/ClaudeDo.Ui/ViewModels/Modals/Settings/PrimeClaudeTabViewModel.cs` — defaults + validation.
|
||||
- `src/ClaudeDo.Ui/Design/IslandStyles.axaml` — `day-toggle` style class.
|
||||
- `src/ClaudeDo.Ui/Views/Modals/SettingsModalView.axaml` — row template.
|
||||
- Tests: `NextDueCalculatorTests`, `PrimeSchedulerTests`, `PrimeScheduleRepositoryTests`, `PrimeClaudeTabViewModelTests`.
|
||||
- Docs: `src/ClaudeDo.Data/CLAUDE.md`, root `CLAUDE.md`.
|
||||
|
||||
---
|
||||
|
||||
## Task 1: PrimeDays enum + entity + configuration
|
||||
|
||||
**Files:**
|
||||
- Create: `src/ClaudeDo.Data/Models/PrimeDays.cs`
|
||||
- Modify: `src/ClaudeDo.Data/Models/PrimeScheduleEntity.cs`
|
||||
- Modify: `src/ClaudeDo.Data/Configuration/PrimeScheduleEntityConfiguration.cs`
|
||||
|
||||
- [ ] **Step 1: Create the flags enum**
|
||||
|
||||
`src/ClaudeDo.Data/Models/PrimeDays.cs`:
|
||||
|
||||
```csharp
|
||||
namespace ClaudeDo.Data.Models;
|
||||
|
||||
[Flags]
|
||||
public enum PrimeDays
|
||||
{
|
||||
None = 0,
|
||||
Monday = 1,
|
||||
Tuesday = 2,
|
||||
Wednesday = 4,
|
||||
Thursday = 8,
|
||||
Friday = 16,
|
||||
Saturday = 32,
|
||||
Sunday = 64,
|
||||
Weekdays = Monday | Tuesday | Wednesday | Thursday | Friday, // 31
|
||||
All = Weekdays | Saturday | Sunday, // 127
|
||||
}
|
||||
```
|
||||
|
||||
- [ ] **Step 2: Swap entity fields**
|
||||
|
||||
In `src/ClaudeDo.Data/Models/PrimeScheduleEntity.cs`, remove `StartDate`, `EndDate`, `WorkdaysOnly` and add `Days`. Result:
|
||||
|
||||
```csharp
|
||||
namespace ClaudeDo.Data.Models;
|
||||
|
||||
public sealed class PrimeScheduleEntity
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public PrimeDays Days { get; set; } = PrimeDays.Weekdays;
|
||||
public TimeSpan TimeOfDay { get; set; }
|
||||
public bool Enabled { get; set; } = true;
|
||||
public DateTimeOffset? LastRunAt { get; set; }
|
||||
public string? PromptOverride { get; set; }
|
||||
public DateTimeOffset CreatedAt { get; set; } = DateTimeOffset.UtcNow;
|
||||
}
|
||||
```
|
||||
|
||||
- [ ] **Step 3: Update entity configuration**
|
||||
|
||||
In `src/ClaudeDo.Data/Configuration/PrimeScheduleEntityConfiguration.cs`, replace the `start_date`/`end_date`/`workdays_only` property lines with a `days_of_week` mapping (EF maps the enum to INTEGER automatically):
|
||||
|
||||
```csharp
|
||||
builder.Property(s => s.Days).HasColumnName("days_of_week")
|
||||
.IsRequired().HasDefaultValue(PrimeDays.Weekdays);
|
||||
builder.Property(s => s.TimeOfDay).HasColumnName("time_of_day").IsRequired();
|
||||
builder.Property(s => s.Enabled).HasColumnName("enabled").IsRequired().HasDefaultValue(true);
|
||||
```
|
||||
|
||||
Leave `Id`, `LastRunAt`, `PromptOverride`, `CreatedAt` mappings unchanged. Add `using ClaudeDo.Data.Models;` if not present (it already is).
|
||||
|
||||
- [ ] **Step 4: Build the Data project**
|
||||
|
||||
Run: `dotnet build src/ClaudeDo.Data/ClaudeDo.Data.csproj`
|
||||
Expected: FAILS — `PrimeScheduleRepository`, snapshot, etc. still reference removed fields. That is expected; Tasks 2–3 fix it. (If you prefer a clean build gate, proceed to Task 2 before building.)
|
||||
|
||||
- [ ] **Step 5: Commit**
|
||||
|
||||
```bash
|
||||
git add src/ClaudeDo.Data/Models/PrimeDays.cs src/ClaudeDo.Data/Models/PrimeScheduleEntity.cs src/ClaudeDo.Data/Configuration/PrimeScheduleEntityConfiguration.cs
|
||||
git commit -m "feat(data): model Prime schedule as weekday bitmask"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Task 2: Repository
|
||||
|
||||
**Files:**
|
||||
- Modify: `src/ClaudeDo.Data/Repositories/PrimeScheduleRepository.cs`
|
||||
|
||||
- [ ] **Step 1: Update `ListAsync` ordering**
|
||||
|
||||
The old ordering used `StartDate`. Order by `TimeOfDay`:
|
||||
|
||||
```csharp
|
||||
public async Task<IReadOnlyList<PrimeScheduleEntity>> ListAsync(CancellationToken ct = default)
|
||||
{
|
||||
var rows = await _context.PrimeSchedules.AsNoTracking()
|
||||
.OrderBy(s => s.TimeOfDay)
|
||||
.ToListAsync(ct);
|
||||
return rows;
|
||||
}
|
||||
```
|
||||
|
||||
- [ ] **Step 2: Update `UpsertAsync` field copy**
|
||||
|
||||
Replace the three removed-field assignments with `Days`:
|
||||
|
||||
```csharp
|
||||
else
|
||||
{
|
||||
existing.Days = entity.Days;
|
||||
existing.TimeOfDay = entity.TimeOfDay;
|
||||
existing.Enabled = entity.Enabled;
|
||||
existing.PromptOverride = entity.PromptOverride;
|
||||
}
|
||||
```
|
||||
|
||||
Leave `GetAsync`, `DeleteAsync`, `UpdateLastRunAsync` unchanged.
|
||||
|
||||
- [ ] **Step 3: Commit** (build verified after migration in Task 3)
|
||||
|
||||
```bash
|
||||
git add src/ClaudeDo.Data/Repositories/PrimeScheduleRepository.cs
|
||||
git commit -m "feat(data): persist weekday bitmask in prime schedule repo"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Task 3: EF migration
|
||||
|
||||
**Files:**
|
||||
- Create: `src/ClaudeDo.Data/Migrations/<timestamp>_PrimeWeekdays.cs` (generated)
|
||||
- Modify: `src/ClaudeDo.Data/Migrations/ClaudeDoDbContextModelSnapshot.cs` (generated)
|
||||
|
||||
- [ ] **Step 1: Generate the migration**
|
||||
|
||||
Run from repo root:
|
||||
|
||||
```bash
|
||||
dotnet ef migrations add PrimeWeekdays --project src/ClaudeDo.Data/ClaudeDo.Data.csproj --startup-project src/ClaudeDo.Worker/ClaudeDo.Worker.csproj
|
||||
```
|
||||
|
||||
Expected: a new `*_PrimeWeekdays.cs` file and an updated snapshot. (If `dotnet ef` is unavailable, hand-write the migration using the body below.)
|
||||
|
||||
- [ ] **Step 2: Replace the generated `Up` body with an explicit backfill**
|
||||
|
||||
EF's auto-generated drop/add would discard existing schedules' weekday intent. Edit the new migration's `Up` to add the column, backfill from `workdays_only`, then drop the old columns:
|
||||
|
||||
```csharp
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "days_of_week",
|
||||
table: "prime_schedules",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 31);
|
||||
|
||||
migrationBuilder.Sql(
|
||||
"UPDATE prime_schedules SET days_of_week = CASE WHEN workdays_only = 1 THEN 31 ELSE 127 END;");
|
||||
|
||||
migrationBuilder.DropColumn(name: "start_date", table: "prime_schedules");
|
||||
migrationBuilder.DropColumn(name: "end_date", table: "prime_schedules");
|
||||
migrationBuilder.DropColumn(name: "workdays_only", table: "prime_schedules");
|
||||
}
|
||||
```
|
||||
|
||||
- [ ] **Step 3: Replace the generated `Down` body**
|
||||
|
||||
```csharp
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<DateOnly>(
|
||||
name: "start_date", table: "prime_schedules",
|
||||
type: "TEXT", nullable: false, defaultValue: new DateOnly(2000, 1, 1));
|
||||
migrationBuilder.AddColumn<DateOnly>(
|
||||
name: "end_date", table: "prime_schedules",
|
||||
type: "TEXT", nullable: false, defaultValue: new DateOnly(2099, 12, 31));
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "workdays_only", table: "prime_schedules",
|
||||
type: "INTEGER", nullable: false, defaultValue: true);
|
||||
|
||||
migrationBuilder.Sql(
|
||||
"UPDATE prime_schedules SET workdays_only = CASE WHEN days_of_week = 127 THEN 0 ELSE 1 END;");
|
||||
|
||||
migrationBuilder.DropColumn(name: "days_of_week", table: "prime_schedules");
|
||||
}
|
||||
```
|
||||
|
||||
Add `using System;` at the top of the migration file if `DateOnly` defaults require it (the existing AddPrimeSchedules migration already imports `System`).
|
||||
|
||||
- [ ] **Step 4: Build the Data project**
|
||||
|
||||
Run: `dotnet build src/ClaudeDo.Data/ClaudeDo.Data.csproj`
|
||||
Expected: PASS.
|
||||
|
||||
- [ ] **Step 5: Commit**
|
||||
|
||||
```bash
|
||||
git add src/ClaudeDo.Data/Migrations
|
||||
git commit -m "feat(data): migrate prime schedules to days_of_week bitmask"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Task 4: Worker DTO + NextDueCalculator (TDD)
|
||||
|
||||
**Files:**
|
||||
- Modify: `src/ClaudeDo.Worker/Prime/PrimeScheduleDto.cs`
|
||||
- Modify: `src/ClaudeDo.Worker/Prime/NextDueCalculator.cs`
|
||||
- Test: `tests/ClaudeDo.Worker.Tests/Prime/NextDueCalculatorTests.cs`
|
||||
|
||||
- [ ] **Step 1: Update the Worker DTO**
|
||||
|
||||
`src/ClaudeDo.Worker/Prime/PrimeScheduleDto.cs`:
|
||||
|
||||
```csharp
|
||||
namespace ClaudeDo.Worker.Prime;
|
||||
|
||||
public sealed record PrimeScheduleDto(
|
||||
Guid Id,
|
||||
int Days,
|
||||
TimeSpan TimeOfDay,
|
||||
bool Enabled,
|
||||
DateTimeOffset? LastRunAt,
|
||||
string? PromptOverride);
|
||||
```
|
||||
|
||||
- [ ] **Step 2: Rewrite the calculator tests**
|
||||
|
||||
Replace the entire body of `tests/ClaudeDo.Worker.Tests/Prime/NextDueCalculatorTests.cs`. Note: 2026-05-05 is a Tuesday; 2026-05-08 is a Friday; 2026-05-09/10 are Sat/Sun; 2026-05-11 is a Monday.
|
||||
|
||||
```csharp
|
||||
using ClaudeDo.Data.Models;
|
||||
using ClaudeDo.Worker.Prime;
|
||||
|
||||
namespace ClaudeDo.Worker.Tests.Prime;
|
||||
|
||||
public class NextDueCalculatorTests
|
||||
{
|
||||
private static PrimeScheduleDto Schedule(
|
||||
PrimeDays days, TimeSpan time,
|
||||
bool enabled = true, DateTimeOffset? lastRun = null) =>
|
||||
new(Guid.NewGuid(), (int)days, time, enabled, lastRun, null);
|
||||
|
||||
[Fact]
|
||||
public void Disabled_Schedule_Returns_Null()
|
||||
{
|
||||
var now = new DateTimeOffset(2026, 5, 5, 6, 0, 0, TimeSpan.FromHours(2));
|
||||
var s = Schedule(PrimeDays.All, new(7, 0, 0), enabled: false);
|
||||
Assert.Null(NextDueCalculator.Compute(new[] { s }, now, TimeSpan.FromMinutes(30)));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void No_Days_Selected_Returns_Null()
|
||||
{
|
||||
var now = new DateTimeOffset(2026, 5, 5, 6, 0, 0, TimeSpan.FromHours(2));
|
||||
var s = Schedule(PrimeDays.None, new(7, 0, 0));
|
||||
Assert.Null(NextDueCalculator.Compute(new[] { s }, now, TimeSpan.FromMinutes(30)));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Future_Same_Day_Returns_Today_At_Target()
|
||||
{
|
||||
var now = new DateTimeOffset(2026, 5, 5, 6, 0, 0, TimeSpan.FromHours(2)); // Tue
|
||||
var s = Schedule(PrimeDays.All, new(7, 0, 0));
|
||||
var r = NextDueCalculator.Compute(new[] { s }, now, TimeSpan.FromMinutes(30));
|
||||
Assert.NotNull(r);
|
||||
Assert.Equal(new DateTimeOffset(2026, 5, 5, 7, 0, 0, now.Offset), r!.At);
|
||||
Assert.False(r.FireImmediately);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Within_CatchUp_Window_Fires_Immediately()
|
||||
{
|
||||
var now = new DateTimeOffset(2026, 5, 5, 7, 15, 0, TimeSpan.FromHours(2));
|
||||
var s = Schedule(PrimeDays.All, new(7, 0, 0));
|
||||
var r = NextDueCalculator.Compute(new[] { s }, now, TimeSpan.FromMinutes(30));
|
||||
Assert.NotNull(r);
|
||||
Assert.True(r!.FireImmediately);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Past_CatchUp_Window_Skips_To_Next_Eligible_Day()
|
||||
{
|
||||
var now = new DateTimeOffset(2026, 5, 5, 9, 0, 0, TimeSpan.FromHours(2)); // Tue
|
||||
var s = Schedule(PrimeDays.All, new(7, 0, 0));
|
||||
var r = NextDueCalculator.Compute(new[] { s }, now, TimeSpan.FromMinutes(30));
|
||||
Assert.NotNull(r);
|
||||
Assert.Equal(new DateOnly(2026, 5, 6), DateOnly.FromDateTime(r!.At.LocalDateTime));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Weekdays_Only_Skips_Weekend()
|
||||
{
|
||||
var now = new DateTimeOffset(2026, 5, 8, 8, 0, 0, TimeSpan.FromHours(2)); // Fri, past catch-up
|
||||
var s = Schedule(PrimeDays.Weekdays, new(7, 0, 0));
|
||||
var r = NextDueCalculator.Compute(new[] { s }, now, TimeSpan.FromMinutes(30));
|
||||
Assert.NotNull(r);
|
||||
Assert.Equal(DayOfWeek.Monday, r!.At.LocalDateTime.DayOfWeek);
|
||||
Assert.Equal(new DateOnly(2026, 5, 11), DateOnly.FromDateTime(r.At.LocalDateTime));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Single_Day_Schedule_Targets_That_Weekday()
|
||||
{
|
||||
var now = new DateTimeOffset(2026, 5, 5, 8, 0, 0, TimeSpan.FromHours(2)); // Tue, past catch-up
|
||||
var s = Schedule(PrimeDays.Friday, new(7, 0, 0));
|
||||
var r = NextDueCalculator.Compute(new[] { s }, now, TimeSpan.FromMinutes(30));
|
||||
Assert.NotNull(r);
|
||||
Assert.Equal(DayOfWeek.Friday, r!.At.LocalDateTime.DayOfWeek);
|
||||
Assert.Equal(new DateOnly(2026, 5, 8), DateOnly.FromDateTime(r.At.LocalDateTime));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Already_Fired_Today_Skips_To_Next_Eligible_Day()
|
||||
{
|
||||
var now = new DateTimeOffset(2026, 5, 5, 6, 0, 0, TimeSpan.FromHours(2));
|
||||
var lastRun = new DateTimeOffset(2026, 5, 5, 7, 1, 0, TimeSpan.FromHours(2));
|
||||
var s = Schedule(PrimeDays.All, new(7, 0, 0), lastRun: lastRun);
|
||||
var r = NextDueCalculator.Compute(new[] { s }, now, TimeSpan.FromMinutes(30));
|
||||
Assert.NotNull(r);
|
||||
Assert.Equal(new DateOnly(2026, 5, 6), DateOnly.FromDateTime(r!.At.LocalDateTime));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Multiple_Schedules_Returns_Earliest()
|
||||
{
|
||||
var now = new DateTimeOffset(2026, 5, 5, 6, 0, 0, TimeSpan.FromHours(2));
|
||||
var early = Schedule(PrimeDays.All, new(7, 0, 0));
|
||||
var late = Schedule(PrimeDays.All, new(9, 0, 0));
|
||||
var r = NextDueCalculator.Compute(new[] { late, early }, now, TimeSpan.FromMinutes(30));
|
||||
Assert.NotNull(r);
|
||||
Assert.Equal(early.Id, r!.Schedule.Id);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
- [ ] **Step 3: Run the tests to verify they fail**
|
||||
|
||||
Run: `dotnet test tests/ClaudeDo.Worker.Tests --filter FullyQualifiedName~NextDueCalculatorTests`
|
||||
Expected: FAIL — `PrimeScheduleDto` no longer has `StartDate`/`EndDate`/`workdaysOnly`, and the calculator still references them (compile errors).
|
||||
|
||||
- [ ] **Step 4: Rewrite the calculator**
|
||||
|
||||
Replace the entire body of `src/ClaudeDo.Worker/Prime/NextDueCalculator.cs`:
|
||||
|
||||
```csharp
|
||||
using ClaudeDo.Data.Models;
|
||||
|
||||
namespace ClaudeDo.Worker.Prime;
|
||||
|
||||
public sealed record NextDue(PrimeScheduleDto Schedule, DateTimeOffset At, bool FireImmediately);
|
||||
|
||||
public static class NextDueCalculator
|
||||
{
|
||||
public static NextDue? Compute(
|
||||
IEnumerable<PrimeScheduleDto> schedules,
|
||||
DateTimeOffset now,
|
||||
TimeSpan catchUp)
|
||||
{
|
||||
NextDue? best = null;
|
||||
foreach (var s in schedules)
|
||||
{
|
||||
if (!s.Enabled) continue;
|
||||
var due = ComputeFor(s, now, catchUp);
|
||||
if (due is null) continue;
|
||||
if (best is null || due.At < best.At) best = due;
|
||||
}
|
||||
return best;
|
||||
}
|
||||
|
||||
private static NextDue? ComputeFor(PrimeScheduleDto s, DateTimeOffset now, TimeSpan catchUp)
|
||||
{
|
||||
if ((PrimeDays)s.Days == PrimeDays.None) return null;
|
||||
|
||||
var todayLocal = DateOnly.FromDateTime(now.LocalDateTime);
|
||||
var alreadyFiredToday = s.LastRunAt is { } last &&
|
||||
DateOnly.FromDateTime(last.LocalDateTime) == todayLocal;
|
||||
|
||||
if (!alreadyFiredToday && IsEligibleDay(s, todayLocal))
|
||||
{
|
||||
var todayTarget = ToOffset(todayLocal, s.TimeOfDay, now.Offset);
|
||||
if (todayTarget >= now)
|
||||
return new NextDue(s, todayTarget, false);
|
||||
if (now <= todayTarget + catchUp)
|
||||
return new NextDue(s, now, true);
|
||||
}
|
||||
|
||||
var d = todayLocal.AddDays(1);
|
||||
for (int i = 0; i < 7; i++)
|
||||
{
|
||||
if (IsEligibleDay(s, d))
|
||||
return new NextDue(s, ToOffset(d, s.TimeOfDay, now.Offset), false);
|
||||
d = d.AddDays(1);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static bool IsEligibleDay(PrimeScheduleDto s, DateOnly d) =>
|
||||
((PrimeDays)s.Days & ToFlag(d.DayOfWeek)) != PrimeDays.None;
|
||||
|
||||
private static PrimeDays ToFlag(DayOfWeek dow) => dow switch
|
||||
{
|
||||
DayOfWeek.Monday => PrimeDays.Monday,
|
||||
DayOfWeek.Tuesday => PrimeDays.Tuesday,
|
||||
DayOfWeek.Wednesday => PrimeDays.Wednesday,
|
||||
DayOfWeek.Thursday => PrimeDays.Thursday,
|
||||
DayOfWeek.Friday => PrimeDays.Friday,
|
||||
DayOfWeek.Saturday => PrimeDays.Saturday,
|
||||
DayOfWeek.Sunday => PrimeDays.Sunday,
|
||||
_ => PrimeDays.None,
|
||||
};
|
||||
|
||||
private static DateTimeOffset ToOffset(DateOnly day, TimeSpan time, TimeSpan offset) =>
|
||||
new(day.Year, day.Month, day.Day, time.Hours, time.Minutes, time.Seconds, offset);
|
||||
}
|
||||
```
|
||||
|
||||
- [ ] **Step 5: Run the calculator tests**
|
||||
|
||||
Run: `dotnet test tests/ClaudeDo.Worker.Tests --filter FullyQualifiedName~NextDueCalculatorTests`
|
||||
Expected: still FAILS to build — `PrimeScheduler.ToDto` and `WorkerHub` mappings reference removed fields. Proceed to Tasks 5–6, then re-run.
|
||||
|
||||
- [ ] **Step 6: Commit**
|
||||
|
||||
```bash
|
||||
git add src/ClaudeDo.Worker/Prime/PrimeScheduleDto.cs src/ClaudeDo.Worker/Prime/NextDueCalculator.cs tests/ClaudeDo.Worker.Tests/Prime/NextDueCalculatorTests.cs
|
||||
git commit -m "feat(worker): compute prime due-time from weekday bitmask"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Task 5: PrimeScheduler.ToDto + scheduler tests
|
||||
|
||||
**Files:**
|
||||
- Modify: `src/ClaudeDo.Worker/Prime/PrimeScheduler.cs:104-105`
|
||||
- Test: `tests/ClaudeDo.Worker.Tests/Prime/PrimeSchedulerTests.cs`
|
||||
|
||||
- [ ] **Step 1: Update the `ToDto` mapping**
|
||||
|
||||
Replace the `ToDto` method in `PrimeScheduler.cs`:
|
||||
|
||||
```csharp
|
||||
private static PrimeScheduleDto ToDto(Data.Models.PrimeScheduleEntity e) =>
|
||||
new(e.Id, (int)e.Days, e.TimeOfDay, e.Enabled, e.LastRunAt, e.PromptOverride);
|
||||
```
|
||||
|
||||
- [ ] **Step 2: Update scheduler test fixtures**
|
||||
|
||||
In `tests/ClaudeDo.Worker.Tests/Prime/PrimeSchedulerTests.cs`, every `new PrimeScheduleEntity { ... }` initializer sets `StartDate`/`EndDate`/`WorkdaysOnly`. Replace those three lines in each of the three initializers (lines ~48-52, ~89-94, ~131-136) with a single `Days` assignment. Each initializer becomes:
|
||||
|
||||
```csharp
|
||||
await new PrimeScheduleRepository(ctx).UpsertAsync(new PrimeScheduleEntity
|
||||
{
|
||||
Id = id,
|
||||
Days = PrimeDays.All,
|
||||
TimeOfDay = new TimeSpan(7, 0, 0),
|
||||
Enabled = true,
|
||||
CreatedAt = DateTimeOffset.UtcNow,
|
||||
});
|
||||
```
|
||||
|
||||
Add `using ClaudeDo.Data.Models;` to the file's usings if not already present (it is, via line 1).
|
||||
|
||||
- [ ] **Step 3: Run scheduler + calculator tests**
|
||||
|
||||
Run: `dotnet test tests/ClaudeDo.Worker.Tests --filter "FullyQualifiedName~Prime"`
|
||||
Expected: still build-fails until `WorkerHub` (Task 6) compiles. After Task 6, this command must PASS.
|
||||
|
||||
- [ ] **Step 4: Commit**
|
||||
|
||||
```bash
|
||||
git add src/ClaudeDo.Worker/Prime/PrimeScheduler.cs tests/ClaudeDo.Worker.Tests/Prime/PrimeSchedulerTests.cs
|
||||
git commit -m "test(worker): adapt prime scheduler tests to weekday model"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Task 6: WorkerHub mapping + repository tests
|
||||
|
||||
**Files:**
|
||||
- Modify: `src/ClaudeDo.Worker/Hub/WorkerHub.cs:488-518`
|
||||
- Test: `tests/ClaudeDo.Worker.Tests/Repositories/PrimeScheduleRepositoryTests.cs`
|
||||
|
||||
- [ ] **Step 1: Update `ListPrimeSchedules`**
|
||||
|
||||
```csharp
|
||||
public async Task<List<PrimeScheduleDto>> ListPrimeSchedules()
|
||||
{
|
||||
using var ctx = _dbFactory.CreateDbContext();
|
||||
var rows = await new PrimeScheduleRepository(ctx).ListAsync();
|
||||
return rows.Select(e => new PrimeScheduleDto(
|
||||
e.Id, (int)e.Days, e.TimeOfDay, e.Enabled, e.LastRunAt, e.PromptOverride)).ToList();
|
||||
}
|
||||
```
|
||||
|
||||
- [ ] **Step 2: Update `UpsertPrimeSchedule`**
|
||||
|
||||
```csharp
|
||||
public async Task<PrimeScheduleDto> UpsertPrimeSchedule(PrimeScheduleDto dto)
|
||||
{
|
||||
using var ctx = _dbFactory.CreateDbContext();
|
||||
var repo = new PrimeScheduleRepository(ctx);
|
||||
var existing = await repo.GetAsync(dto.Id);
|
||||
var entity = new ClaudeDo.Data.Models.PrimeScheduleEntity
|
||||
{
|
||||
Id = dto.Id == Guid.Empty ? Guid.NewGuid() : dto.Id,
|
||||
Days = (ClaudeDo.Data.Models.PrimeDays)dto.Days,
|
||||
TimeOfDay = dto.TimeOfDay,
|
||||
Enabled = dto.Enabled,
|
||||
PromptOverride = dto.PromptOverride,
|
||||
CreatedAt = existing?.CreatedAt ?? DateTimeOffset.UtcNow,
|
||||
LastRunAt = existing?.LastRunAt,
|
||||
};
|
||||
await repo.UpsertAsync(entity);
|
||||
_primeSignal.Signal();
|
||||
return new PrimeScheduleDto(entity.Id, (int)entity.Days, entity.TimeOfDay,
|
||||
entity.Enabled, entity.LastRunAt, entity.PromptOverride);
|
||||
}
|
||||
```
|
||||
|
||||
`DeletePrimeSchedule` is unchanged.
|
||||
|
||||
- [ ] **Step 3: Update repository tests**
|
||||
|
||||
In `tests/ClaudeDo.Worker.Tests/Repositories/PrimeScheduleRepositoryTests.cs`, replace each entity initializer's `StartDate`/`EndDate`/`WorkdaysOnly` lines with `Days = PrimeDays.Weekdays,` (drop them where only `StartDate`/`EndDate` appear). The three initializers become:
|
||||
|
||||
```csharp
|
||||
// Upsert_Then_List_RoundTrips
|
||||
await new PrimeScheduleRepository(ctx).UpsertAsync(new PrimeScheduleEntity
|
||||
{
|
||||
Id = id,
|
||||
Days = PrimeDays.Weekdays,
|
||||
TimeOfDay = new TimeSpan(7, 0, 0),
|
||||
Enabled = true,
|
||||
CreatedAt = DateTimeOffset.UtcNow,
|
||||
});
|
||||
```
|
||||
|
||||
```csharp
|
||||
// UpdateLastRunAt_Persists
|
||||
await new PrimeScheduleRepository(ctx).UpsertAsync(new PrimeScheduleEntity
|
||||
{
|
||||
Id = id,
|
||||
Days = PrimeDays.Weekdays,
|
||||
TimeOfDay = new TimeSpan(7, 0, 0),
|
||||
Enabled = true,
|
||||
CreatedAt = DateTimeOffset.UtcNow,
|
||||
});
|
||||
```
|
||||
|
||||
```csharp
|
||||
// Delete_Removes_Row
|
||||
await new PrimeScheduleRepository(ctx).UpsertAsync(new PrimeScheduleEntity
|
||||
{
|
||||
Id = id,
|
||||
Days = PrimeDays.All,
|
||||
TimeOfDay = TimeSpan.Zero,
|
||||
Enabled = true,
|
||||
CreatedAt = DateTimeOffset.UtcNow,
|
||||
});
|
||||
```
|
||||
|
||||
Add an assertion in `Upsert_Then_List_RoundTrips` after the existing time assertion:
|
||||
|
||||
```csharp
|
||||
Assert.Equal(PrimeDays.Weekdays, rows[0].Days);
|
||||
```
|
||||
|
||||
- [ ] **Step 4: Build worker + run all worker tests**
|
||||
|
||||
Run: `dotnet build src/ClaudeDo.Worker/ClaudeDo.Worker.csproj && dotnet test tests/ClaudeDo.Worker.Tests`
|
||||
Expected: PASS (all Prime + repository tests green).
|
||||
|
||||
- [ ] **Step 5: Commit**
|
||||
|
||||
```bash
|
||||
git add src/ClaudeDo.Worker/Hub/WorkerHub.cs tests/ClaudeDo.Worker.Tests/Repositories/PrimeScheduleRepositoryTests.cs
|
||||
git commit -m "feat(worker): map prime schedule weekday bitmask over the hub"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Task 7: UI DTO + ViewModels + tests (TDD)
|
||||
|
||||
**Files:**
|
||||
- Modify: `src/ClaudeDo.Ui/Services/PrimeScheduleDto.cs`
|
||||
- Modify: `src/ClaudeDo.Ui/ViewModels/Modals/Settings/PrimeScheduleRowViewModel.cs`
|
||||
- Modify: `src/ClaudeDo.Ui/ViewModels/Modals/Settings/PrimeClaudeTabViewModel.cs`
|
||||
- Test: `tests/ClaudeDo.Ui.Tests/ViewModels/PrimeClaudeTabViewModelTests.cs`
|
||||
|
||||
- [ ] **Step 1: Update the UI DTO**
|
||||
|
||||
`src/ClaudeDo.Ui/Services/PrimeScheduleDto.cs` (keep `PrimeFiredEvent` unchanged):
|
||||
|
||||
```csharp
|
||||
namespace ClaudeDo.Ui.Services;
|
||||
|
||||
public sealed record PrimeScheduleDto(
|
||||
Guid Id,
|
||||
int Days,
|
||||
TimeSpan TimeOfDay,
|
||||
bool Enabled,
|
||||
DateTimeOffset? LastRunAt,
|
||||
string? PromptOverride);
|
||||
|
||||
public sealed record PrimeFiredEvent(
|
||||
Guid ScheduleId,
|
||||
bool Success,
|
||||
string Message,
|
||||
DateTimeOffset FiredAt);
|
||||
```
|
||||
|
||||
- [ ] **Step 2: Rewrite the row VM**
|
||||
|
||||
Replace the body of `src/ClaudeDo.Ui/ViewModels/Modals/Settings/PrimeScheduleRowViewModel.cs`:
|
||||
|
||||
```csharp
|
||||
using ClaudeDo.Ui.Services;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace ClaudeDo.Ui.ViewModels.Modals.Settings;
|
||||
|
||||
public sealed partial class PrimeScheduleRowViewModel : ViewModelBase
|
||||
{
|
||||
private const int Mon = 1, Tue = 2, Wed = 4, Thu = 8, Fri = 16, Sat = 32, Sun = 64;
|
||||
|
||||
public Guid Id { get; }
|
||||
public bool IsExisting { get; }
|
||||
|
||||
[ObservableProperty] private bool _enabled;
|
||||
[ObservableProperty] private bool _monday;
|
||||
[ObservableProperty] private bool _tuesday;
|
||||
[ObservableProperty] private bool _wednesday;
|
||||
[ObservableProperty] private bool _thursday;
|
||||
[ObservableProperty] private bool _friday;
|
||||
[ObservableProperty] private bool _saturday;
|
||||
[ObservableProperty] private bool _sunday;
|
||||
[ObservableProperty] private TimeSpan _timeOfDay;
|
||||
[ObservableProperty] private DateTimeOffset? _lastRunAt;
|
||||
|
||||
public string LastRunLabel => LastRunAt is { } v ? v.LocalDateTime.ToString("g") : "—";
|
||||
|
||||
partial void OnLastRunAtChanged(DateTimeOffset? value) => OnPropertyChanged(nameof(LastRunLabel));
|
||||
|
||||
public PrimeScheduleRowViewModel(PrimeScheduleDto dto, bool isExisting)
|
||||
{
|
||||
Id = dto.Id;
|
||||
IsExisting = isExisting;
|
||||
Enabled = dto.Enabled;
|
||||
Monday = (dto.Days & Mon) != 0;
|
||||
Tuesday = (dto.Days & Tue) != 0;
|
||||
Wednesday = (dto.Days & Wed) != 0;
|
||||
Thursday = (dto.Days & Thu) != 0;
|
||||
Friday = (dto.Days & Fri) != 0;
|
||||
Saturday = (dto.Days & Sat) != 0;
|
||||
Sunday = (dto.Days & Sun) != 0;
|
||||
TimeOfDay = dto.TimeOfDay;
|
||||
LastRunAt = dto.LastRunAt;
|
||||
}
|
||||
|
||||
public int DaysMask()
|
||||
{
|
||||
int m = 0;
|
||||
if (Monday) m |= Mon;
|
||||
if (Tuesday) m |= Tue;
|
||||
if (Wednesday) m |= Wed;
|
||||
if (Thursday) m |= Thu;
|
||||
if (Friday) m |= Fri;
|
||||
if (Saturday) m |= Sat;
|
||||
if (Sunday) m |= Sun;
|
||||
return m;
|
||||
}
|
||||
|
||||
public PrimeScheduleDto ToDto() =>
|
||||
new(Id, DaysMask(), TimeOfDay, Enabled, LastRunAt, null);
|
||||
}
|
||||
```
|
||||
|
||||
- [ ] **Step 3: Update the tab VM**
|
||||
|
||||
In `src/ClaudeDo.Ui/ViewModels/Modals/Settings/PrimeClaudeTabViewModel.cs`, replace `Validate` and `AddSchedule`:
|
||||
|
||||
```csharp
|
||||
public string? Validate()
|
||||
{
|
||||
foreach (var r in Rows)
|
||||
{
|
||||
if (r.DaysMask() == 0)
|
||||
return $"Schedule {r.TimeOfDay:hh\\:mm}: select at least one day.";
|
||||
if (r.TimeOfDay < TimeSpan.Zero || r.TimeOfDay >= TimeSpan.FromDays(1))
|
||||
return "Time must be between 00:00 and 23:59.";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
```
|
||||
|
||||
```csharp
|
||||
[RelayCommand]
|
||||
private void AddSchedule()
|
||||
{
|
||||
var dto = new PrimeScheduleDto(
|
||||
Id: Guid.NewGuid(),
|
||||
Days: 31, // Mon–Fri
|
||||
TimeOfDay: new TimeSpan(7, 0, 0),
|
||||
Enabled: true,
|
||||
LastRunAt: null,
|
||||
PromptOverride: null);
|
||||
Rows.Add(new PrimeScheduleRowViewModel(dto, isExisting: false));
|
||||
}
|
||||
```
|
||||
|
||||
`LoadAsync`, `SaveAsync`, `RemoveSchedule`, `ApplyFiredEvent` are unchanged.
|
||||
|
||||
- [ ] **Step 4: Rewrite the tab VM tests**
|
||||
|
||||
Replace the body of `tests/ClaudeDo.Ui.Tests/ViewModels/PrimeClaudeTabViewModelTests.cs`:
|
||||
|
||||
```csharp
|
||||
using ClaudeDo.Ui.Services;
|
||||
using ClaudeDo.Ui.ViewModels.Modals.Settings;
|
||||
|
||||
namespace ClaudeDo.Ui.Tests.ViewModels;
|
||||
|
||||
public class PrimeClaudeTabViewModelTests
|
||||
{
|
||||
private sealed class FakeApi : IPrimeScheduleApi
|
||||
{
|
||||
public List<PrimeScheduleDto> Stored { get; } = new();
|
||||
public List<PrimeScheduleDto> Upserts { get; } = new();
|
||||
public List<Guid> Deletes { get; } = new();
|
||||
public Task<List<PrimeScheduleDto>> ListAsync() => Task.FromResult(Stored.ToList());
|
||||
public Task<PrimeScheduleDto?> UpsertAsync(PrimeScheduleDto dto)
|
||||
{
|
||||
Upserts.Add(dto);
|
||||
return Task.FromResult<PrimeScheduleDto?>(dto);
|
||||
}
|
||||
public Task DeleteAsync(Guid id) { Deletes.Add(id); return Task.CompletedTask; }
|
||||
}
|
||||
|
||||
private static PrimeScheduleDto Dto(Guid id, int days, TimeSpan time) =>
|
||||
new(id, days, time, true, null, null);
|
||||
|
||||
[Fact]
|
||||
public async Task Load_Populates_Rows()
|
||||
{
|
||||
var api = new FakeApi();
|
||||
api.Stored.Add(Dto(Guid.NewGuid(), 31, new TimeSpan(7, 0, 0)));
|
||||
var vm = new PrimeClaudeTabViewModel(api);
|
||||
await vm.LoadAsync();
|
||||
Assert.Single(vm.Rows);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AddSchedule_Appends_Row_With_Defaults()
|
||||
{
|
||||
var vm = new PrimeClaudeTabViewModel(new FakeApi());
|
||||
vm.AddScheduleCommand.Execute(null);
|
||||
Assert.Single(vm.Rows);
|
||||
Assert.True(vm.Rows[0].Enabled);
|
||||
Assert.True(vm.Rows[0].Monday);
|
||||
Assert.True(vm.Rows[0].Friday);
|
||||
Assert.False(vm.Rows[0].Saturday);
|
||||
Assert.Equal(new TimeSpan(7, 0, 0), vm.Rows[0].TimeOfDay);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Row_Decomposes_And_Recomposes_Days()
|
||||
{
|
||||
var vm = new PrimeClaudeTabViewModel(new FakeApi());
|
||||
vm.AddScheduleCommand.Execute(null);
|
||||
var row = vm.Rows[0];
|
||||
Assert.Equal(31, row.DaysMask());
|
||||
row.Saturday = true;
|
||||
Assert.Equal(63, row.DaysMask());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Save_Diffs_New_And_Removed_Rows()
|
||||
{
|
||||
var api = new FakeApi();
|
||||
var keptId = Guid.NewGuid();
|
||||
var deletedId = Guid.NewGuid();
|
||||
api.Stored.Add(Dto(keptId, 31, new TimeSpan(7, 0, 0)));
|
||||
api.Stored.Add(Dto(deletedId, 31, new TimeSpan(8, 0, 0)));
|
||||
|
||||
var vm = new PrimeClaudeTabViewModel(api);
|
||||
await vm.LoadAsync();
|
||||
vm.RemoveScheduleCommand.Execute(vm.Rows.Single(r => r.Id == deletedId));
|
||||
vm.AddScheduleCommand.Execute(null);
|
||||
|
||||
await vm.SaveAsync();
|
||||
|
||||
Assert.Contains(deletedId, api.Deletes);
|
||||
Assert.Equal(2, api.Upserts.Count);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Validate_Reports_No_Days_Selected()
|
||||
{
|
||||
var vm = new PrimeClaudeTabViewModel(new FakeApi());
|
||||
vm.AddScheduleCommand.Execute(null);
|
||||
var row = vm.Rows[0];
|
||||
row.Monday = row.Tuesday = row.Wednesday = row.Thursday = row.Friday = false;
|
||||
Assert.NotNull(vm.Validate());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Validate_Passes_With_One_Day()
|
||||
{
|
||||
var vm = new PrimeClaudeTabViewModel(new FakeApi());
|
||||
vm.AddScheduleCommand.Execute(null);
|
||||
Assert.Null(vm.Validate());
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
- [ ] **Step 5: Run UI tests**
|
||||
|
||||
Run: `dotnet test tests/ClaudeDo.Ui.Tests --filter FullyQualifiedName~PrimeClaudeTabViewModelTests`
|
||||
Expected: PASS.
|
||||
|
||||
- [ ] **Step 6: Commit**
|
||||
|
||||
```bash
|
||||
git add src/ClaudeDo.Ui/Services/PrimeScheduleDto.cs src/ClaudeDo.Ui/ViewModels/Modals/Settings/PrimeScheduleRowViewModel.cs src/ClaudeDo.Ui/ViewModels/Modals/Settings/PrimeClaudeTabViewModel.cs tests/ClaudeDo.Ui.Tests/ViewModels/PrimeClaudeTabViewModelTests.cs
|
||||
git commit -m "feat(ui): drive prime schedule rows from weekday toggles"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Task 8: XAML — toggle-button row
|
||||
|
||||
**Files:**
|
||||
- Modify: `src/ClaudeDo.Ui/Design/IslandStyles.axaml`
|
||||
- Modify: `src/ClaudeDo.Ui/Views/Modals/SettingsModalView.axaml`
|
||||
|
||||
- [ ] **Step 1: Add a `day-toggle` style class**
|
||||
|
||||
Append to `src/ClaudeDo.Ui/Design/IslandStyles.axaml` (inside the root `<Styles>` element, alongside the other style selectors). Uses existing dynamic-resource tokens — no hardcoded colors:
|
||||
|
||||
```xml
|
||||
<Style Selector="ToggleButton.day-toggle">
|
||||
<Setter Property="MinWidth" Value="34"/>
|
||||
<Setter Property="Padding" Value="6,4"/>
|
||||
<Setter Property="Margin" Value="0"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||
<Setter Property="Background" Value="{DynamicResource DeepBrush}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextBrush}"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource LineBrush}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="CornerRadius" Value="4"/>
|
||||
</Style>
|
||||
<Style Selector="ToggleButton.day-toggle:checked /template/ ContentPresenter">
|
||||
<Setter Property="Background" Value="{DynamicResource AccentBrush}"/>
|
||||
</Style>
|
||||
```
|
||||
|
||||
If `AccentBrush` is not a defined token, use the brush the project uses for primary/selected affordances (check the `primary` button style in this file and reuse that brush). Final visual pass is the user's.
|
||||
|
||||
- [ ] **Step 2: Replace the Prime row template**
|
||||
|
||||
In `src/ClaudeDo.Ui/Views/Modals/SettingsModalView.axaml`, replace the `<Grid ...>` inside the Prime `DataTemplate` (currently columns `Auto,*,Auto,Auto,Auto,Auto` with the `ThemedDatePicker` and Mon–Fri checkbox) with:
|
||||
|
||||
```xml
|
||||
<Grid ColumnDefinitions="Auto,*,Auto,Auto,Auto" ColumnSpacing="8">
|
||||
<CheckBox Grid.Column="0" IsChecked="{Binding Enabled, Mode=TwoWay}" VerticalAlignment="Center"/>
|
||||
<StackPanel Grid.Column="1" Orientation="Horizontal" Spacing="4" VerticalAlignment="Center">
|
||||
<ToggleButton Classes="day-toggle" Content="Mo" IsChecked="{Binding Monday, Mode=TwoWay}"/>
|
||||
<ToggleButton Classes="day-toggle" Content="Tu" IsChecked="{Binding Tuesday, Mode=TwoWay}"/>
|
||||
<ToggleButton Classes="day-toggle" Content="We" IsChecked="{Binding Wednesday, Mode=TwoWay}"/>
|
||||
<ToggleButton Classes="day-toggle" Content="Th" IsChecked="{Binding Thursday, Mode=TwoWay}"/>
|
||||
<ToggleButton Classes="day-toggle" Content="Fr" IsChecked="{Binding Friday, Mode=TwoWay}"/>
|
||||
<ToggleButton Classes="day-toggle" Content="Sa" IsChecked="{Binding Saturday, Mode=TwoWay}"/>
|
||||
<ToggleButton Classes="day-toggle" Content="Su" IsChecked="{Binding Sunday, Mode=TwoWay}"/>
|
||||
</StackPanel>
|
||||
<TextBox Grid.Column="2" Width="64"
|
||||
Text="{Binding TimeOfDay, Mode=TwoWay, Converter={StaticResource TimeSpanToHhmm}}"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBlock Classes="meta" Grid.Column="3" Text="{Binding LastRunLabel}" VerticalAlignment="Center"
|
||||
MinWidth="80"/>
|
||||
<Button Classes="icon-btn" Grid.Column="4" Content="✕"
|
||||
Command="{Binding $parent[ItemsControl].((vm:SettingsModalViewModel)DataContext).Prime.RemoveScheduleCommand}"
|
||||
CommandParameter="{Binding}"/>
|
||||
</Grid>
|
||||
```
|
||||
|
||||
- [ ] **Step 3: Update the explainer text**
|
||||
|
||||
Replace the intro `TextBlock` Text in the Prime tab (`SettingsModalView.axaml`):
|
||||
|
||||
```xml
|
||||
Text="Prime your Claude usage window by firing a single non-interactive ping on the days you choose, at a chosen time. Only runs while ClaudeDo is open. If the app starts within 30 minutes of the target time, the ping fires immediately."/>
|
||||
```
|
||||
|
||||
- [ ] **Step 4: Remove the now-unused range converter (only if unreferenced)**
|
||||
|
||||
The `DateOnlyToDateTime` resource on line 23 was used only by the range picker. Grep the file: if `DateOnlyToDateTime` has no other reference, remove the `<conv:DateOnlyToDateTimeConverter x:Key="DateOnlyToDateTime"/>` line. Keep `TimeSpanToHhmm` (still used).
|
||||
|
||||
Run: `dotnet build src/ClaudeDo.App/ClaudeDo.App.csproj`
|
||||
Expected: PASS.
|
||||
|
||||
- [ ] **Step 5: Manual UI check**
|
||||
|
||||
Start the worker, then the app. Open Settings → Prime Claude. Verify: a row shows 7 toggle buttons with Mon–Fri lit by default; toggling Sat/Sun persists after Save+reopen; clearing all days shows the validation error on Save. (UI correctness can only be confirmed in the running app — state so explicitly if it cannot be run.)
|
||||
|
||||
- [ ] **Step 6: Commit**
|
||||
|
||||
```bash
|
||||
git add src/ClaudeDo.Ui/Design/IslandStyles.axaml src/ClaudeDo.Ui/Views/Modals/SettingsModalView.axaml
|
||||
git commit -m "feat(ui): replace prime date range with weekday toggle buttons"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Task 9: Docs
|
||||
|
||||
**Files:**
|
||||
- Modify: `src/ClaudeDo.Data/CLAUDE.md`
|
||||
- Modify: `CLAUDE.md`
|
||||
|
||||
- [ ] **Step 1: Update the Data CLAUDE.md**
|
||||
|
||||
In `src/ClaudeDo.Data/CLAUDE.md`, the Models section has no PrimeSchedule line today; add one under Models, and confirm the `prime_schedules` table mention in the Schema section stays accurate:
|
||||
|
||||
```markdown
|
||||
- **PrimeScheduleEntity** — Id, Days (`[Flags] PrimeDays` weekday bitmask, stored as `days_of_week` int), TimeOfDay, Enabled, LastRunAt, PromptOverride, CreatedAt. Recurs on the selected weekdays; no date range.
|
||||
```
|
||||
|
||||
- [ ] **Step 2: Update the root CLAUDE.md if Prime is described**
|
||||
|
||||
Grep `CLAUDE.md` for "Prime"; if there is a Prime description mentioning a date range, update it to "recurring weekday schedule". If there is no such line, make no change.
|
||||
|
||||
- [ ] **Step 3: Full test sweep**
|
||||
|
||||
Run: `dotnet test tests/ClaudeDo.Worker.Tests && dotnet test tests/ClaudeDo.Ui.Tests`
|
||||
Expected: PASS.
|
||||
|
||||
- [ ] **Step 4: Commit**
|
||||
|
||||
```bash
|
||||
git add src/ClaudeDo.Data/CLAUDE.md CLAUDE.md
|
||||
git commit -m "docs: describe recurring-weekday Prime schedule"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Self-Review Notes
|
||||
|
||||
- **Spec coverage:** data model (T1), scheduling logic (T4), UI toggles (T7–T8), migration+backfill (T3), both DTOs (T4/T7), tests (T4–T7), out-of-scope items excluded. ✓
|
||||
- **Type consistency:** entity `PrimeDays Days`; both DTOs `int Days`; hub/scheduler cast `(int)`/`(PrimeDays)` at boundaries; calculator casts `(PrimeDays)s.Days`; row VM exposes 7 bools + `DaysMask()`. ✓
|
||||
- **Build ripple:** a single type change breaks several projects at once, so some intermediate steps note expected build failures; the gating green builds are T3 Step 4 (Data), T6 Step 4 (Worker + tests), T8 Step 4 (App). ✓
|
||||
```
|
||||
1481
docs/superpowers/plans/2026-06-03-localization.md
Normal file
1481
docs/superpowers/plans/2026-06-03-localization.md
Normal file
File diff suppressed because it is too large
Load Diff
2311
docs/superpowers/plans/2026-06-03-weekly-report.md
Normal file
2311
docs/superpowers/plans/2026-06-03-weekly-report.md
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,123 @@
|
||||
# Waiting for Review — Task State — Design
|
||||
|
||||
**Date:** 2026-06-01
|
||||
**Status:** Approved (brainstorming)
|
||||
**Scope:** `ClaudeDo.Data` (TaskEntity, EF config + migration), `ClaudeDo.Worker` (TaskStateService, TaskRunner, QueueService, WorkerHub, ExternalMcpService), `ClaudeDo.Ui` (StatusColorConverter, TaskRowViewModel, views), CLAUDE.md docs
|
||||
|
||||
## Problem
|
||||
|
||||
A successful task run currently transitions straight to `Done` and is considered complete. There is no gate for a human (or another agent) to review the result before it is accepted. We want review to be a mandatory step: after a successful run a task waits for an explicit approval, and a reviewer can send it back with feedback for another turn.
|
||||
|
||||
## Goals
|
||||
|
||||
- Add a `WaitingForReview` lifecycle state that a task enters automatically after a **successful** run.
|
||||
- Reviewer can **approve** (→ `Done`), **reject-and-re-run** (→ `Queued`, resuming the same Claude session with required feedback), **reject-and-park** (→ `Idle`), or **cancel** (→ `Cancelled`).
|
||||
- Reject-and-re-run reuses the existing session-resume mechanism so the agent continues with full context.
|
||||
- Both the desktop UI and the external MCP surface can perform review actions.
|
||||
|
||||
## Non-Goals
|
||||
|
||||
- No change to the failure path: a **failed** run still goes straight to `Failed`, never to `WaitingForReview`.
|
||||
- No change to planning-phase finalization. A planning parent that generates child tasks keeps its current behavior and does **not** route through review. Only ordinary executable runs (`Running` → success) are affected.
|
||||
- No change to worktree state flow (`Active | Merged | Discarded | Kept`).
|
||||
- No change to the in-run auto-retry-on-failure behavior; only the *final* successful completion routes to review.
|
||||
|
||||
## Design
|
||||
|
||||
### 1. State machine
|
||||
|
||||
Changed/added transitions in **bold**:
|
||||
|
||||
| From | To | Trigger |
|
||||
|---|---|---|
|
||||
| Idle | Queued | enqueue (unchanged) |
|
||||
| Queued | Running | queue picker claim (unchanged) |
|
||||
| Running | **WaitingForReview** | **successful run (was → Done)** |
|
||||
| Running | Failed | failed run (unchanged) |
|
||||
| Running | Cancelled | cancel during run (unchanged) |
|
||||
| **WaitingForReview** | **Done** | **approve** |
|
||||
| **WaitingForReview** | **Queued** | **reject + required feedback → resume re-run** |
|
||||
| **WaitingForReview** | **Idle** | **reject → park for manual edit** |
|
||||
| **WaitingForReview** | **Cancelled** | **abandon an almost-done task** |
|
||||
| Done \| Failed \| Cancelled | Idle | reset (unchanged) |
|
||||
|
||||
### 2. Data model
|
||||
|
||||
`ClaudeDo.Data`:
|
||||
|
||||
- `TaskStatus` enum (`Models/TaskEntity.cs`): add `WaitingForReview` after `Running`.
|
||||
- EF string converter (`Configuration/TaskEntityConfiguration.cs`): map `WaitingForReview` ⇄ `"waiting_for_review"` (TEXT column, no schema constraint to change).
|
||||
- New nullable column **`ReviewFeedback : string?`** on `TaskEntity`. Holds the reviewer's rejection comment until the re-run consumes it, then it is cleared. Persisted so it survives a worker restart and is visible to the UI.
|
||||
- One EF migration: add the `review_feedback` column. No backfill — the new status value and column are only written going forward.
|
||||
|
||||
### 3. Worker — status transitions (`State/TaskStateService.cs`)
|
||||
|
||||
`TaskStateService` remains the sole owner of status writes. New/changed methods:
|
||||
|
||||
- `SubmitForReviewAsync(taskId)` — `Running` → `WaitingForReview`. Sets `FinishedAt` and `Result` exactly as `CompleteAsync` does today. Called by `TaskRunner` on success **instead of** `CompleteAsync`. (`CompleteAsync` is retained for the approve path.)
|
||||
- `ApproveReviewAsync(taskId)` — `WaitingForReview` → `Done`.
|
||||
- `RejectToQueueAsync(taskId, feedback)` — `WaitingForReview` → `Queued`. Rejects empty/whitespace feedback with a failed `TransitionResult`. Stores `feedback` in `ReviewFeedback`. Wakes the queue.
|
||||
- `RejectToIdleAsync(taskId)` — `WaitingForReview` → `Idle`. Parks for manual editing; leaves `Result` intact, clears `ReviewFeedback`.
|
||||
- `CancelAsync` — extend the allowed source states to include `WaitingForReview`.
|
||||
|
||||
Each transition broadcasts `TaskUpdated` as today. Invalid source states return a failed `TransitionResult` (no throw), matching existing convention.
|
||||
|
||||
### 4. Resume-aware re-run (`Queue/QueueService.cs`)
|
||||
|
||||
The queue picker still atomically claims a `Queued`, unblocked task (`UPDATE … SET status='running' … RETURNING *`). The `RETURNING` row already carries `ReviewFeedback`. After a successful claim, `QueueService` branches:
|
||||
|
||||
1. **`ReviewFeedback` set + latest run has a `SessionId`** → `TaskRunner.ContinueAsync(task, feedback)` — `--resume {sessionId}` with `feedback` as the next-turn prompt.
|
||||
2. **`ReviewFeedback` set, no prior `SessionId`** (edge case) → `TaskRunner.RunAsync` with the feedback appended to the task prompt, so the comment is not lost.
|
||||
3. **No `ReviewFeedback`** → normal `TaskRunner.RunAsync` (fresh session).
|
||||
|
||||
`ReviewFeedback` is cleared once consumed (single UPDATE), so a later re-run does not re-apply stale feedback.
|
||||
|
||||
### 5. External MCP surface (`External/ExternalMcpService.cs`)
|
||||
|
||||
- New tool **`review_task(taskId, decision, feedback?)`**, `decision ∈ {approve, reject_rerun, reject_park, cancel}`. `feedback` is required when `decision = reject_rerun` (validation error otherwise). Maps onto the `TaskStateService` methods in §3. This lets automation / other agents act as reviewers.
|
||||
- `get_task_status_values` — add `WaitingForReview` with a description covering the four exit actions.
|
||||
- `list_tasks` status-filter parsing and validation message — include `WaitingForReview`.
|
||||
- `get_task` lifecycle description text — update to `Idle → Queued → Running → WaitingForReview → Done | Failed | Cancelled`.
|
||||
- `update_task_status` stays restricted to `Idle` and `Queued`; all review decisions go through `review_task` (keeps the "set status freely" affordance and the review affordance distinct).
|
||||
|
||||
### 6. Worker hub (`Hub/WorkerHub.cs` + `Hub/HubBroadcaster.cs`)
|
||||
|
||||
New hub methods called by the UI, each delegating to `TaskStateService`:
|
||||
|
||||
- `ApproveReview(taskId)`
|
||||
- `RejectReviewToQueue(taskId, feedback)`
|
||||
- `RejectReviewToIdle(taskId)`
|
||||
|
||||
Cancel already exists. No new broadcast events — `TaskUpdated` covers it.
|
||||
|
||||
### 7. UI (`ClaudeDo.Ui`)
|
||||
|
||||
- `Converters/StatusColorConverter.cs`: add a `waiting_for_review` case. Snap to an existing color token from the scale; final visual pass is left to the user (per project convention — centralize/tokenize, user does the visual pass).
|
||||
- `ViewModels/Islands/TaskRowViewModel.cs`: add `IsWaitingForReview` computed property and commands **Approve**, **RejectRerun**, **RejectPark**, **Cancel** (the last reuses the existing cancel command). Commands are enabled only when `Status == WaitingForReview`.
|
||||
- Reject-Rerun opens a small flyout/dialog with a required multi-line feedback text box; on confirm it calls `RejectReviewToQueue(taskId, feedback)`.
|
||||
- Wire the commands to the new SignalR client methods.
|
||||
|
||||
### 8. Docs
|
||||
|
||||
Update the status flow in:
|
||||
|
||||
- root `CLAUDE.md` — "Task status flow" line.
|
||||
- `src/ClaudeDo.Data/CLAUDE.md` — TaskEntity status list.
|
||||
- `src/ClaudeDo.Worker/CLAUDE.md` — status-model transition table.
|
||||
|
||||
## Testing
|
||||
|
||||
`ClaudeDo.Worker.Tests` (real SQLite + real git, existing harness):
|
||||
|
||||
- `SubmitForReviewAsync`: a successful run lands in `WaitingForReview`, not `Done`.
|
||||
- `ApproveReviewAsync`: `WaitingForReview` → `Done`.
|
||||
- `RejectToQueueAsync`: empty feedback rejected; valid feedback stored in `ReviewFeedback` and status → `Queued`.
|
||||
- `RejectToIdleAsync`: → `Idle`, `Result` preserved, `ReviewFeedback` cleared.
|
||||
- `CancelAsync` from `WaitingForReview` → `Cancelled`.
|
||||
- Invalid source states (e.g. approve from `Idle`) return a failed `TransitionResult`.
|
||||
- Resume-aware re-run: a task with `ReviewFeedback` + a prior `SessionId`, when claimed, resumes the session with the feedback as the prompt and clears `ReviewFeedback`.
|
||||
- `review_task` MCP tool: each decision maps to the correct transition; `reject_rerun` without feedback errors.
|
||||
|
||||
## Open questions
|
||||
|
||||
None outstanding. Planning-task exclusion (Non-Goals) is the one assumption to verify against the planning-finalization code path during implementation; if planning finalization shares `CompleteAsync`, route only the executable-run success site through `SubmitForReviewAsync`.
|
||||
@@ -0,0 +1,116 @@
|
||||
# Prime: recurring weekday schedule
|
||||
|
||||
**Date:** 2026-06-02
|
||||
**Status:** Approved
|
||||
|
||||
## Problem
|
||||
|
||||
The Prime feature fires a single non-interactive "ping" prompt to warm up the
|
||||
Claude usage window. Today a schedule is defined by a **date range**
|
||||
(`StartDate`/`EndDate`) plus a `TimeOfDay` and a single `WorkdaysOnly` toggle.
|
||||
This is awkward for the real use case: the user wants a *recurring* morning ping
|
||||
on specific weekdays, not a bounded calendar window.
|
||||
|
||||
Desired behavior: pick the **days of the week** (e.g. Mon–Fri) and a **time**.
|
||||
The schedule recurs forever. Whenever the worker is running and it is one of the
|
||||
selected days, the ping fires at (or shortly after) the chosen time. Concretely:
|
||||
the worker autostarts on login, detects it is an eligible day around the target
|
||||
time, and fires the ping.
|
||||
|
||||
## Decisions
|
||||
|
||||
- **Catch-up window:** unchanged. Keep the existing 30-minute catch-up — if the
|
||||
worker boots within 30 min after the target time, the ping fires immediately;
|
||||
otherwise it waits for the next eligible day. (User chose "keep current 30 min".)
|
||||
- **Day picker UI:** seven compact **toggle buttons** in one row (Mo Tu We Th Fr
|
||||
Sa Su), highlighted when selected — not labeled checkboxes.
|
||||
|
||||
## Design
|
||||
|
||||
### 1. Data model
|
||||
|
||||
`PrimeScheduleEntity` (`ClaudeDo.Data/Models`):
|
||||
|
||||
- **Remove:** `StartDate`, `EndDate`, `WorkdaysOnly`
|
||||
- **Add:** `Days` — a `[Flags] enum PrimeDays` (`Monday=1, Tuesday=2, Wednesday=4,
|
||||
Thursday=8, Friday=16, Saturday=32, Sunday=64`), stored as a single
|
||||
`days_of_week INTEGER` column.
|
||||
- **Keep:** `TimeOfDay`, `Enabled`, `LastRunAt`, `PromptOverride`, `CreatedAt`.
|
||||
|
||||
Rationale for a bitmask over a CSV string or 7 bool columns: one column, trivial
|
||||
EF mapping (int), and a clean eligibility check.
|
||||
|
||||
`PrimeScheduleEntityConfiguration`: drop the `start_date`/`end_date`/
|
||||
`workdays_only` property mappings; map `Days` to `days_of_week` (int, required,
|
||||
default 31 = Mon–Fri).
|
||||
|
||||
### 2. Scheduling logic — `NextDueCalculator`
|
||||
|
||||
- Drop all `StartDate`/`EndDate` gating (the `EndDate < today` early-out, the
|
||||
`StartDate > today` clamps, and the bounds check in `IsEligibleDay`).
|
||||
- `IsEligibleDay(s, d)` becomes: does `s.Days` contain the flag for
|
||||
`d.DayOfWeek`? (Map `System.DayOfWeek` → `PrimeDays`.)
|
||||
- The existing forward search (loops up to 8 days ahead) now simply walks to the
|
||||
next selected weekday.
|
||||
- `alreadyFiredToday` (compares `LastRunAt`'s local date to today) is unchanged.
|
||||
- The 30-min catch-up (`FireImmediately`) is unchanged.
|
||||
- A schedule with `Days == 0` (none selected) is never eligible. UI validation
|
||||
prevents saving that state.
|
||||
|
||||
### 3. UI — `SettingsModalView.axaml` + `PrimeScheduleRowViewModel`
|
||||
|
||||
Row template changes:
|
||||
- **Remove** the `ThemedDatePicker` (range) and the single "Mon–Fri" checkbox.
|
||||
- **Add** a horizontal row of 7 `ToggleButton`s (Mo Tu We Th Fr Sa Su), styled
|
||||
to highlight when checked, bound to seven bool properties on the row VM.
|
||||
- Keep the enabled checkbox, the time `TextBox`, the last-run label, and the
|
||||
remove button.
|
||||
|
||||
`PrimeScheduleRowViewModel`:
|
||||
- Replace `StartDate`/`EndDate`/`WorkdaysOnly` with seven `[ObservableProperty]`
|
||||
bools: `Monday`…`Sunday`.
|
||||
- Constructor decomposes `dto.Days` into the seven bools.
|
||||
- `ToDto()` composes the seven bools back into the `Days` int.
|
||||
|
||||
`PrimeClaudeTabViewModel`:
|
||||
- `AddSchedule` default: Mon–Fri selected, time 07:00, enabled.
|
||||
- `Validate`: replace the `StartDate > EndDate` check with "at least one day must
|
||||
be selected"; keep the time-range (00:00–23:59) check.
|
||||
|
||||
Update the explainer `TextBlock` text to describe weekday recurrence (keep the
|
||||
"fires immediately if started within 30 minutes of the target time" note).
|
||||
|
||||
### 4. Migration
|
||||
|
||||
New EF Core migration in `ClaudeDo.Data/Migrations`:
|
||||
- Add `days_of_week INTEGER NOT NULL DEFAULT 31`.
|
||||
- Backfill from existing rows: `workdays_only = 1` → `31` (Mon–Fri),
|
||||
`workdays_only = 0` → `127` (all 7 days).
|
||||
- Drop `start_date`, `end_date`, `workdays_only`.
|
||||
- Update the model snapshot.
|
||||
|
||||
### 5. DTOs
|
||||
|
||||
Both copies of `PrimeScheduleDto` (Worker `ClaudeDo.Worker.Prime` and UI
|
||||
`ClaudeDo.Ui.Services`) are passed over SignalR and must stay structurally
|
||||
compatible. In both: remove `StartDate`, `EndDate`, `WorkdaysOnly`; add a single
|
||||
`int Days` field (serializes cleanly as JSON; avoids sharing the enum across
|
||||
projects). `PrimeScheduler.ToDto` maps `entity.Days` → `(int)`.
|
||||
|
||||
`PrimeScheduleRepository`: update `UpsertAsync` (copy `Days` instead of the three
|
||||
removed fields) and `ListAsync` ordering (order by `TimeOfDay` instead of
|
||||
`StartDate`).
|
||||
|
||||
### 6. Tests
|
||||
|
||||
- `NextDueCalculatorTests` — rewrite cases around weekday sets (e.g. Mon–Fri
|
||||
skips weekend; single-day schedule; catch-up still fires; already-fired-today
|
||||
skips to next eligible day).
|
||||
- `PrimeSchedulerTests` — update fixture DTOs to the new shape.
|
||||
- `PrimeScheduleRepositoryTests` — update entity construction and assertions.
|
||||
- `PrimeClaudeTabViewModelTests` — update for the day-bool VM and new validation.
|
||||
|
||||
## Out of scope
|
||||
|
||||
- Per-schedule catch-up tuning (rejected; fixed 30 min).
|
||||
- Multiple times per day, timezones, or holiday calendars.
|
||||
114
docs/superpowers/specs/2026-06-03-localization-design.md
Normal file
114
docs/superpowers/specs/2026-06-03-localization-design.md
Normal file
@@ -0,0 +1,114 @@
|
||||
# Localization (i18n) Support — Design
|
||||
|
||||
**Date:** 2026-06-03
|
||||
**Status:** Approved (pending spec review)
|
||||
|
||||
## Goal
|
||||
|
||||
Add translation support to ClaudeDo. The user picks a language in the Settings modal and **all** UI text reflects it instantly (no restart). The WPF installer is localized the same way and gets its own language picker. Ship **English only** now, but the system is fully data-driven: adding a new language means dropping one JSON file into a folder — **no code changes, no rebuild**.
|
||||
|
||||
## Decisions (from brainstorming)
|
||||
|
||||
- **Languages:** English only at launch; extensible via translation files.
|
||||
- **Switching:** Live / instant — all bound UI text updates the moment the language changes.
|
||||
- **Storage:** Selected language stored in `~/.todo-app/ui.config.json` (the local UI config that also holds `DbPath`/`SignalRUrl`). Purely a UI concern — does **not** go through the worker/SignalR settings path.
|
||||
- **Installer:** Defaults to existing config language (upgrade) → OS culture → English. Shows a language picker in the wizard, live-switches its own UI, and writes the chosen language into `ui.config.json` so the app launches matching the installer.
|
||||
- **Locale files:** Loose `*.json` files in a `locales/` folder next to the running exe, scanned at startup to discover available languages.
|
||||
- **Code sharing:** A shared `ClaudeDo.Localization` project holds the loading/lookup/language-list logic, referenced by `ClaudeDo.Ui`, `ClaudeDo.App`, and `ClaudeDo.Installer`. Each UI framework keeps its own thin markup-extension binding layer (Avalonia ≠ WPF).
|
||||
|
||||
## Architecture & Components
|
||||
|
||||
### New shared project: `ClaudeDo.Localization`
|
||||
|
||||
- **`LocaleStore`** — discovers and loads `*.json` files from the `locales/` folder next to the running exe. Parses each file's nested JSON, **flattens it into an internal `Dictionary<string,string>`** keyed by dot-path for O(1) lookup, and captures `metadata.code` / `metadata.name`. Exposes the list of available languages for the dropdowns.
|
||||
- **`ILocalizer` / `Localizer`** — singleton holding the *active* language dictionary. Members:
|
||||
- indexer `this[string key]` → translated string (with fallback),
|
||||
- `string Get(string key, params object[] args)` → `string.Format` for parameterized strings,
|
||||
- `void SetLanguage(string code)` → swaps the active dictionary and raises `PropertyChanged` for the indexer so **all live bindings refresh** (this is what enables instant switching),
|
||||
- `AvailableLanguages` (list of `{ code, name }`), `CurrentCode`.
|
||||
- **Fallback chain:** requested key in active language → same key in English → the key path string itself (a missing translation is visible, never a crash).
|
||||
- **OS-culture resolution:** helper that maps the current OS UI culture to an available locale code, falling back to English.
|
||||
|
||||
### Per-framework binding layer (not shared)
|
||||
|
||||
- **Avalonia:** a `{loc:Tr Some.Key}` markup extension that binds to `Localizer[key]` (Source = the singleton `Localizer`, Path = `[key]`). Language change raises the indexer `PropertyChanged`, refreshing every binding.
|
||||
- **WPF installer:** an equivalent markup extension doing the same against the installer's own `Localizer` instance.
|
||||
|
||||
Both consume the **same JSON files and the same `LocaleStore`/`Localizer` logic** from the shared project.
|
||||
|
||||
## Translation File Format
|
||||
|
||||
`locales/en.json` (and future `de.json`, `fr.json`, …) — nested, human-friendly hierarchy:
|
||||
|
||||
```json
|
||||
{
|
||||
"metadata": { "code": "en", "name": "English" },
|
||||
"settings": {
|
||||
"save": "Save",
|
||||
"cancel": "Cancel",
|
||||
"general": { "model": "Model", "maxParallel": "Max parallel executions" }
|
||||
},
|
||||
"tasks": {
|
||||
"addPlaceholder": "Add a task…",
|
||||
"overdue": "OVERDUE"
|
||||
},
|
||||
"worktrees": { "autoCleanupDays": "{0} days" }
|
||||
}
|
||||
```
|
||||
|
||||
- `metadata.code` is the language id stored in `ui.config.json` and matched to OS culture; `metadata.name` is the dropdown label.
|
||||
- **Lookup by dot-path key** (`"settings.general.model"`). On-disk file stays grouped/nested; the runtime flattens it for fast lookup. Authors edit a clean hierarchy.
|
||||
- **Parameters:** `{0}`, `{1}` placeholders resolved via `Get(key, args)`.
|
||||
- **Encoding:** UTF-8 — non-ASCII languages work out of the box.
|
||||
|
||||
## Data Flow & Wiring
|
||||
|
||||
### App config
|
||||
|
||||
- Add `Language` (string, e.g. `"en"`) to `AppSettings` (`ClaudeDo.Ui/AppSettings.cs`) and to the installer mirror `InstallerAppSettings` (`ClaudeDo.Installer/Core/ConfigModels.cs`).
|
||||
- Add a `Save()` method to `AppSettings` (today the UI only reads it).
|
||||
|
||||
### App startup (`ClaudeDo.App/Program.cs`)
|
||||
|
||||
1. `AppSettings.Load()` reads `Language` (missing/empty → resolve from OS culture, else `"en"`).
|
||||
2. `LocaleStore` scans `locales/` next to the exe; `Localizer` is registered as a singleton and set to the configured language.
|
||||
3. UI renders; every `{loc:Tr ...}` binding pulls from the active dictionary.
|
||||
|
||||
### Changing language in Settings (General tab)
|
||||
|
||||
- New "Language" dropdown bound to `Localizer.AvailableLanguages`; selection bound to current code.
|
||||
- On change → `Localizer.SetLanguage(code)` (instant UI refresh) **and** `AppSettings.Language = code; AppSettings.Save()`. Local UI state only — not routed through worker/SignalR.
|
||||
|
||||
### Installer (`ClaudeDo.Installer`)
|
||||
|
||||
- On launch: default language = existing `ui.config.json` `Language` if present (upgrade), else OS culture, else English.
|
||||
- Wizard gets a language dropdown (same `LocaleStore`, installer's own markup extension) → live-switches the installer UI.
|
||||
- When writing `ui.config.json`, persists the chosen `Language` so the app launches matching the installer.
|
||||
|
||||
### Build wiring
|
||||
|
||||
- `locales/*.json` copied to output (`CopyToOutputDirectory`) for both App and Installer.
|
||||
- Installer packages the `locales/` folder so it lands beside the installed exe.
|
||||
|
||||
## String-Extraction Scope
|
||||
|
||||
Mechanical but large; done screen-by-screen so each commit is reviewable, building one `en.json` as the single source of truth.
|
||||
|
||||
- **22 Avalonia `.axaml` views** — replace inline `Text="..."`, `Content="..."`, `PlaceholderText="..."`, and inline `ComboBoxItem` text with `{loc:Tr key}`.
|
||||
- **ViewModel strings** — user-facing literals built in C# (e.g. `HeaderTitle`, `StatusPill`, status text, parameterized messages) resolve via injected `ILocalizer` (`localizer.Get(...)`). Log messages and non-user-facing strings stay as-is. **Live-switch note:** a VM string resolved once will not refresh on language change. For VM-built user-facing text, either (a) prefer resolving in XAML via `{loc:Tr}` where possible, or (b) have the VM subscribe to the `Localizer` change event and re-raise `PropertyChanged` (or re-resolve) for its localized properties. Decide per-property during extraction.
|
||||
- **10 WPF installer files** — same treatment with the installer's markup extension; VM-driven headings (`Heading`, `NextButtonText`, etc.) go through `ILocalizer`.
|
||||
- **Enum-ish display values** (model names, permission modes, weekday names) — translate the *display* text while keeping the underlying value/binding intact.
|
||||
|
||||
## Testing
|
||||
|
||||
- `ClaudeDo.Localization` unit tests: load/flatten nested JSON, dot-path lookup, fallback chain (active→en→key), `{0}` formatting, OS-culture resolution.
|
||||
- `LocaleStore` discovery test (folder scan → available languages).
|
||||
- **Key-coverage test:** every locale file's flattened key set matches `en.json`; fails the build if `en.json` drifts from other locale files.
|
||||
- Settings round-trip test: `SetLanguage` updates `Localizer` **and** persists to `ui.config.json`.
|
||||
- Manual UI pass (user's visual review): confirm instant switching with a throwaway `de.json` stub during dev, then remove it.
|
||||
|
||||
## Out of Scope (YAGNI)
|
||||
|
||||
- Pluralization rules, RTL layout, per-string gender.
|
||||
- Translating the German weekly-report **body** (generated content — stays as-is).
|
||||
- Localizing log output and non-user-facing strings.
|
||||
226
docs/superpowers/specs/2026-06-03-weekly-report-design.md
Normal file
226
docs/superpowers/specs/2026-06-03-weekly-report-design.md
Normal file
@@ -0,0 +1,226 @@
|
||||
# Weekly Report — Design
|
||||
|
||||
**Date:** 2026-06-03
|
||||
**Status:** Approved (pending spec review)
|
||||
|
||||
## Goal
|
||||
|
||||
Generate a short, standup-focused report of what the user did over the past week,
|
||||
for the Wednesday standup. The report is built from the user's Claude Code session
|
||||
history across all repos, distilled and summarized by Claude. Personal repos under a
|
||||
configurable excluded path (default `C:\Private`) are left out. The user can author
|
||||
per-day bullet notes inside ClaudeDo (via the My Day list) that are folded into the
|
||||
report.
|
||||
|
||||
## Decisions (from brainstorming)
|
||||
|
||||
- **Data source:** all Claude Code history in `~/.claude/projects/*/*.jsonl`, both manual
|
||||
sessions and ClaudeDo-run tasks, grouped by repo.
|
||||
- **Exclusion:** a configurable list of path prefixes (default `["C:\\Private"]`). Any
|
||||
session whose `cwd` starts with an excluded prefix is dropped.
|
||||
- **Summarization:** Claude CLI summarizes. The Worker distills the logs, then runs a
|
||||
single one-shot `claude -p` call via the existing `ClaudeProcess` and returns the
|
||||
result markdown. No worktree, no task row, no queue.
|
||||
- **Period:** default "since last Wednesday → today", computed from a configurable
|
||||
standup weekday. The range is adjustable in the modal.
|
||||
- **Signal fed to Claude:** user prompts (intent), assistant closing summaries, and the
|
||||
user's daily notes. No git-commit scanning.
|
||||
- **Report shape:** German, grouped by day, first-person past-tense bullets, ~3-5
|
||||
bullets/day with trivia merged/dropped, notes blended into one deduplicated list per
|
||||
day. See the Report Prompt section.
|
||||
- **Placement:** a "Weekly Report" overlay modal opened from the toolbar, rendering via
|
||||
the existing `MarkdownView`.
|
||||
- **Output:** view-only in-app (no export).
|
||||
- **Notes UI:** authored in the My Day list via a pinned non-task "Notes" pseudo-row that
|
||||
repurposes the Details island into a bullet-notes editor. Per-day bullets with a day
|
||||
navigator (prev/next arrows + date picker + Today).
|
||||
- **Report persistence:** generated reports are stored, keyed by exact date range, and
|
||||
reused. Generation is button-driven (never automatic); a Regenerate button overwrites.
|
||||
|
||||
## Architecture Overview
|
||||
|
||||
```
|
||||
UI (WeeklyReportModal, Details-island notes mode)
|
||||
│ SignalR
|
||||
▼
|
||||
WorkerHub ── GetWeekReport / GenerateWeekReport / daily-notes CRUD
|
||||
│
|
||||
├── WeekReportService ──► ClaudeHistoryReader (scan ~/.claude/projects)
|
||||
│ │ (distilled activity)
|
||||
│ ├── DailyNoteRepository (notes in window)
|
||||
│ ├── ClaudeProcess (one-shot summarize)
|
||||
│ └── WeekReportRepository (store/reuse)
|
||||
└── DailyNoteRepository (CRUD)
|
||||
|
||||
Data: DailyNoteEntity, WeekReportEntity + repositories + EF migration
|
||||
AppSettingsEntity: ReportExcludedPaths, StandupWeekday
|
||||
```
|
||||
|
||||
## Components
|
||||
|
||||
### 1. Data layer (`ClaudeDo.Data`)
|
||||
|
||||
**`DailyNoteEntity`** (table `daily_notes`)
|
||||
- `Id` (GUID string, init-only PK)
|
||||
- `Date` (date-only; the day the bullet belongs to)
|
||||
- `Text` (string, the bullet content)
|
||||
- `SortOrder` (int; ordering within a day)
|
||||
- `CreatedAt` (DateTime)
|
||||
|
||||
**`DailyNoteRepository`** (async, CancellationToken, follows existing repo pattern)
|
||||
- `ListByDayAsync(DateOnly day)` — bullets for one day, ordered by `SortOrder`.
|
||||
- `ListBetweenAsync(DateOnly start, DateOnly end)` — bullets in a window (used by the report).
|
||||
- `AddAsync(DateOnly day, string text)` — appends a bullet (assigns next `SortOrder`).
|
||||
- `UpdateAsync(string id, string text)`
|
||||
- `DeleteAsync(string id)`
|
||||
|
||||
**`WeekReportEntity`** (table `week_reports`)
|
||||
- `Id` (GUID string, init-only PK)
|
||||
- `StartDate`, `EndDate` (date-only; the report window — unique together)
|
||||
- `Markdown` (string; the generated report)
|
||||
- `GeneratedAt` (DateTime)
|
||||
|
||||
**`WeekReportRepository`**
|
||||
- `GetByRangeAsync(DateOnly start, DateOnly end)` — stored report for an exact range, or null.
|
||||
- `UpsertAsync(DateOnly start, DateOnly end, string markdown)` — insert or overwrite by range.
|
||||
|
||||
**`AppSettingsEntity`** — two new columns:
|
||||
- `ReportExcludedPaths` (string, JSON array of path prefixes; default `["C:\\Private"]`)
|
||||
- `StandupWeekday` (int, `DayOfWeek`; default `Wednesday` = 3)
|
||||
|
||||
**Migration** — one EF migration adds `daily_notes`, `week_reports`, and the two
|
||||
`app_settings` columns. Entity configs in `Configuration/` (date-only and enum/JSON
|
||||
conversion via `ValueConverter`, per existing convention).
|
||||
|
||||
### 2. Worker (`ClaudeDo.Worker`) — new `Report/` folder
|
||||
|
||||
**`ClaudeHistoryReader`** (raw → distilled)
|
||||
- Input: date window + excluded path prefixes.
|
||||
- Enumerates `~/.claude/projects/*/*.jsonl`.
|
||||
- Parses each line as JSON; tolerant of malformed lines (skip, never throw).
|
||||
- Drops a session entirely if its `cwd` starts with any excluded prefix
|
||||
(case-insensitive, normalized separators).
|
||||
- Keeps messages whose `timestamp` falls in `[start, end]`.
|
||||
- Extracts, per repo (`cwd`) → per day:
|
||||
- **user prompts**: `type == "user"` text content (string or `content[].text`).
|
||||
Skip tool-result-only user turns and queue/attachment/hook noise.
|
||||
- **assistant closing summaries**: the final assistant text block of each turn/session.
|
||||
- Output: a structured model, e.g.
|
||||
`IReadOnlyList<RepoActivity>` where `RepoActivity { RepoPath, Days: List<DayActivity{ Date, Prompts[], Summaries[] }> }`.
|
||||
|
||||
**`WeekReportService`** (distilled → stored summary)
|
||||
- `GenerateAsync(start, end, ct)`:
|
||||
1. Read settings (excluded paths, standup weekday).
|
||||
2. `ClaudeHistoryReader` → distilled activity.
|
||||
3. `DailyNoteRepository.ListBetweenAsync` → notes grouped by day.
|
||||
4. Pivot the distilled activity (repo→day from the reader) into **day-major**
|
||||
(day→repo) to match the day-grouped report, and build the prompt from the
|
||||
template in the Report Prompt section. Empty window → produce a "no activity"
|
||||
report without calling Claude.
|
||||
5. Run `ClaudeProcess` once (`claude -p`, no worktree/agents; working dir = a neutral
|
||||
dir). Read `RunResult.ResultMarkdown`.
|
||||
6. `WeekReportRepository.UpsertAsync(start, end, markdown)`; return markdown.
|
||||
7. On Claude failure, surface `RunResult.ErrorMarkdown` to the caller (do not store).
|
||||
- `GetStoredAsync(start, end)` → `WeekReportRepository.GetByRangeAsync`.
|
||||
|
||||
Interfaces live in `Report/Interfaces/` per the area convention.
|
||||
|
||||
#### Report Prompt
|
||||
|
||||
`WeekReportService` assembles this prompt. Instructions are in English (more reliable
|
||||
steering); the output is forced to German. `{...}` are filled at build time.
|
||||
|
||||
```
|
||||
You are generating a concise weekly standup report for a software developer.
|
||||
Summarize what they accomplished between {start:dd.MM.yyyy} and {end:dd.MM.yyyy}.
|
||||
|
||||
Rules:
|
||||
- Write the ENTIRE report in German.
|
||||
- Group by day. One "## {Wochentag}, {dd.MM.yyyy}" section per day that has
|
||||
activity (German weekday names). Omit days with no activity entirely.
|
||||
- Within each day: 3–5 first-person, past-tense bullets ("- Habe X umgesetzt",
|
||||
"- Y behoben"). Merge related small work into one bullet.
|
||||
- Drop trivia: typo fixes, pure exploration, false starts, tooling/log noise.
|
||||
- Blend the developer's own notes and the derived activity into ONE deduplicated
|
||||
bullet list per day. The developer's notes are authoritative — never omit or
|
||||
contradict their substance.
|
||||
- Name the project/repo when it adds clarity.
|
||||
- Output ONLY the dated sections. No preamble, no intro, no closing remarks.
|
||||
|
||||
== Activity (from session history) ==
|
||||
{day-major: for each day → for each repo → its prompts + closing summaries}
|
||||
|
||||
== Developer notes ==
|
||||
{day-major: for each day → the bullets}
|
||||
```
|
||||
|
||||
### 3. IPC (Hub + WorkerClient)
|
||||
|
||||
**`WorkerHub`** new methods:
|
||||
- `GetWeekReport(string startIso, string endIso)` → stored markdown or null.
|
||||
- `GenerateWeekReport(string startIso, string endIso)` → generates, stores, returns markdown.
|
||||
- `GetDailyNotes(string dayIso)` → bullets for a day.
|
||||
- `AddDailyNote(string dayIso, string text)` → created bullet.
|
||||
- `UpdateDailyNote(string id, string text)`.
|
||||
- `DeleteDailyNote(string id)`.
|
||||
|
||||
**`WorkerClient`** (UI) mirrors these, following the existing
|
||||
`WorkerPrimeScheduleApi`/AppSettings method pattern.
|
||||
|
||||
### 4. UI (`ClaudeDo.Ui`)
|
||||
|
||||
**Weekly Report modal** (`WeeklyReportModalView` + `WeeklyReportModalViewModel`)
|
||||
- Overlay modal in the `Modals/` pattern (like `WorktreesOverviewModalView`),
|
||||
registered in `IslandsShellViewModel`, opened from a new toolbar button.
|
||||
- Date range: two `ThemedDatePicker`s, default "since last Wednesday → today" computed
|
||||
from `StandupWeekday`.
|
||||
- On open and on range change: call `GetWeekReport`.
|
||||
- Stored report exists → render markdown via `MarkdownView`, show `GeneratedAt`, show
|
||||
a **Regenerate** button.
|
||||
- None → empty state ("Not generated yet") + a **Generate** button.
|
||||
- **Generate**/**Regenerate**: call `GenerateWeekReport` with a busy/spinner state;
|
||||
render the returned markdown. Generation only ever runs from these buttons.
|
||||
- View-only; no export.
|
||||
|
||||
**Notes in My Day**
|
||||
- The My Day smart list (`smart:my-day`) pins a fixed, non-task "Notes" pseudo-row at
|
||||
the top, recognized by the list/selection code (not a `TaskEntity`).
|
||||
- Selecting it puts the **Details island** into **notes mode** (task fields hidden,
|
||||
notes editor shown). The island hosts a dedicated `NotesEditorViewModel` + small view
|
||||
rather than swelling `DetailsIslandViewModel` (already ~978 lines); the bullet logic
|
||||
stays isolated and testable.
|
||||
- **Day navigator** in the editor header: `<` / `>` arrows to step days, a
|
||||
`ThemedDatePicker` to jump to any date, and a "Today" button. Defaults to today; the
|
||||
pinned row's default day rolls over at midnight (no data lost — past days remain
|
||||
reachable via the navigator).
|
||||
- **Bullet editing** for the selected day: list of bullets with add / inline-edit /
|
||||
delete / reorder (`SortOrder`). Each operation goes through the daily-notes hub CRUD.
|
||||
|
||||
### 5. Settings
|
||||
|
||||
- Add the excluded-path list and the standup weekday to the existing Settings modal,
|
||||
persisted via the new `app_settings` columns and the existing
|
||||
`GetAppSettings`/`UpdateAppSettings` path.
|
||||
|
||||
## Error Handling
|
||||
|
||||
- Malformed/unreadable JSONL lines are skipped, never fatal.
|
||||
- Empty window → a "no activity" report, no Claude call.
|
||||
- Claude call failure → error surfaced in the modal; nothing stored.
|
||||
- Date ranges normalized to date-only; the stored report key is the exact (start, end).
|
||||
|
||||
## Testing
|
||||
|
||||
- **`ClaudeHistoryReader`** (Worker tests, fixture `.jsonl`): date-window filtering,
|
||||
excluded-prefix dropping (case/separator normalization), prompt/summary extraction,
|
||||
malformed-line tolerance, repo/day grouping.
|
||||
- **`WeekReportService`**: prompt-building from distilled activity + notes; empty-window
|
||||
short-circuit; storage upsert; with a faked `ClaudeProcess`.
|
||||
- **`DailyNoteRepository`** and **`WeekReportRepository`**: CRUD / upsert / range lookup
|
||||
against real SQLite (matches existing test style).
|
||||
|
||||
## Out of Scope
|
||||
|
||||
- Report export (clipboard/file) — view-only for now.
|
||||
- Git-commit scanning.
|
||||
- Editing or summarizing full transcripts; only prompts + closing summaries are used.
|
||||
@@ -28,5 +28,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ClaudeDo.Ui\ClaudeDo.Ui.csproj" />
|
||||
<ProjectReference Include="..\ClaudeDo.Localization\ClaudeDo.Localization.csproj" />
|
||||
</ItemGroup>
|
||||
<Import Project="..\ClaudeDo.Localization\Locales.targets" />
|
||||
</Project>
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
using Avalonia;
|
||||
using ClaudeDo.Data;
|
||||
using ClaudeDo.Data.Git;
|
||||
using ClaudeDo.Localization;
|
||||
using ClaudeDo.Releases;
|
||||
using ClaudeDo.Ui;
|
||||
using ClaudeDo.Ui.Localization;
|
||||
using ClaudeDo.Ui.Services;
|
||||
using ClaudeDo.Ui.Services.Interfaces;
|
||||
using ClaudeDo.Ui.ViewModels;
|
||||
using ClaudeDo.Ui.ViewModels.Islands;
|
||||
using ClaudeDo.Ui.ViewModels.Modals;
|
||||
@@ -11,6 +14,9 @@ using ClaudeDo.Ui.ViewModels.Modals.Settings;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
@@ -70,6 +76,18 @@ sealed class Program
|
||||
|
||||
// Infrastructure
|
||||
sc.AddSingleton(settings);
|
||||
var localesDir = Path.Combine(AppContext.BaseDirectory, "locales");
|
||||
var localeStore = LocaleStore.Load(localesDir);
|
||||
var initialLang = !string.IsNullOrWhiteSpace(settings.Language)
|
||||
? settings.Language
|
||||
: CultureResolver.Resolve(
|
||||
CultureInfo.CurrentUICulture.Name,
|
||||
localeStore.Available.Select(l => l.Code).ToArray(),
|
||||
fallback: "en");
|
||||
var localizer = new Localizer(localeStore, initialLang);
|
||||
TrExtension.Localizer = localizer;
|
||||
ClaudeDo.Ui.Localization.Loc.Current = localizer;
|
||||
sc.AddSingleton<ILocalizer>(localizer);
|
||||
sc.AddDbContextFactory<ClaudeDoDbContext>(opt =>
|
||||
opt.UseSqlite($"Data Source={dbPath}"));
|
||||
sc.AddScoped<ClaudeDoDbContext>(sp =>
|
||||
@@ -100,6 +118,7 @@ sealed class Program
|
||||
sc.AddTransient<WorktreesOverviewModalViewModel>();
|
||||
sc.AddTransient<Func<WorktreesOverviewModalViewModel>>(sp => () => sp.GetRequiredService<WorktreesOverviewModalViewModel>());
|
||||
sc.AddSingleton<IPrimeScheduleApi, WorkerPrimeScheduleApi>();
|
||||
sc.AddSingleton<INotesApi, WorkerNotesApi>();
|
||||
sc.AddTransient<PrimeClaudeTabViewModel>();
|
||||
sc.AddTransient<SettingsModalViewModel>();
|
||||
sc.AddTransient<MergeModalViewModel>();
|
||||
@@ -107,6 +126,8 @@ sealed class Program
|
||||
sc.AddTransient<ListSettingsModalViewModel>();
|
||||
sc.AddTransient<RepoImportModalViewModel>();
|
||||
sc.AddTransient<Func<RepoImportModalViewModel>>(sp => () => sp.GetRequiredService<RepoImportModalViewModel>());
|
||||
sc.AddTransient<WeeklyReportModalViewModel>();
|
||||
sc.AddTransient<Func<WeeklyReportModalViewModel>>(sp => () => sp.GetRequiredService<WeeklyReportModalViewModel>());
|
||||
|
||||
// Islands shell VMs
|
||||
sc.AddSingleton<ListsIslandViewModel>(sp =>
|
||||
@@ -122,7 +143,8 @@ sealed class Program
|
||||
new DetailsIslandViewModel(
|
||||
sp.GetRequiredService<IDbContextFactory<ClaudeDoDbContext>>(),
|
||||
sp.GetRequiredService<WorkerClient>(),
|
||||
sp));
|
||||
sp,
|
||||
sp.GetRequiredService<INotesApi>()));
|
||||
sc.AddSingleton<IslandsShellViewModel>();
|
||||
|
||||
return sc.BuildServiceProvider();
|
||||
|
||||
@@ -4,11 +4,15 @@ Shared data layer: models, repositories, SQLite infrastructure, and git operatio
|
||||
|
||||
## Models
|
||||
|
||||
- **TaskEntity** — Id, ListId, Title, Description, Status (`Idle|Queued|Running|Done|Failed|Cancelled`), PlanningPhase (`None|Active|Finalized` — parent-only), BlockedByTaskId (nullable FK to predecessor in a chain), ScheduledFor, Result, LogPath, timestamps, CommitType, Model / SystemPrompt / AgentPath (nullable overrides), IsStarred, IsMyDay, Notes, ParentTaskId, PlanningSessionId, PlanningSessionToken, PlanningFinalizedAt, CreatedBy. Legacy values `Manual`/`Planning`/`Planned`/`Draft`/`Waiting` were retired; existing rows backfill automatically via the `RetireLegacyTaskStatus` migration.
|
||||
- **TaskEntity** — Id, ListId, Title, Description, Status (`Idle|Queued|Running|WaitingForReview|Done|Failed|Cancelled`), PlanningPhase (`None|Active|Finalized` — parent-only), BlockedByTaskId (nullable FK to predecessor in a chain), ScheduledFor, Result, ReviewFeedback (nullable; reviewer's rejection comment, consumed and cleared by the runner on the next re-run), LogPath, timestamps, CommitType, Model / SystemPrompt / AgentPath (nullable overrides), IsStarred, IsMyDay, Notes, ParentTaskId, PlanningSessionId, PlanningSessionToken, PlanningFinalizedAt, CreatedBy. Legacy values `Manual`/`Planning`/`Planned`/`Draft`/`Waiting` were retired; existing rows backfill automatically via the `RetireLegacyTaskStatus` migration.
|
||||
- **ListEntity** — Id, Name, WorkingDir, DefaultCommitType, CreatedAt
|
||||
- **ListConfigEntity** — ListId (PK, 1:1 with list), Model, SystemPrompt, AgentPath (all nullable)
|
||||
- **WorktreeEntity** — TaskId (PK, 1:1 with task), Path, BranchName, BaseCommit, HeadCommit, DiffStat, State (Active|Merged|Discarded|Kept)
|
||||
- **TaskRunEntity** — per-run record (session_id, tokens, turns, result, structured output, exit code, log path)
|
||||
- **PrimeScheduleEntity** — Id, Days (`[Flags] PrimeDays` weekday bitmask, stored as `days_of_week` int), TimeOfDay, Enabled, LastRunAt, PromptOverride, CreatedAt. Recurs on the selected weekdays; no date range.
|
||||
- **DailyNoteEntity** — Id, Date (DateOnly), Text, SortOrder, CreatedAt → table `daily_notes`
|
||||
- **WeekReportEntity** — Id, StartDate/EndDate (DateOnly), Markdown, GeneratedAt → table `week_reports`, unique index on (start_date, end_date)
|
||||
- **AppSettingsEntity** also carries `ReportExcludedPaths` (string?, JSON array of excluded path prefixes, column `report_excluded_paths`) and `StandupWeekday` (int DayOfWeek, default Wednesday, column `standup_weekday`)
|
||||
- **SubtaskEntity**, **AppSettingsEntity**, **AgentInfo** — existing helpers / settings / record for scanned agent files
|
||||
|
||||
## Repositories
|
||||
@@ -19,6 +23,8 @@ All repositories use EF Core LINQ queries via `ClaudeDoDbContext`. The atomic `Q
|
||||
- **ListRepository** — CRUD, `GetConfigAsync` / `SetConfigAsync` (upsert) / `DeleteConfigAsync` for `list_config`
|
||||
- **WorktreeRepository** — CRUD, `UpdateHeadAsync`, `SetStateAsync`
|
||||
- **TaskRunRepository**, **SubtaskRepository**, **AppSettingsRepository**
|
||||
- **DailyNoteRepository** — `ListByDayAsync`, `ListBetweenAsync`, `AddAsync`, `UpdateAsync`, `DeleteAsync`
|
||||
- **WeekReportRepository** — `GetByRangeAsync`, `UpsertAsync`
|
||||
|
||||
## Infrastructure
|
||||
|
||||
@@ -33,7 +39,7 @@ All repositories use EF Core LINQ queries via `ClaudeDoDbContext`. The atomic `Q
|
||||
|
||||
## Schema
|
||||
|
||||
Tables: `lists`, `tasks`, `worktrees`, `list_config`, `task_runs`, `subtasks`, `app_settings`, `prime_schedules`. Managed by EF Core migrations in the `Migrations/` folder. The `tasks` table holds `status`, `planning_phase` (default `none`), and `blocked_by_task_id` (FK to `tasks.id`, `ON DELETE SET NULL`).
|
||||
Tables: `lists`, `tasks`, `worktrees`, `list_config`, `task_runs`, `subtasks`, `app_settings`, `prime_schedules`, `daily_notes`, `week_reports`. Managed by EF Core migrations in the `Migrations/` folder. The `tasks` table holds `status`, `planning_phase` (default `none`), and `blocked_by_task_id` (FK to `tasks.id`, `ON DELETE SET NULL`). Migration `WeeklyReport` added `daily_notes`, `week_reports`, and the two new `app_settings` columns.
|
||||
|
||||
## Conventions
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@ public class ClaudeDoDbContext : DbContext
|
||||
public DbSet<SubtaskEntity> Subtasks => Set<SubtaskEntity>();
|
||||
public DbSet<AppSettingsEntity> AppSettings => Set<AppSettingsEntity>();
|
||||
public DbSet<PrimeScheduleEntity> PrimeSchedules => Set<PrimeScheduleEntity>();
|
||||
public DbSet<DailyNoteEntity> DailyNotes => Set<DailyNoteEntity>();
|
||||
public DbSet<WeekReportEntity> WeekReports => Set<WeekReportEntity>();
|
||||
|
||||
private static readonly ValueConverter<DateTime, DateTime> UtcConverter =
|
||||
new(v => v, v => DateTime.SpecifyKind(v, DateTimeKind.Utc));
|
||||
|
||||
@@ -37,6 +37,10 @@ public class AppSettingsEntityConfiguration : IEntityTypeConfiguration<AppSettin
|
||||
builder.Property(s => s.RepoImportFolders)
|
||||
.HasColumnName("repo_import_folders");
|
||||
|
||||
builder.Property(s => s.ReportExcludedPaths).HasColumnName("report_excluded_paths");
|
||||
builder.Property(s => s.StandupWeekday).HasColumnName("standup_weekday")
|
||||
.IsRequired().HasDefaultValue((int)DayOfWeek.Wednesday);
|
||||
|
||||
builder.HasData(new AppSettingsEntity { Id = AppSettingsEntity.SingletonId });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
using ClaudeDo.Data.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace ClaudeDo.Data.Configuration;
|
||||
|
||||
public class DailyNoteEntityConfiguration : IEntityTypeConfiguration<DailyNoteEntity>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<DailyNoteEntity> builder)
|
||||
{
|
||||
builder.ToTable("daily_notes");
|
||||
builder.HasKey(n => n.Id);
|
||||
builder.Property(n => n.Id).HasColumnName("id").ValueGeneratedNever();
|
||||
builder.Property(n => n.Date).HasColumnName("note_date").IsRequired();
|
||||
builder.Property(n => n.Text).HasColumnName("text").IsRequired();
|
||||
builder.Property(n => n.SortOrder).HasColumnName("sort_order").IsRequired();
|
||||
builder.Property(n => n.CreatedAt).HasColumnName("created_at").IsRequired();
|
||||
builder.HasIndex(n => n.Date);
|
||||
}
|
||||
}
|
||||
@@ -13,10 +13,9 @@ public class PrimeScheduleEntityConfiguration : IEntityTypeConfiguration<PrimeSc
|
||||
builder.HasKey(s => s.Id);
|
||||
builder.Property(s => s.Id).HasColumnName("id").ValueGeneratedNever();
|
||||
|
||||
builder.Property(s => s.StartDate).HasColumnName("start_date").IsRequired();
|
||||
builder.Property(s => s.EndDate).HasColumnName("end_date").IsRequired();
|
||||
builder.Property(s => s.Days).HasColumnName("days_of_week")
|
||||
.IsRequired().HasDefaultValue(PrimeDays.Weekdays);
|
||||
builder.Property(s => s.TimeOfDay).HasColumnName("time_of_day").IsRequired();
|
||||
builder.Property(s => s.WorkdaysOnly).HasColumnName("workdays_only").IsRequired().HasDefaultValue(true);
|
||||
builder.Property(s => s.Enabled).HasColumnName("enabled").IsRequired().HasDefaultValue(true);
|
||||
builder.Property(s => s.LastRunAt).HasColumnName("last_run_at");
|
||||
builder.Property(s => s.PromptOverride).HasColumnName("prompt_override");
|
||||
|
||||
@@ -14,6 +14,7 @@ public class TaskEntityConfiguration : IEntityTypeConfiguration<TaskEntity>
|
||||
TaskStatus.Idle => "idle",
|
||||
TaskStatus.Queued => "queued",
|
||||
TaskStatus.Running => "running",
|
||||
TaskStatus.WaitingForReview => "waiting_for_review",
|
||||
TaskStatus.Done => "done",
|
||||
TaskStatus.Failed => "failed",
|
||||
TaskStatus.Cancelled => "cancelled",
|
||||
@@ -26,6 +27,7 @@ public class TaskEntityConfiguration : IEntityTypeConfiguration<TaskEntity>
|
||||
"idle" => TaskStatus.Idle,
|
||||
"queued" => TaskStatus.Queued,
|
||||
"running" => TaskStatus.Running,
|
||||
"waiting_for_review" => TaskStatus.WaitingForReview,
|
||||
"done" => TaskStatus.Done,
|
||||
"failed" => TaskStatus.Failed,
|
||||
"cancelled" => TaskStatus.Cancelled,
|
||||
@@ -72,6 +74,7 @@ public class TaskEntityConfiguration : IEntityTypeConfiguration<TaskEntity>
|
||||
builder.Property(t => t.BlockedByTaskId).HasColumnName("blocked_by_task_id");
|
||||
builder.Property(t => t.ScheduledFor).HasColumnName("scheduled_for");
|
||||
builder.Property(t => t.Result).HasColumnName("result");
|
||||
builder.Property(t => t.ReviewFeedback).HasColumnName("review_feedback");
|
||||
builder.Property(t => t.LogPath).HasColumnName("log_path");
|
||||
builder.Property(t => t.CreatedAt).HasColumnName("created_at").IsRequired();
|
||||
builder.Property(t => t.StartedAt).HasColumnName("started_at");
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
using ClaudeDo.Data.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace ClaudeDo.Data.Configuration;
|
||||
|
||||
public class WeekReportEntityConfiguration : IEntityTypeConfiguration<WeekReportEntity>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<WeekReportEntity> builder)
|
||||
{
|
||||
builder.ToTable("week_reports");
|
||||
builder.HasKey(r => r.Id);
|
||||
builder.Property(r => r.Id).HasColumnName("id").ValueGeneratedNever();
|
||||
builder.Property(r => r.StartDate).HasColumnName("start_date").IsRequired();
|
||||
builder.Property(r => r.EndDate).HasColumnName("end_date").IsRequired();
|
||||
builder.Property(r => r.Markdown).HasColumnName("markdown").IsRequired();
|
||||
builder.Property(r => r.GeneratedAt).HasColumnName("generated_at").IsRequired();
|
||||
builder.HasIndex(r => new { r.StartDate, r.EndDate }).IsUnique();
|
||||
}
|
||||
}
|
||||
611
src/ClaudeDo.Data/Migrations/20260601150820_AddReviewFeedback.Designer.cs
generated
Normal file
611
src/ClaudeDo.Data/Migrations/20260601150820_AddReviewFeedback.Designer.cs
generated
Normal file
@@ -0,0 +1,611 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using ClaudeDo.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ClaudeDo.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(ClaudeDoDbContext))]
|
||||
[Migration("20260601150820_AddReviewFeedback")]
|
||||
partial class AddReviewFeedback
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "8.0.11");
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.AppSettingsEntity", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<string>("CentralWorktreeRoot")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("central_worktree_root");
|
||||
|
||||
b.Property<string>("DefaultClaudeInstructions")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("")
|
||||
.HasColumnName("default_claude_instructions");
|
||||
|
||||
b.Property<int>("DefaultMaxTurns")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(30)
|
||||
.HasColumnName("default_max_turns");
|
||||
|
||||
b.Property<string>("DefaultModel")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("sonnet")
|
||||
.HasColumnName("default_model");
|
||||
|
||||
b.Property<string>("DefaultPermissionMode")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("bypassPermissions")
|
||||
.HasColumnName("default_permission_mode");
|
||||
|
||||
b.Property<int>("MaxParallelExecutions")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(1)
|
||||
.HasColumnName("max_parallel_executions");
|
||||
|
||||
b.Property<string>("RepoImportFolders")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("repo_import_folders");
|
||||
|
||||
b.Property<int>("WorktreeAutoCleanupDays")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(7)
|
||||
.HasColumnName("worktree_auto_cleanup_days");
|
||||
|
||||
b.Property<bool>("WorktreeAutoCleanupEnabled")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("worktree_auto_cleanup_enabled");
|
||||
|
||||
b.Property<string>("WorktreeStrategy")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("sibling")
|
||||
.HasColumnName("worktree_strategy");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("app_settings", (string)null);
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
DefaultClaudeInstructions = "",
|
||||
DefaultMaxTurns = 100,
|
||||
DefaultModel = "sonnet",
|
||||
DefaultPermissionMode = "auto",
|
||||
MaxParallelExecutions = 1,
|
||||
WorktreeAutoCleanupDays = 7,
|
||||
WorktreeAutoCleanupEnabled = false,
|
||||
WorktreeStrategy = "sibling"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.ListConfigEntity", b =>
|
||||
{
|
||||
b.Property<string>("ListId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("list_id");
|
||||
|
||||
b.Property<string>("AgentPath")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("agent_path");
|
||||
|
||||
b.Property<string>("Model")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("model");
|
||||
|
||||
b.Property<string>("SystemPrompt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("system_prompt");
|
||||
|
||||
b.HasKey("ListId");
|
||||
|
||||
b.ToTable("list_config", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.ListEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<string>("DefaultCommitType")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("chore")
|
||||
.HasColumnName("default_commit_type");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.Property<int>("SortOrder")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(0)
|
||||
.HasColumnName("sort_order");
|
||||
|
||||
b.Property<string>("WorkingDir")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("working_dir");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("SortOrder")
|
||||
.HasDatabaseName("idx_lists_sort");
|
||||
|
||||
b.ToTable("lists", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.PrimeScheduleEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<DateTimeOffset>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<bool>("Enabled")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(true)
|
||||
.HasColumnName("enabled");
|
||||
|
||||
b.Property<DateOnly>("EndDate")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("end_date");
|
||||
|
||||
b.Property<DateTimeOffset?>("LastRunAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("last_run_at");
|
||||
|
||||
b.Property<string>("PromptOverride")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("prompt_override");
|
||||
|
||||
b.Property<DateOnly>("StartDate")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("start_date");
|
||||
|
||||
b.Property<TimeSpan>("TimeOfDay")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("time_of_day");
|
||||
|
||||
b.Property<bool>("WorkdaysOnly")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(true)
|
||||
.HasColumnName("workdays_only");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("prime_schedules", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.SubtaskEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<bool>("Completed")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("completed");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<int>("OrderNum")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("order_num");
|
||||
|
||||
b.Property<string>("TaskId")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("task_id");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("title");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TaskId")
|
||||
.HasDatabaseName("idx_subtasks_task_id");
|
||||
|
||||
b.ToTable("subtasks", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<string>("AgentPath")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("agent_path");
|
||||
|
||||
b.Property<string>("BlockedByTaskId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("blocked_by_task_id");
|
||||
|
||||
b.Property<string>("CommitType")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("chore")
|
||||
.HasColumnName("commit_type");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_by");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("description");
|
||||
|
||||
b.Property<DateTime?>("FinishedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("finished_at");
|
||||
|
||||
b.Property<bool>("IsMyDay")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("is_my_day");
|
||||
|
||||
b.Property<bool>("IsStarred")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("is_starred");
|
||||
|
||||
b.Property<string>("ListId")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("list_id");
|
||||
|
||||
b.Property<string>("LogPath")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("log_path");
|
||||
|
||||
b.Property<string>("Model")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("model");
|
||||
|
||||
b.Property<string>("Notes")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("notes");
|
||||
|
||||
b.Property<string>("ParentTaskId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("parent_task_id");
|
||||
|
||||
b.Property<DateTime?>("PlanningFinalizedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("planning_finalized_at");
|
||||
|
||||
b.Property<string>("PlanningPhase")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("none")
|
||||
.HasColumnName("planning_phase");
|
||||
|
||||
b.Property<string>("PlanningSessionId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("planning_session_id");
|
||||
|
||||
b.Property<string>("PlanningSessionToken")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("planning_session_token");
|
||||
|
||||
b.Property<string>("Result")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("result");
|
||||
|
||||
b.Property<string>("ReviewFeedback")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("review_feedback");
|
||||
|
||||
b.Property<DateTime?>("ScheduledFor")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("scheduled_for");
|
||||
|
||||
b.Property<int>("SortOrder")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(0)
|
||||
.HasColumnName("sort_order");
|
||||
|
||||
b.Property<DateTime?>("StartedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("started_at");
|
||||
|
||||
b.Property<string>("Status")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("status");
|
||||
|
||||
b.Property<string>("SystemPrompt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("system_prompt");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("title");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("BlockedByTaskId")
|
||||
.HasDatabaseName("idx_tasks_blocked_by");
|
||||
|
||||
b.HasIndex("ListId")
|
||||
.HasDatabaseName("idx_tasks_list_id");
|
||||
|
||||
b.HasIndex("ParentTaskId")
|
||||
.HasDatabaseName("idx_tasks_parent_task_id");
|
||||
|
||||
b.HasIndex("Status")
|
||||
.HasDatabaseName("idx_tasks_status");
|
||||
|
||||
b.HasIndex("ListId", "SortOrder")
|
||||
.HasDatabaseName("idx_tasks_list_sort");
|
||||
|
||||
b.ToTable("tasks", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskRunEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<string>("ErrorMarkdown")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("error_markdown");
|
||||
|
||||
b.Property<int?>("ExitCode")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("exit_code");
|
||||
|
||||
b.Property<DateTime?>("FinishedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("finished_at");
|
||||
|
||||
b.Property<bool>("IsRetry")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("is_retry");
|
||||
|
||||
b.Property<string>("LogPath")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("log_path");
|
||||
|
||||
b.Property<string>("Prompt")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("prompt");
|
||||
|
||||
b.Property<string>("ResultMarkdown")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("result_markdown");
|
||||
|
||||
b.Property<int>("RunNumber")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("run_number");
|
||||
|
||||
b.Property<string>("SessionId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("session_id");
|
||||
|
||||
b.Property<DateTime?>("StartedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("started_at");
|
||||
|
||||
b.Property<string>("StructuredOutputJson")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("structured_output");
|
||||
|
||||
b.Property<string>("TaskId")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("task_id");
|
||||
|
||||
b.Property<int?>("TokensIn")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("tokens_in");
|
||||
|
||||
b.Property<int?>("TokensOut")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("tokens_out");
|
||||
|
||||
b.Property<int?>("TurnCount")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("turn_count");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TaskId")
|
||||
.HasDatabaseName("idx_task_runs_task_id");
|
||||
|
||||
b.ToTable("task_runs", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.WorktreeEntity", b =>
|
||||
{
|
||||
b.Property<string>("TaskId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("task_id");
|
||||
|
||||
b.Property<string>("BaseCommit")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("base_commit");
|
||||
|
||||
b.Property<string>("BranchName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("branch_name");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<string>("DiffStat")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("diff_stat");
|
||||
|
||||
b.Property<string>("HeadCommit")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("head_commit");
|
||||
|
||||
b.Property<string>("Path")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("path");
|
||||
|
||||
b.Property<string>("State")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("active")
|
||||
.HasColumnName("state");
|
||||
|
||||
b.HasKey("TaskId");
|
||||
|
||||
b.ToTable("worktrees", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.ListConfigEntity", b =>
|
||||
{
|
||||
b.HasOne("ClaudeDo.Data.Models.ListEntity", "List")
|
||||
.WithOne("Config")
|
||||
.HasForeignKey("ClaudeDo.Data.Models.ListConfigEntity", "ListId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("List");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.SubtaskEntity", b =>
|
||||
{
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", "Task")
|
||||
.WithMany("Subtasks")
|
||||
.HasForeignKey("TaskId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Task");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskEntity", b =>
|
||||
{
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("BlockedByTaskId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
b.HasOne("ClaudeDo.Data.Models.ListEntity", "List")
|
||||
.WithMany("Tasks")
|
||||
.HasForeignKey("ListId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", "Parent")
|
||||
.WithMany("Children")
|
||||
.HasForeignKey("ParentTaskId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.Navigation("List");
|
||||
|
||||
b.Navigation("Parent");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskRunEntity", b =>
|
||||
{
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", "Task")
|
||||
.WithMany("Runs")
|
||||
.HasForeignKey("TaskId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Task");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.WorktreeEntity", b =>
|
||||
{
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", "Task")
|
||||
.WithOne("Worktree")
|
||||
.HasForeignKey("ClaudeDo.Data.Models.WorktreeEntity", "TaskId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Task");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.ListEntity", b =>
|
||||
{
|
||||
b.Navigation("Config");
|
||||
|
||||
b.Navigation("Tasks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskEntity", b =>
|
||||
{
|
||||
b.Navigation("Children");
|
||||
|
||||
b.Navigation("Runs");
|
||||
|
||||
b.Navigation("Subtasks");
|
||||
|
||||
b.Navigation("Worktree");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ClaudeDo.Data.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddReviewFeedback : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "review_feedback",
|
||||
table: "tasks",
|
||||
type: "TEXT",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "review_feedback",
|
||||
table: "tasks");
|
||||
}
|
||||
}
|
||||
}
|
||||
603
src/ClaudeDo.Data/Migrations/20260602060000_PrimeWeekdays.Designer.cs
generated
Normal file
603
src/ClaudeDo.Data/Migrations/20260602060000_PrimeWeekdays.Designer.cs
generated
Normal file
@@ -0,0 +1,603 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using ClaudeDo.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ClaudeDo.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(ClaudeDoDbContext))]
|
||||
[Migration("20260602060000_PrimeWeekdays")]
|
||||
partial class PrimeWeekdays
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "8.0.11");
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.AppSettingsEntity", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<string>("CentralWorktreeRoot")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("central_worktree_root");
|
||||
|
||||
b.Property<string>("DefaultClaudeInstructions")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("")
|
||||
.HasColumnName("default_claude_instructions");
|
||||
|
||||
b.Property<int>("DefaultMaxTurns")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(30)
|
||||
.HasColumnName("default_max_turns");
|
||||
|
||||
b.Property<string>("DefaultModel")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("sonnet")
|
||||
.HasColumnName("default_model");
|
||||
|
||||
b.Property<string>("DefaultPermissionMode")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("bypassPermissions")
|
||||
.HasColumnName("default_permission_mode");
|
||||
|
||||
b.Property<int>("MaxParallelExecutions")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(1)
|
||||
.HasColumnName("max_parallel_executions");
|
||||
|
||||
b.Property<string>("RepoImportFolders")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("repo_import_folders");
|
||||
|
||||
b.Property<int>("WorktreeAutoCleanupDays")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(7)
|
||||
.HasColumnName("worktree_auto_cleanup_days");
|
||||
|
||||
b.Property<bool>("WorktreeAutoCleanupEnabled")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("worktree_auto_cleanup_enabled");
|
||||
|
||||
b.Property<string>("WorktreeStrategy")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("sibling")
|
||||
.HasColumnName("worktree_strategy");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("app_settings", (string)null);
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
DefaultClaudeInstructions = "",
|
||||
DefaultMaxTurns = 100,
|
||||
DefaultModel = "sonnet",
|
||||
DefaultPermissionMode = "auto",
|
||||
MaxParallelExecutions = 1,
|
||||
WorktreeAutoCleanupDays = 7,
|
||||
WorktreeAutoCleanupEnabled = false,
|
||||
WorktreeStrategy = "sibling"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.ListConfigEntity", b =>
|
||||
{
|
||||
b.Property<string>("ListId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("list_id");
|
||||
|
||||
b.Property<string>("AgentPath")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("agent_path");
|
||||
|
||||
b.Property<string>("Model")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("model");
|
||||
|
||||
b.Property<string>("SystemPrompt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("system_prompt");
|
||||
|
||||
b.HasKey("ListId");
|
||||
|
||||
b.ToTable("list_config", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.ListEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<string>("DefaultCommitType")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("chore")
|
||||
.HasColumnName("default_commit_type");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.Property<int>("SortOrder")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(0)
|
||||
.HasColumnName("sort_order");
|
||||
|
||||
b.Property<string>("WorkingDir")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("working_dir");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("SortOrder")
|
||||
.HasDatabaseName("idx_lists_sort");
|
||||
|
||||
b.ToTable("lists", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.PrimeScheduleEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<DateTimeOffset>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<int>("Days")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(31)
|
||||
.HasColumnName("days_of_week");
|
||||
|
||||
b.Property<bool>("Enabled")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(true)
|
||||
.HasColumnName("enabled");
|
||||
|
||||
b.Property<DateTimeOffset?>("LastRunAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("last_run_at");
|
||||
|
||||
b.Property<string>("PromptOverride")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("prompt_override");
|
||||
|
||||
b.Property<TimeSpan>("TimeOfDay")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("time_of_day");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("prime_schedules", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.SubtaskEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<bool>("Completed")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("completed");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<int>("OrderNum")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("order_num");
|
||||
|
||||
b.Property<string>("TaskId")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("task_id");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("title");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TaskId")
|
||||
.HasDatabaseName("idx_subtasks_task_id");
|
||||
|
||||
b.ToTable("subtasks", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<string>("AgentPath")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("agent_path");
|
||||
|
||||
b.Property<string>("BlockedByTaskId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("blocked_by_task_id");
|
||||
|
||||
b.Property<string>("CommitType")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("chore")
|
||||
.HasColumnName("commit_type");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_by");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("description");
|
||||
|
||||
b.Property<DateTime?>("FinishedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("finished_at");
|
||||
|
||||
b.Property<bool>("IsMyDay")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("is_my_day");
|
||||
|
||||
b.Property<bool>("IsStarred")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("is_starred");
|
||||
|
||||
b.Property<string>("ListId")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("list_id");
|
||||
|
||||
b.Property<string>("LogPath")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("log_path");
|
||||
|
||||
b.Property<string>("Model")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("model");
|
||||
|
||||
b.Property<string>("Notes")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("notes");
|
||||
|
||||
b.Property<string>("ParentTaskId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("parent_task_id");
|
||||
|
||||
b.Property<DateTime?>("PlanningFinalizedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("planning_finalized_at");
|
||||
|
||||
b.Property<string>("PlanningPhase")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("none")
|
||||
.HasColumnName("planning_phase");
|
||||
|
||||
b.Property<string>("PlanningSessionId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("planning_session_id");
|
||||
|
||||
b.Property<string>("PlanningSessionToken")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("planning_session_token");
|
||||
|
||||
b.Property<string>("Result")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("result");
|
||||
|
||||
b.Property<string>("ReviewFeedback")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("review_feedback");
|
||||
|
||||
b.Property<DateTime?>("ScheduledFor")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("scheduled_for");
|
||||
|
||||
b.Property<int>("SortOrder")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(0)
|
||||
.HasColumnName("sort_order");
|
||||
|
||||
b.Property<DateTime?>("StartedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("started_at");
|
||||
|
||||
b.Property<string>("Status")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("status");
|
||||
|
||||
b.Property<string>("SystemPrompt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("system_prompt");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("title");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("BlockedByTaskId")
|
||||
.HasDatabaseName("idx_tasks_blocked_by");
|
||||
|
||||
b.HasIndex("ListId")
|
||||
.HasDatabaseName("idx_tasks_list_id");
|
||||
|
||||
b.HasIndex("ParentTaskId")
|
||||
.HasDatabaseName("idx_tasks_parent_task_id");
|
||||
|
||||
b.HasIndex("Status")
|
||||
.HasDatabaseName("idx_tasks_status");
|
||||
|
||||
b.HasIndex("ListId", "SortOrder")
|
||||
.HasDatabaseName("idx_tasks_list_sort");
|
||||
|
||||
b.ToTable("tasks", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskRunEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<string>("ErrorMarkdown")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("error_markdown");
|
||||
|
||||
b.Property<int?>("ExitCode")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("exit_code");
|
||||
|
||||
b.Property<DateTime?>("FinishedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("finished_at");
|
||||
|
||||
b.Property<bool>("IsRetry")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("is_retry");
|
||||
|
||||
b.Property<string>("LogPath")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("log_path");
|
||||
|
||||
b.Property<string>("Prompt")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("prompt");
|
||||
|
||||
b.Property<string>("ResultMarkdown")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("result_markdown");
|
||||
|
||||
b.Property<int>("RunNumber")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("run_number");
|
||||
|
||||
b.Property<string>("SessionId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("session_id");
|
||||
|
||||
b.Property<DateTime?>("StartedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("started_at");
|
||||
|
||||
b.Property<string>("StructuredOutputJson")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("structured_output");
|
||||
|
||||
b.Property<string>("TaskId")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("task_id");
|
||||
|
||||
b.Property<int?>("TokensIn")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("tokens_in");
|
||||
|
||||
b.Property<int?>("TokensOut")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("tokens_out");
|
||||
|
||||
b.Property<int?>("TurnCount")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("turn_count");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TaskId")
|
||||
.HasDatabaseName("idx_task_runs_task_id");
|
||||
|
||||
b.ToTable("task_runs", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.WorktreeEntity", b =>
|
||||
{
|
||||
b.Property<string>("TaskId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("task_id");
|
||||
|
||||
b.Property<string>("BaseCommit")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("base_commit");
|
||||
|
||||
b.Property<string>("BranchName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("branch_name");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<string>("DiffStat")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("diff_stat");
|
||||
|
||||
b.Property<string>("HeadCommit")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("head_commit");
|
||||
|
||||
b.Property<string>("Path")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("path");
|
||||
|
||||
b.Property<string>("State")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("active")
|
||||
.HasColumnName("state");
|
||||
|
||||
b.HasKey("TaskId");
|
||||
|
||||
b.ToTable("worktrees", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.ListConfigEntity", b =>
|
||||
{
|
||||
b.HasOne("ClaudeDo.Data.Models.ListEntity", "List")
|
||||
.WithOne("Config")
|
||||
.HasForeignKey("ClaudeDo.Data.Models.ListConfigEntity", "ListId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("List");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.SubtaskEntity", b =>
|
||||
{
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", "Task")
|
||||
.WithMany("Subtasks")
|
||||
.HasForeignKey("TaskId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Task");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskEntity", b =>
|
||||
{
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("BlockedByTaskId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
b.HasOne("ClaudeDo.Data.Models.ListEntity", "List")
|
||||
.WithMany("Tasks")
|
||||
.HasForeignKey("ListId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", "Parent")
|
||||
.WithMany("Children")
|
||||
.HasForeignKey("ParentTaskId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.Navigation("List");
|
||||
|
||||
b.Navigation("Parent");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskRunEntity", b =>
|
||||
{
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", "Task")
|
||||
.WithMany("Runs")
|
||||
.HasForeignKey("TaskId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Task");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.WorktreeEntity", b =>
|
||||
{
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", "Task")
|
||||
.WithOne("Worktree")
|
||||
.HasForeignKey("ClaudeDo.Data.Models.WorktreeEntity", "TaskId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Task");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.ListEntity", b =>
|
||||
{
|
||||
b.Navigation("Config");
|
||||
|
||||
b.Navigation("Tasks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskEntity", b =>
|
||||
{
|
||||
b.Navigation("Children");
|
||||
|
||||
b.Navigation("Runs");
|
||||
|
||||
b.Navigation("Subtasks");
|
||||
|
||||
b.Navigation("Worktree");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
48
src/ClaudeDo.Data/Migrations/20260602060000_PrimeWeekdays.cs
Normal file
48
src/ClaudeDo.Data/Migrations/20260602060000_PrimeWeekdays.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ClaudeDo.Data.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class PrimeWeekdays : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "days_of_week",
|
||||
table: "prime_schedules",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 31);
|
||||
|
||||
migrationBuilder.Sql(
|
||||
"UPDATE prime_schedules SET days_of_week = CASE WHEN workdays_only = 1 THEN 31 ELSE 127 END;");
|
||||
|
||||
migrationBuilder.DropColumn(name: "start_date", table: "prime_schedules");
|
||||
migrationBuilder.DropColumn(name: "end_date", table: "prime_schedules");
|
||||
migrationBuilder.DropColumn(name: "workdays_only", table: "prime_schedules");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<DateOnly>(
|
||||
name: "start_date", table: "prime_schedules",
|
||||
type: "TEXT", nullable: false, defaultValue: new DateOnly(2000, 1, 1));
|
||||
migrationBuilder.AddColumn<DateOnly>(
|
||||
name: "end_date", table: "prime_schedules",
|
||||
type: "TEXT", nullable: false, defaultValue: new DateOnly(2099, 12, 31));
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "workdays_only", table: "prime_schedules",
|
||||
type: "INTEGER", nullable: false, defaultValue: true);
|
||||
|
||||
migrationBuilder.Sql(
|
||||
"UPDATE prime_schedules SET workdays_only = CASE WHEN days_of_week = 127 THEN 0 ELSE 1 END;");
|
||||
|
||||
migrationBuilder.DropColumn(name: "days_of_week", table: "prime_schedules");
|
||||
}
|
||||
}
|
||||
}
|
||||
675
src/ClaudeDo.Data/Migrations/20260603072822_WeeklyReport.Designer.cs
generated
Normal file
675
src/ClaudeDo.Data/Migrations/20260603072822_WeeklyReport.Designer.cs
generated
Normal file
@@ -0,0 +1,675 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using ClaudeDo.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ClaudeDo.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(ClaudeDoDbContext))]
|
||||
[Migration("20260603072822_WeeklyReport")]
|
||||
partial class WeeklyReport
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "8.0.11");
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.AppSettingsEntity", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<string>("CentralWorktreeRoot")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("central_worktree_root");
|
||||
|
||||
b.Property<string>("DefaultClaudeInstructions")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("")
|
||||
.HasColumnName("default_claude_instructions");
|
||||
|
||||
b.Property<int>("DefaultMaxTurns")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(30)
|
||||
.HasColumnName("default_max_turns");
|
||||
|
||||
b.Property<string>("DefaultModel")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("sonnet")
|
||||
.HasColumnName("default_model");
|
||||
|
||||
b.Property<string>("DefaultPermissionMode")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("bypassPermissions")
|
||||
.HasColumnName("default_permission_mode");
|
||||
|
||||
b.Property<int>("MaxParallelExecutions")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(1)
|
||||
.HasColumnName("max_parallel_executions");
|
||||
|
||||
b.Property<string>("RepoImportFolders")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("repo_import_folders");
|
||||
|
||||
b.Property<string>("ReportExcludedPaths")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("report_excluded_paths");
|
||||
|
||||
b.Property<int>("StandupWeekday")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(3)
|
||||
.HasColumnName("standup_weekday");
|
||||
|
||||
b.Property<int>("WorktreeAutoCleanupDays")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(7)
|
||||
.HasColumnName("worktree_auto_cleanup_days");
|
||||
|
||||
b.Property<bool>("WorktreeAutoCleanupEnabled")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("worktree_auto_cleanup_enabled");
|
||||
|
||||
b.Property<string>("WorktreeStrategy")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("sibling")
|
||||
.HasColumnName("worktree_strategy");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("app_settings", (string)null);
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
DefaultClaudeInstructions = "",
|
||||
DefaultMaxTurns = 100,
|
||||
DefaultModel = "sonnet",
|
||||
DefaultPermissionMode = "auto",
|
||||
MaxParallelExecutions = 1,
|
||||
StandupWeekday = 3,
|
||||
WorktreeAutoCleanupDays = 7,
|
||||
WorktreeAutoCleanupEnabled = false,
|
||||
WorktreeStrategy = "sibling"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.DailyNoteEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<DateOnly>("Date")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("note_date");
|
||||
|
||||
b.Property<int>("SortOrder")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("sort_order");
|
||||
|
||||
b.Property<string>("Text")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Date");
|
||||
|
||||
b.ToTable("daily_notes", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.ListConfigEntity", b =>
|
||||
{
|
||||
b.Property<string>("ListId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("list_id");
|
||||
|
||||
b.Property<string>("AgentPath")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("agent_path");
|
||||
|
||||
b.Property<string>("Model")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("model");
|
||||
|
||||
b.Property<string>("SystemPrompt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("system_prompt");
|
||||
|
||||
b.HasKey("ListId");
|
||||
|
||||
b.ToTable("list_config", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.ListEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<string>("DefaultCommitType")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("chore")
|
||||
.HasColumnName("default_commit_type");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.Property<int>("SortOrder")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(0)
|
||||
.HasColumnName("sort_order");
|
||||
|
||||
b.Property<string>("WorkingDir")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("working_dir");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("SortOrder")
|
||||
.HasDatabaseName("idx_lists_sort");
|
||||
|
||||
b.ToTable("lists", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.PrimeScheduleEntity", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<DateTimeOffset>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<int>("Days")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(31)
|
||||
.HasColumnName("days_of_week");
|
||||
|
||||
b.Property<bool>("Enabled")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(true)
|
||||
.HasColumnName("enabled");
|
||||
|
||||
b.Property<DateTimeOffset?>("LastRunAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("last_run_at");
|
||||
|
||||
b.Property<string>("PromptOverride")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("prompt_override");
|
||||
|
||||
b.Property<TimeSpan>("TimeOfDay")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("time_of_day");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("prime_schedules", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.SubtaskEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<bool>("Completed")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("completed");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<int>("OrderNum")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("order_num");
|
||||
|
||||
b.Property<string>("TaskId")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("task_id");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("title");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TaskId")
|
||||
.HasDatabaseName("idx_subtasks_task_id");
|
||||
|
||||
b.ToTable("subtasks", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<string>("AgentPath")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("agent_path");
|
||||
|
||||
b.Property<string>("BlockedByTaskId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("blocked_by_task_id");
|
||||
|
||||
b.Property<string>("CommitType")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("chore")
|
||||
.HasColumnName("commit_type");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_by");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("description");
|
||||
|
||||
b.Property<DateTime?>("FinishedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("finished_at");
|
||||
|
||||
b.Property<bool>("IsMyDay")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("is_my_day");
|
||||
|
||||
b.Property<bool>("IsStarred")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("is_starred");
|
||||
|
||||
b.Property<string>("ListId")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("list_id");
|
||||
|
||||
b.Property<string>("LogPath")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("log_path");
|
||||
|
||||
b.Property<string>("Model")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("model");
|
||||
|
||||
b.Property<string>("Notes")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("notes");
|
||||
|
||||
b.Property<string>("ParentTaskId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("parent_task_id");
|
||||
|
||||
b.Property<DateTime?>("PlanningFinalizedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("planning_finalized_at");
|
||||
|
||||
b.Property<string>("PlanningPhase")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("none")
|
||||
.HasColumnName("planning_phase");
|
||||
|
||||
b.Property<string>("PlanningSessionId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("planning_session_id");
|
||||
|
||||
b.Property<string>("PlanningSessionToken")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("planning_session_token");
|
||||
|
||||
b.Property<string>("Result")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("result");
|
||||
|
||||
b.Property<string>("ReviewFeedback")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("review_feedback");
|
||||
|
||||
b.Property<DateTime?>("ScheduledFor")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("scheduled_for");
|
||||
|
||||
b.Property<int>("SortOrder")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(0)
|
||||
.HasColumnName("sort_order");
|
||||
|
||||
b.Property<DateTime?>("StartedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("started_at");
|
||||
|
||||
b.Property<string>("Status")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("status");
|
||||
|
||||
b.Property<string>("SystemPrompt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("system_prompt");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("title");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("BlockedByTaskId")
|
||||
.HasDatabaseName("idx_tasks_blocked_by");
|
||||
|
||||
b.HasIndex("ListId")
|
||||
.HasDatabaseName("idx_tasks_list_id");
|
||||
|
||||
b.HasIndex("ParentTaskId")
|
||||
.HasDatabaseName("idx_tasks_parent_task_id");
|
||||
|
||||
b.HasIndex("Status")
|
||||
.HasDatabaseName("idx_tasks_status");
|
||||
|
||||
b.HasIndex("ListId", "SortOrder")
|
||||
.HasDatabaseName("idx_tasks_list_sort");
|
||||
|
||||
b.ToTable("tasks", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskRunEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<string>("ErrorMarkdown")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("error_markdown");
|
||||
|
||||
b.Property<int?>("ExitCode")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("exit_code");
|
||||
|
||||
b.Property<DateTime?>("FinishedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("finished_at");
|
||||
|
||||
b.Property<bool>("IsRetry")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("is_retry");
|
||||
|
||||
b.Property<string>("LogPath")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("log_path");
|
||||
|
||||
b.Property<string>("Prompt")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("prompt");
|
||||
|
||||
b.Property<string>("ResultMarkdown")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("result_markdown");
|
||||
|
||||
b.Property<int>("RunNumber")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("run_number");
|
||||
|
||||
b.Property<string>("SessionId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("session_id");
|
||||
|
||||
b.Property<DateTime?>("StartedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("started_at");
|
||||
|
||||
b.Property<string>("StructuredOutputJson")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("structured_output");
|
||||
|
||||
b.Property<string>("TaskId")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("task_id");
|
||||
|
||||
b.Property<int?>("TokensIn")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("tokens_in");
|
||||
|
||||
b.Property<int?>("TokensOut")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("tokens_out");
|
||||
|
||||
b.Property<int?>("TurnCount")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("turn_count");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TaskId")
|
||||
.HasDatabaseName("idx_task_runs_task_id");
|
||||
|
||||
b.ToTable("task_runs", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.WeekReportEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<DateOnly>("EndDate")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("end_date");
|
||||
|
||||
b.Property<DateTime>("GeneratedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("generated_at");
|
||||
|
||||
b.Property<string>("Markdown")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("markdown");
|
||||
|
||||
b.Property<DateOnly>("StartDate")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("start_date");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("StartDate", "EndDate")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("week_reports", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.WorktreeEntity", b =>
|
||||
{
|
||||
b.Property<string>("TaskId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("task_id");
|
||||
|
||||
b.Property<string>("BaseCommit")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("base_commit");
|
||||
|
||||
b.Property<string>("BranchName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("branch_name");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<string>("DiffStat")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("diff_stat");
|
||||
|
||||
b.Property<string>("HeadCommit")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("head_commit");
|
||||
|
||||
b.Property<string>("Path")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("path");
|
||||
|
||||
b.Property<string>("State")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasDefaultValue("active")
|
||||
.HasColumnName("state");
|
||||
|
||||
b.HasKey("TaskId");
|
||||
|
||||
b.ToTable("worktrees", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.ListConfigEntity", b =>
|
||||
{
|
||||
b.HasOne("ClaudeDo.Data.Models.ListEntity", "List")
|
||||
.WithOne("Config")
|
||||
.HasForeignKey("ClaudeDo.Data.Models.ListConfigEntity", "ListId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("List");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.SubtaskEntity", b =>
|
||||
{
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", "Task")
|
||||
.WithMany("Subtasks")
|
||||
.HasForeignKey("TaskId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Task");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskEntity", b =>
|
||||
{
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("BlockedByTaskId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
b.HasOne("ClaudeDo.Data.Models.ListEntity", "List")
|
||||
.WithMany("Tasks")
|
||||
.HasForeignKey("ListId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", "Parent")
|
||||
.WithMany("Children")
|
||||
.HasForeignKey("ParentTaskId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.Navigation("List");
|
||||
|
||||
b.Navigation("Parent");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskRunEntity", b =>
|
||||
{
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", "Task")
|
||||
.WithMany("Runs")
|
||||
.HasForeignKey("TaskId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Task");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.WorktreeEntity", b =>
|
||||
{
|
||||
b.HasOne("ClaudeDo.Data.Models.TaskEntity", "Task")
|
||||
.WithOne("Worktree")
|
||||
.HasForeignKey("ClaudeDo.Data.Models.WorktreeEntity", "TaskId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Task");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.ListEntity", b =>
|
||||
{
|
||||
b.Navigation("Config");
|
||||
|
||||
b.Navigation("Tasks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.TaskEntity", b =>
|
||||
{
|
||||
b.Navigation("Children");
|
||||
|
||||
b.Navigation("Runs");
|
||||
|
||||
b.Navigation("Subtasks");
|
||||
|
||||
b.Navigation("Worktree");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
94
src/ClaudeDo.Data/Migrations/20260603072822_WeeklyReport.cs
Normal file
94
src/ClaudeDo.Data/Migrations/20260603072822_WeeklyReport.cs
Normal file
@@ -0,0 +1,94 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ClaudeDo.Data.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class WeeklyReport : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "report_excluded_paths",
|
||||
table: "app_settings",
|
||||
type: "TEXT",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "standup_weekday",
|
||||
table: "app_settings",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 3);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "daily_notes",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<string>(type: "TEXT", nullable: false),
|
||||
note_date = table.Column<DateOnly>(type: "TEXT", nullable: false),
|
||||
text = table.Column<string>(type: "TEXT", nullable: false),
|
||||
sort_order = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
created_at = table.Column<DateTime>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_daily_notes", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "week_reports",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<string>(type: "TEXT", nullable: false),
|
||||
start_date = table.Column<DateOnly>(type: "TEXT", nullable: false),
|
||||
end_date = table.Column<DateOnly>(type: "TEXT", nullable: false),
|
||||
markdown = table.Column<string>(type: "TEXT", nullable: false),
|
||||
generated_at = table.Column<DateTime>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_week_reports", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "app_settings",
|
||||
keyColumn: "id",
|
||||
keyValue: 1,
|
||||
columns: new[] { "report_excluded_paths", "standup_weekday" },
|
||||
values: new object[] { null, 3 });
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_daily_notes_note_date",
|
||||
table: "daily_notes",
|
||||
column: "note_date");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_week_reports_start_date_end_date",
|
||||
table: "week_reports",
|
||||
columns: new[] { "start_date", "end_date" },
|
||||
unique: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "daily_notes");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "week_reports");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "report_excluded_paths",
|
||||
table: "app_settings");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "standup_weekday",
|
||||
table: "app_settings");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -64,6 +64,16 @@ namespace ClaudeDo.Data.Migrations
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("repo_import_folders");
|
||||
|
||||
b.Property<string>("ReportExcludedPaths")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("report_excluded_paths");
|
||||
|
||||
b.Property<int>("StandupWeekday")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(3)
|
||||
.HasColumnName("standup_weekday");
|
||||
|
||||
b.Property<int>("WorktreeAutoCleanupDays")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
@@ -96,12 +106,43 @@ namespace ClaudeDo.Data.Migrations
|
||||
DefaultModel = "sonnet",
|
||||
DefaultPermissionMode = "auto",
|
||||
MaxParallelExecutions = 1,
|
||||
StandupWeekday = 3,
|
||||
WorktreeAutoCleanupDays = 7,
|
||||
WorktreeAutoCleanupEnabled = false,
|
||||
WorktreeStrategy = "sibling"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.DailyNoteEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<DateOnly>("Date")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("note_date");
|
||||
|
||||
b.Property<int>("SortOrder")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("sort_order");
|
||||
|
||||
b.Property<string>("Text")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Date");
|
||||
|
||||
b.ToTable("daily_notes", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.ListConfigEntity", b =>
|
||||
{
|
||||
b.Property<string>("ListId")
|
||||
@@ -175,16 +216,18 @@ namespace ClaudeDo.Data.Migrations
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<int>("Days")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(31)
|
||||
.HasColumnName("days_of_week");
|
||||
|
||||
b.Property<bool>("Enabled")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(true)
|
||||
.HasColumnName("enabled");
|
||||
|
||||
b.Property<DateOnly>("EndDate")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("end_date");
|
||||
|
||||
b.Property<DateTimeOffset?>("LastRunAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("last_run_at");
|
||||
@@ -193,20 +236,10 @@ namespace ClaudeDo.Data.Migrations
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("prompt_override");
|
||||
|
||||
b.Property<DateOnly>("StartDate")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("start_date");
|
||||
|
||||
b.Property<TimeSpan>("TimeOfDay")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("time_of_day");
|
||||
|
||||
b.Property<bool>("WorkdaysOnly")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasDefaultValue(true)
|
||||
.HasColumnName("workdays_only");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("prime_schedules", (string)null);
|
||||
@@ -343,6 +376,10 @@ namespace ClaudeDo.Data.Migrations
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("result");
|
||||
|
||||
b.Property<string>("ReviewFeedback")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("review_feedback");
|
||||
|
||||
b.Property<DateTime?>("ScheduledFor")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("scheduled_for");
|
||||
@@ -469,6 +506,37 @@ namespace ClaudeDo.Data.Migrations
|
||||
b.ToTable("task_runs", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.WeekReportEntity", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<DateOnly>("EndDate")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("end_date");
|
||||
|
||||
b.Property<DateTime>("GeneratedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("generated_at");
|
||||
|
||||
b.Property<string>("Markdown")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("markdown");
|
||||
|
||||
b.Property<DateOnly>("StartDate")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("start_date");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("StartDate", "EndDate")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("week_reports", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ClaudeDo.Data.Models.WorktreeEntity", b =>
|
||||
{
|
||||
b.Property<string>("TaskId")
|
||||
|
||||
@@ -20,4 +20,8 @@ public sealed class AppSettingsEntity
|
||||
|
||||
// JSON array of parent folders remembered by the repo-import modal.
|
||||
public string? RepoImportFolders { get; set; }
|
||||
// JSON array of path prefixes whose sessions are excluded from the weekly report.
|
||||
public string? ReportExcludedPaths { get; set; }
|
||||
// DayOfWeek the standup happens on; default Wednesday. Drives the report's default range.
|
||||
public int StandupWeekday { get; set; } = (int)DayOfWeek.Wednesday;
|
||||
}
|
||||
|
||||
10
src/ClaudeDo.Data/Models/DailyNoteEntity.cs
Normal file
10
src/ClaudeDo.Data/Models/DailyNoteEntity.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace ClaudeDo.Data.Models;
|
||||
|
||||
public sealed class DailyNoteEntity
|
||||
{
|
||||
public string Id { get; init; } = Guid.NewGuid().ToString();
|
||||
public DateOnly Date { get; set; }
|
||||
public string Text { get; set; } = string.Empty;
|
||||
public int SortOrder { get; set; }
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
16
src/ClaudeDo.Data/Models/PrimeDays.cs
Normal file
16
src/ClaudeDo.Data/Models/PrimeDays.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace ClaudeDo.Data.Models;
|
||||
|
||||
[Flags]
|
||||
public enum PrimeDays
|
||||
{
|
||||
None = 0,
|
||||
Monday = 1,
|
||||
Tuesday = 2,
|
||||
Wednesday = 4,
|
||||
Thursday = 8,
|
||||
Friday = 16,
|
||||
Saturday = 32,
|
||||
Sunday = 64,
|
||||
Weekdays = Monday | Tuesday | Wednesday | Thursday | Friday, // 31
|
||||
All = Weekdays | Saturday | Sunday, // 127
|
||||
}
|
||||
@@ -3,10 +3,8 @@ namespace ClaudeDo.Data.Models;
|
||||
public sealed class PrimeScheduleEntity
|
||||
{
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public DateOnly StartDate { get; set; }
|
||||
public DateOnly EndDate { get; set; }
|
||||
public PrimeDays Days { get; set; } = PrimeDays.Weekdays;
|
||||
public TimeSpan TimeOfDay { get; set; }
|
||||
public bool WorkdaysOnly { get; set; } = true;
|
||||
public bool Enabled { get; set; } = true;
|
||||
public DateTimeOffset? LastRunAt { get; set; }
|
||||
public string? PromptOverride { get; set; }
|
||||
|
||||
@@ -5,6 +5,7 @@ public enum TaskStatus
|
||||
Idle,
|
||||
Queued,
|
||||
Running,
|
||||
WaitingForReview,
|
||||
Done,
|
||||
Failed,
|
||||
Cancelled,
|
||||
@@ -28,6 +29,7 @@ public sealed class TaskEntity
|
||||
public string? BlockedByTaskId { get; set; }
|
||||
public DateTime? ScheduledFor { get; set; }
|
||||
public string? Result { get; set; }
|
||||
public string? ReviewFeedback { get; set; }
|
||||
public string? LogPath { get; set; }
|
||||
public required DateTime CreatedAt { get; init; }
|
||||
public DateTime? StartedAt { get; set; }
|
||||
|
||||
10
src/ClaudeDo.Data/Models/WeekReportEntity.cs
Normal file
10
src/ClaudeDo.Data/Models/WeekReportEntity.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace ClaudeDo.Data.Models;
|
||||
|
||||
public sealed class WeekReportEntity
|
||||
{
|
||||
public string Id { get; init; } = Guid.NewGuid().ToString();
|
||||
public DateOnly StartDate { get; set; }
|
||||
public DateOnly EndDate { get; set; }
|
||||
public string Markdown { get; set; } = string.Empty;
|
||||
public DateTime GeneratedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
59
src/ClaudeDo.Data/Repositories/DailyNoteRepository.cs
Normal file
59
src/ClaudeDo.Data/Repositories/DailyNoteRepository.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
using ClaudeDo.Data.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace ClaudeDo.Data.Repositories;
|
||||
|
||||
public sealed class DailyNoteRepository
|
||||
{
|
||||
private readonly ClaudeDoDbContext _context;
|
||||
|
||||
public DailyNoteRepository(ClaudeDoDbContext context) => _context = context;
|
||||
|
||||
public async Task<IReadOnlyList<DailyNoteEntity>> ListByDayAsync(DateOnly day, CancellationToken ct = default) =>
|
||||
await _context.DailyNotes.AsNoTracking()
|
||||
.Where(n => n.Date == day)
|
||||
.OrderBy(n => n.SortOrder)
|
||||
.ToListAsync(ct);
|
||||
|
||||
public async Task<IReadOnlyList<DailyNoteEntity>> ListBetweenAsync(
|
||||
DateOnly start, DateOnly end, CancellationToken ct = default) =>
|
||||
await _context.DailyNotes.AsNoTracking()
|
||||
.Where(n => n.Date >= start && n.Date <= end)
|
||||
.OrderBy(n => n.Date).ThenBy(n => n.SortOrder)
|
||||
.ToListAsync(ct);
|
||||
|
||||
public async Task<DailyNoteEntity> AddAsync(DateOnly day, string text, CancellationToken ct = default)
|
||||
{
|
||||
var nextOrder = await _context.DailyNotes
|
||||
.Where(n => n.Date == day)
|
||||
.Select(n => (int?)n.SortOrder)
|
||||
.MaxAsync(ct) ?? -1;
|
||||
|
||||
var note = new DailyNoteEntity
|
||||
{
|
||||
Date = day,
|
||||
Text = text,
|
||||
SortOrder = nextOrder + 1,
|
||||
CreatedAt = DateTime.UtcNow,
|
||||
};
|
||||
_context.DailyNotes.Add(note);
|
||||
await _context.SaveChangesAsync(ct);
|
||||
return note;
|
||||
}
|
||||
|
||||
public async Task UpdateAsync(string id, string text, CancellationToken ct = default)
|
||||
{
|
||||
var row = await _context.DailyNotes.FirstOrDefaultAsync(n => n.Id == id, ct);
|
||||
if (row is null) return;
|
||||
row.Text = text;
|
||||
await _context.SaveChangesAsync(ct);
|
||||
}
|
||||
|
||||
public async Task DeleteAsync(string id, CancellationToken ct = default)
|
||||
{
|
||||
var row = await _context.DailyNotes.FirstOrDefaultAsync(n => n.Id == id, ct);
|
||||
if (row is null) return;
|
||||
_context.DailyNotes.Remove(row);
|
||||
await _context.SaveChangesAsync(ct);
|
||||
}
|
||||
}
|
||||
@@ -12,10 +12,8 @@ public sealed class PrimeScheduleRepository
|
||||
|
||||
public async Task<IReadOnlyList<PrimeScheduleEntity>> ListAsync(CancellationToken ct = default)
|
||||
{
|
||||
var rows = await _context.PrimeSchedules.AsNoTracking()
|
||||
.OrderBy(s => s.StartDate)
|
||||
.ToListAsync(ct);
|
||||
return rows.OrderBy(s => s.StartDate).ThenBy(s => s.TimeOfDay).ToList();
|
||||
var rows = await _context.PrimeSchedules.AsNoTracking().ToListAsync(ct);
|
||||
return rows.OrderBy(s => s.TimeOfDay).ToList();
|
||||
}
|
||||
|
||||
public async Task<PrimeScheduleEntity?> GetAsync(Guid id, CancellationToken ct = default) =>
|
||||
@@ -30,10 +28,8 @@ public sealed class PrimeScheduleRepository
|
||||
}
|
||||
else
|
||||
{
|
||||
existing.StartDate = entity.StartDate;
|
||||
existing.EndDate = entity.EndDate;
|
||||
existing.Days = entity.Days;
|
||||
existing.TimeOfDay = entity.TimeOfDay;
|
||||
existing.WorkdaysOnly = entity.WorkdaysOnly;
|
||||
existing.Enabled = entity.Enabled;
|
||||
existing.PromptOverride = entity.PromptOverride;
|
||||
}
|
||||
|
||||
38
src/ClaudeDo.Data/Repositories/WeekReportRepository.cs
Normal file
38
src/ClaudeDo.Data/Repositories/WeekReportRepository.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using ClaudeDo.Data.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace ClaudeDo.Data.Repositories;
|
||||
|
||||
public sealed class WeekReportRepository
|
||||
{
|
||||
private readonly ClaudeDoDbContext _context;
|
||||
|
||||
public WeekReportRepository(ClaudeDoDbContext context) => _context = context;
|
||||
|
||||
public async Task<WeekReportEntity?> GetByRangeAsync(
|
||||
DateOnly start, DateOnly end, CancellationToken ct = default) =>
|
||||
await _context.WeekReports.AsNoTracking()
|
||||
.FirstOrDefaultAsync(r => r.StartDate == start && r.EndDate == end, ct);
|
||||
|
||||
public async Task UpsertAsync(DateOnly start, DateOnly end, string markdown, CancellationToken ct = default)
|
||||
{
|
||||
var row = await _context.WeekReports
|
||||
.FirstOrDefaultAsync(r => r.StartDate == start && r.EndDate == end, ct);
|
||||
if (row is null)
|
||||
{
|
||||
_context.WeekReports.Add(new WeekReportEntity
|
||||
{
|
||||
StartDate = start,
|
||||
EndDate = end,
|
||||
Markdown = markdown,
|
||||
GeneratedAt = DateTime.UtcNow,
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
row.Markdown = markdown;
|
||||
row.GeneratedAt = DateTime.UtcNow;
|
||||
}
|
||||
await _context.SaveChangesAsync(ct);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,12 @@
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Reflection;
|
||||
using System.Windows;
|
||||
using ClaudeDo.Installer.Core;
|
||||
using ClaudeDo.Installer.Localization;
|
||||
using ClaudeDo.Localization;
|
||||
using ClaudeDo.Releases;
|
||||
using ClaudeDo.Installer.Pages.InstallPage;
|
||||
using ClaudeDo.Installer.Pages.PathsPage;
|
||||
@@ -22,6 +27,17 @@ public partial class App : Application
|
||||
{
|
||||
base.OnStartup(e);
|
||||
|
||||
// --- Initialize localizer as early as possible so all windows can use {loc:Tr} ---
|
||||
var localesDir = Path.Combine(AppContext.BaseDirectory, "locales");
|
||||
var localeStore = LocaleStore.Load(localesDir);
|
||||
var existingSettings = InstallerAppSettings.Load();
|
||||
var initialLang = !string.IsNullOrWhiteSpace(existingSettings.Language)
|
||||
? existingSettings.Language
|
||||
: CultureResolver.Resolve(CultureInfo.CurrentUICulture.Name,
|
||||
localeStore.Available.Select(l => l.Code).ToArray(), "en");
|
||||
var localizer = new Localizer(localeStore, initialLang);
|
||||
TrExtension.Localizer = localizer;
|
||||
|
||||
// --- Self-update pre-flight ---
|
||||
// Resolve current exe path. Assembly.Location may point to a .dll for apphost-based
|
||||
// .NET apps; swap to the .exe companion when that happens.
|
||||
@@ -120,7 +136,7 @@ public partial class App : Application
|
||||
|
||||
// --- Existing wizard start-up unchanged below this line ---
|
||||
|
||||
_services = BuildServices();
|
||||
_services = BuildServices(localizer);
|
||||
|
||||
var context = _services.GetRequiredService<InstallContext>();
|
||||
context.InstallerVersion = GetInstallerVersion();
|
||||
@@ -183,9 +199,10 @@ public partial class App : Application
|
||||
return infoAttr?.InformationalVersion ?? "0.0.0";
|
||||
}
|
||||
|
||||
private static ServiceProvider BuildServices()
|
||||
private static ServiceProvider BuildServices(ILocalizer localizer)
|
||||
{
|
||||
var sc = new ServiceCollection();
|
||||
sc.AddSingleton(localizer);
|
||||
|
||||
// Core
|
||||
sc.AddSingleton<InstallContext>();
|
||||
|
||||
@@ -46,6 +46,9 @@
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ClaudeDo.Data\ClaudeDo.Data.csproj" />
|
||||
<ProjectReference Include="..\ClaudeDo.Releases\ClaudeDo.Releases.csproj" />
|
||||
<ProjectReference Include="..\ClaudeDo.Localization\ClaudeDo.Localization.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="..\ClaudeDo.Localization\Locales.targets" />
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -77,6 +77,7 @@ public sealed class InstallerAppSettings
|
||||
{
|
||||
public string DbPath { get; set; } = "~/.todo-app/todo.db";
|
||||
public string SignalRUrl { get; set; } = "http://127.0.0.1:47821/hub";
|
||||
public string Language { get; set; } = "";
|
||||
|
||||
private static readonly JsonSerializerOptions ReadOpts = new()
|
||||
{
|
||||
|
||||
@@ -36,4 +36,7 @@ public sealed class InstallContext
|
||||
// WelcomePage — register the external MCP endpoint with the Claude CLI.
|
||||
public bool RegisterMcpWithClaude { get; set; } = true;
|
||||
public int ExternalMcpPort { get; set; } = 47_822;
|
||||
|
||||
// Language selection (persisted to ui.config.json)
|
||||
public string Language { get; set; } = "";
|
||||
}
|
||||
|
||||
22
src/ClaudeDo.Installer/Localization/LocalizedString.cs
Normal file
22
src/ClaudeDo.Installer/Localization/LocalizedString.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.ComponentModel;
|
||||
using ClaudeDo.Localization;
|
||||
|
||||
namespace ClaudeDo.Installer.Localization;
|
||||
|
||||
public sealed class LocalizedString : INotifyPropertyChanged
|
||||
{
|
||||
private readonly ILocalizer _localizer;
|
||||
private readonly string _key;
|
||||
|
||||
public LocalizedString(ILocalizer localizer, string key)
|
||||
{
|
||||
_localizer = localizer;
|
||||
_key = key;
|
||||
_localizer.LanguageChanged += (_, _) =>
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Value)));
|
||||
}
|
||||
|
||||
public string Value => _localizer[_key];
|
||||
|
||||
public event PropertyChangedEventHandler? PropertyChanged;
|
||||
}
|
||||
27
src/ClaudeDo.Installer/Localization/TrExtension.cs
Normal file
27
src/ClaudeDo.Installer/Localization/TrExtension.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Markup;
|
||||
using ClaudeDo.Localization;
|
||||
|
||||
namespace ClaudeDo.Installer.Localization;
|
||||
|
||||
public sealed class TrExtension : MarkupExtension
|
||||
{
|
||||
public TrExtension() { }
|
||||
public TrExtension(string key) => Key = key;
|
||||
|
||||
public string Key { get; set; } = "";
|
||||
|
||||
public static ILocalizer? Localizer { get; set; }
|
||||
|
||||
public override object ProvideValue(IServiceProvider serviceProvider)
|
||||
{
|
||||
var loc = Localizer ?? throw new InvalidOperationException("TrExtension.Localizer not initialized");
|
||||
var binding = new Binding(nameof(LocalizedString.Value))
|
||||
{
|
||||
Source = new LocalizedString(loc, Key),
|
||||
Mode = BindingMode.OneWay
|
||||
};
|
||||
return binding.ProvideValue(serviceProvider);
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:ClaudeDo.Installer.Pages.InstallPage"
|
||||
xmlns:loc="clr-namespace:ClaudeDo.Installer.Localization"
|
||||
d:DataContext="{d:DesignInstance local:InstallPageViewModel}"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
@@ -17,8 +18,8 @@
|
||||
|
||||
<!-- Header -->
|
||||
<StackPanel Grid.Row="0" Margin="0,0,0,16">
|
||||
<TextBlock Text="Installation" FontSize="18" FontWeight="SemiBold" Margin="0,0,0,4"/>
|
||||
<TextBlock Text="Click Install to build and deploy ClaudeDo."
|
||||
<TextBlock Text="{loc:Tr installer.install.title}" FontSize="18" FontWeight="SemiBold" Margin="0,0,0,4"/>
|
||||
<TextBlock Text="{loc:Tr installer.install.subtitle}"
|
||||
Foreground="{StaticResource TextSecondaryBrush}" TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
|
||||
@@ -89,11 +90,11 @@
|
||||
|
||||
<!-- Action buttons -->
|
||||
<StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,12,0,0">
|
||||
<Button Content="Cancel" Command="{Binding CancelInstallCommand}"
|
||||
<Button Content="{loc:Tr installer.nav.cancel}" Command="{Binding CancelInstallCommand}"
|
||||
Visibility="{Binding IsInstalling, Converter={StaticResource BoolToVisConverter}}"
|
||||
Margin="0,0,8,0"/>
|
||||
|
||||
<Button Content="Launch ClaudeDo" Command="{Binding LaunchAppCommand}"
|
||||
<Button Content="{loc:Tr installer.install.launch}" Command="{Binding LaunchAppCommand}"
|
||||
Style="{StaticResource AccentButton}"
|
||||
Visibility="{Binding IsComplete, Converter={StaticResource BoolToVisConverter}}"/>
|
||||
</StackPanel>
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Diagnostics;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using ClaudeDo.Installer.Core;
|
||||
using ClaudeDo.Installer.Localization;
|
||||
using ClaudeDo.Installer.Steps;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
@@ -29,7 +30,7 @@ public partial class InstallPageViewModel : ObservableObject, IInstallerPage
|
||||
private InstallPageView? _view;
|
||||
private CancellationTokenSource? _cts;
|
||||
|
||||
public string Title => "Install";
|
||||
public string Title => TrExtension.Localizer?["installer.install.title"] ?? "Install";
|
||||
public string Icon => "\uE896";
|
||||
public int Order => 99;
|
||||
public bool ShowInWizard => true;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:ClaudeDo.Installer.Pages.PathsPage"
|
||||
xmlns:loc="clr-namespace:ClaudeDo.Installer.Localization"
|
||||
d:DataContext="{d:DesignInstance local:PathsPageViewModel}"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
@@ -9,28 +10,28 @@
|
||||
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<StackPanel MaxWidth="520">
|
||||
<TextBlock Text="Data Paths" FontSize="18" FontWeight="SemiBold" Margin="0,0,0,4"/>
|
||||
<TextBlock Text="Configure where ClaudeDo stores its data."
|
||||
<TextBlock Text="{loc:Tr installer.paths.title}" FontSize="18" FontWeight="SemiBold" Margin="0,0,0,4"/>
|
||||
<TextBlock Text="{loc:Tr installer.paths.subtitle}"
|
||||
Foreground="{StaticResource TextSecondaryBrush}" Margin="0,0,0,20"
|
||||
TextWrapping="Wrap"/>
|
||||
|
||||
<Label Content="Database Path"/>
|
||||
<Label Content="{loc:Tr installer.paths.databasePath}"/>
|
||||
<TextBox Text="{Binding DbPath, UpdateSourceTrigger=PropertyChanged}" Margin="0,0,0,12"/>
|
||||
|
||||
<Label Content="Log Directory"/>
|
||||
<Label Content="{loc:Tr installer.paths.logDirectory}"/>
|
||||
<TextBox Text="{Binding LogRoot, UpdateSourceTrigger=PropertyChanged}" Margin="0,0,0,12"/>
|
||||
|
||||
<Label Content="Sandbox Root"/>
|
||||
<Label Content="{loc:Tr installer.paths.sandboxRoot}"/>
|
||||
<TextBox Text="{Binding SandboxRoot, UpdateSourceTrigger=PropertyChanged}" Margin="0,0,0,12"/>
|
||||
|
||||
<Label Content="Worktree Strategy"/>
|
||||
<Label Content="{loc:Tr installer.paths.worktreeStrategy}"/>
|
||||
<ComboBox SelectedItem="{Binding WorktreeRootStrategy}" Margin="0,0,0,12">
|
||||
<sys:String xmlns:sys="clr-namespace:System;assembly=mscorlib">sibling</sys:String>
|
||||
<sys:String xmlns:sys="clr-namespace:System;assembly=mscorlib">central</sys:String>
|
||||
</ComboBox>
|
||||
|
||||
<StackPanel Visibility="{Binding IsCentralVisible, Converter={StaticResource BoolToVisConverter}}">
|
||||
<Label Content="Central Worktree Root"/>
|
||||
<Label Content="{loc:Tr installer.paths.centralWorktreeRoot}"/>
|
||||
<TextBox Text="{Binding CentralWorktreeRoot, UpdateSourceTrigger=PropertyChanged}" Margin="0,0,0,12"/>
|
||||
</StackPanel>
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Windows.Controls;
|
||||
using ClaudeDo.Installer.Core;
|
||||
using ClaudeDo.Installer.Localization;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace ClaudeDo.Installer.Pages.PathsPage;
|
||||
@@ -9,7 +10,7 @@ public partial class PathsPageViewModel : ObservableObject, IInstallerPage
|
||||
private readonly InstallContext _context;
|
||||
private PathsPageView? _view;
|
||||
|
||||
public string Title => "Paths";
|
||||
public string Title => TrExtension.Localizer?["installer.paths.title"] ?? "Paths";
|
||||
public string Icon => "\uE8B7";
|
||||
public int Order => 1;
|
||||
public bool ShowInWizard => true;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:ClaudeDo.Installer.Pages.ServicePage"
|
||||
xmlns:loc="clr-namespace:ClaudeDo.Installer.Localization"
|
||||
d:DataContext="{d:DesignInstance local:ServicePageViewModel}"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
@@ -9,37 +10,37 @@
|
||||
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<StackPanel MaxWidth="520">
|
||||
<TextBlock Text="Worker" FontSize="18" FontWeight="SemiBold" Margin="0,0,0,4"/>
|
||||
<TextBlock Text="Configure the ClaudeDo background worker."
|
||||
<TextBlock Text="{loc:Tr installer.service.title}" FontSize="18" FontWeight="SemiBold" Margin="0,0,0,4"/>
|
||||
<TextBlock Text="{loc:Tr installer.service.subtitle}"
|
||||
Foreground="{StaticResource TextSecondaryBrush}" Margin="0,0,0,20"
|
||||
TextWrapping="Wrap"/>
|
||||
|
||||
<Label Content="SignalR Port"/>
|
||||
<Label Content="{loc:Tr installer.service.signalRPort}"/>
|
||||
<TextBox Text="{Binding SignalRPort, UpdateSourceTrigger=PropertyChanged}" Margin="0,0,0,12"/>
|
||||
|
||||
<Label Content="Queue Backstop Interval (ms)"/>
|
||||
<Label Content="{loc:Tr installer.service.queueBackstopInterval}"/>
|
||||
<TextBox Text="{Binding QueueBackstopIntervalMs, UpdateSourceTrigger=PropertyChanged}" Margin="0,0,0,12"/>
|
||||
|
||||
<Label Content="Claude CLI Path"/>
|
||||
<Label Content="{loc:Tr installer.service.claudeCliPath}"/>
|
||||
<Grid Margin="0,0,0,12">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox Grid.Column="0" Text="{Binding ClaudeBin, UpdateSourceTrigger=PropertyChanged}"/>
|
||||
<Button Grid.Column="1" Content="Browse..." Command="{Binding BrowseClaudeCommand}"
|
||||
<Button Grid.Column="1" Content="{loc:Tr installer.nav.browse}" Command="{Binding BrowseClaudeCommand}"
|
||||
Margin="8,0,0,0"/>
|
||||
</Grid>
|
||||
|
||||
<Separator Margin="0,4,0,12"/>
|
||||
|
||||
<TextBlock Text="The worker runs as you (the logged-in user) via a per-user logon task, so it can use your Claude CLI authentication."
|
||||
<TextBlock Text="{loc:Tr installer.service.autostartHint}"
|
||||
Foreground="{StaticResource TextDimBrush}" FontSize="11" Margin="0,0,0,12"
|
||||
TextWrapping="Wrap"/>
|
||||
|
||||
<CheckBox Content="Start worker automatically at logon" IsChecked="{Binding AutoStart}" Margin="0,0,0,12"/>
|
||||
<CheckBox Content="{loc:Tr installer.service.autostart}" IsChecked="{Binding AutoStart}" Margin="0,0,0,12"/>
|
||||
|
||||
<Label Content="Restart Delay (ms)"/>
|
||||
<Label Content="{loc:Tr installer.service.restartDelay}"/>
|
||||
<TextBox Text="{Binding RestartDelayMs, UpdateSourceTrigger=PropertyChanged}" Margin="0,0,0,12"/>
|
||||
|
||||
<TextBlock Text="{Binding ValidationError}" Foreground="{StaticResource ErrorBrush}" FontSize="11"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Windows.Controls;
|
||||
using ClaudeDo.Installer.Core;
|
||||
using ClaudeDo.Installer.Localization;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using Microsoft.Win32;
|
||||
@@ -11,7 +12,7 @@ public partial class ServicePageViewModel : ObservableObject, IInstallerPage
|
||||
private readonly InstallContext _context;
|
||||
private ServicePageView? _view;
|
||||
|
||||
public string Title => "Service";
|
||||
public string Title => TrExtension.Localizer?["installer.service.title"] ?? "Service";
|
||||
public string Icon => "\uE912";
|
||||
public int Order => 2;
|
||||
public bool ShowInWizard => true;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:ClaudeDo.Installer.Pages.UiSettingsPage"
|
||||
xmlns:loc="clr-namespace:ClaudeDo.Installer.Localization"
|
||||
d:DataContext="{d:DesignInstance local:UiSettingsPageViewModel}"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
@@ -9,22 +10,22 @@
|
||||
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<StackPanel MaxWidth="520">
|
||||
<TextBlock Text="UI Settings" FontSize="18" FontWeight="SemiBold" Margin="0,0,0,4"/>
|
||||
<TextBlock Text="Configure the ClaudeDo desktop UI connection settings."
|
||||
<TextBlock Text="{loc:Tr installer.uiSettings.title}" FontSize="18" FontWeight="SemiBold" Margin="0,0,0,4"/>
|
||||
<TextBlock Text="{loc:Tr installer.uiSettings.subtitle}"
|
||||
Foreground="{StaticResource TextSecondaryBrush}" Margin="0,0,0,20"
|
||||
TextWrapping="Wrap"/>
|
||||
|
||||
<CheckBox Content="Sync with service settings" IsChecked="{Binding IsSynced}" Margin="0,0,0,16"/>
|
||||
<CheckBox Content="{loc:Tr installer.uiSettings.syncWithService}" IsChecked="{Binding IsSynced}" Margin="0,0,0,16"/>
|
||||
|
||||
<Label Content="SignalR URL"/>
|
||||
<Label Content="{loc:Tr installer.uiSettings.signalRUrl}"/>
|
||||
<TextBox Text="{Binding SignalRUrl, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsReadOnly="{Binding IsSynced}" Margin="0,0,0,12"/>
|
||||
|
||||
<Label Content="Database Path"/>
|
||||
<Label Content="{loc:Tr installer.paths.databasePath}"/>
|
||||
<TextBox Text="{Binding UiDbPath, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsReadOnly="{Binding IsSynced}" Margin="0,0,0,12"/>
|
||||
|
||||
<TextBlock Text="When synced, these values are derived from the Service and Paths pages."
|
||||
<TextBlock Text="{loc:Tr installer.uiSettings.syncHint}"
|
||||
Foreground="{StaticResource TextDimBrush}" FontSize="11" TextWrapping="Wrap"
|
||||
Visibility="{Binding IsSynced, Converter={StaticResource BoolToVisConverter}}"
|
||||
Margin="0,0,0,12"/>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Windows.Controls;
|
||||
using ClaudeDo.Installer.Core;
|
||||
using ClaudeDo.Installer.Localization;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace ClaudeDo.Installer.Pages.UiSettingsPage;
|
||||
@@ -9,7 +10,7 @@ public partial class UiSettingsPageViewModel : ObservableObject, IInstallerPage
|
||||
private readonly InstallContext _context;
|
||||
private UiSettingsPageView? _view;
|
||||
|
||||
public string Title => "UI Settings";
|
||||
public string Title => TrExtension.Localizer?["installer.uiSettings.title"] ?? "UI Settings";
|
||||
public string Icon => "\uE771";
|
||||
public int Order => 3;
|
||||
public bool ShowInWizard => true;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:ClaudeDo.Installer.Pages.WelcomePage"
|
||||
xmlns:loc="clr-namespace:ClaudeDo.Installer.Localization"
|
||||
d:DataContext="{d:DesignInstance local:WelcomePageViewModel}"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
@@ -14,7 +15,7 @@
|
||||
<TextBlock Text="{Binding Subheading}" TextWrapping="Wrap"
|
||||
Foreground="{StaticResource TextSecondaryBrush}" Margin="0,0,0,24"/>
|
||||
|
||||
<Label Content="Install Directory"/>
|
||||
<Label Content="{loc:Tr installer.welcome.installDirectory}"/>
|
||||
<Grid Margin="0,0,0,4">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
@@ -24,7 +25,7 @@
|
||||
Text="{Binding InstallDirectory, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsEnabled="{Binding InstallDirEditable}"/>
|
||||
<Button Grid.Column="1"
|
||||
Content="Browse..."
|
||||
Content="{loc:Tr installer.nav.browse}"
|
||||
Margin="8,0,0,0"
|
||||
Command="{Binding BrowseInstallCommand}"
|
||||
IsEnabled="{Binding InstallDirEditable}"/>
|
||||
@@ -32,10 +33,10 @@
|
||||
<TextBlock Text="{Binding InstallError}" Foreground="{StaticResource ErrorBrush}" FontSize="11"
|
||||
Visibility="{Binding InstallError, Converter={StaticResource NullToCollapsedConverter}}"/>
|
||||
|
||||
<CheckBox Content="Register MCP server with Claude"
|
||||
<CheckBox Content="{loc:Tr installer.welcome.registerMcp}"
|
||||
IsChecked="{Binding RegisterMcp}"
|
||||
Margin="0,24,0,0"/>
|
||||
<TextBlock Text="Runs 'claude mcp add' so Claude can view and manage your ClaudeDo tasks. You can change this later."
|
||||
<TextBlock Text="{loc:Tr installer.welcome.registerMcpHint}"
|
||||
TextWrapping="Wrap" FontSize="11"
|
||||
Foreground="{StaticResource TextSecondaryBrush}"
|
||||
Margin="0,4,0,0"/>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.IO;
|
||||
using System.Windows.Controls;
|
||||
using ClaudeDo.Installer.Core;
|
||||
using ClaudeDo.Installer.Localization;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using Microsoft.Win32;
|
||||
@@ -12,7 +13,7 @@ public partial class WelcomePageViewModel : ObservableObject, IInstallerPage
|
||||
private readonly InstallContext _context;
|
||||
private WelcomePageView? _view;
|
||||
|
||||
public string Title => "Welcome";
|
||||
public string Title => TrExtension.Localizer?["installer.welcome.title"] ?? "Welcome";
|
||||
public string Icon => "\uE80F";
|
||||
public int Order => 0;
|
||||
public bool ShowInWizard => true;
|
||||
@@ -37,17 +38,18 @@ public partial class WelcomePageViewModel : ObservableObject, IInstallerPage
|
||||
? @"C:\Program Files\ClaudeDo"
|
||||
: _context.InstallDirectory;
|
||||
|
||||
var loc = TrExtension.Localizer;
|
||||
switch (_context.Mode)
|
||||
{
|
||||
case InstallerMode.FreshInstall:
|
||||
Heading = "Install ClaudeDo";
|
||||
Subheading = "Choose where to install ClaudeDo, then click Next.";
|
||||
Heading = loc?["installer.welcome.heading"] ?? "Install ClaudeDo";
|
||||
Subheading = loc?["installer.welcome.subheading"] ?? "Choose where to install ClaudeDo, then click Next.";
|
||||
InstallDirEditable = true;
|
||||
break;
|
||||
|
||||
case InstallerMode.Update:
|
||||
Heading = $"Update ClaudeDo {_context.InstalledVersion ?? "?"} -> {_context.LatestVersion ?? "?"}";
|
||||
Subheading = "Your tasks, config, and database will be preserved. Click Next to continue.";
|
||||
Subheading = loc?["installer.welcome.updateSubheading"] ?? "Your tasks, config, and database will be preserved. Click Next to continue.";
|
||||
InstallDirEditable = false; // stay where we were installed
|
||||
break;
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ public sealed class WriteConfigStep : IInstallStep
|
||||
{
|
||||
DbPath = Paths.Expand(ctx.UiDbPath),
|
||||
SignalRUrl = ctx.SignalRUrl,
|
||||
Language = ctx.Language,
|
||||
};
|
||||
uiCfg.Save();
|
||||
progress.Report("Written ui.config.json");
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<Window x:Class="ClaudeDo.Installer.Views.SelfUpdatePromptWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:loc="clr-namespace:ClaudeDo.Installer.Localization"
|
||||
Title="ClaudeDo Installer Update"
|
||||
Width="460" Height="200"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
@@ -13,13 +14,13 @@
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="0" FontSize="16" FontWeight="SemiBold" Text="A newer installer is available"/>
|
||||
<TextBlock Grid.Row="0" FontSize="16" FontWeight="SemiBold" Text="{loc:Tr installer.selfUpdate.heading}"/>
|
||||
<TextBlock Grid.Row="1" Margin="0,8,0,0" TextWrapping="Wrap" x:Name="DetailText"/>
|
||||
<TextBlock Grid.Row="2" Margin="0,12,0,0" TextWrapping="Wrap" Foreground="#a0a0a0" x:Name="ProgressText" Visibility="Collapsed"/>
|
||||
<StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Button x:Name="UpdateBtn" Content="Update" MinWidth="90" Margin="4,0" Padding="10,4" Click="UpdateBtn_Click" IsDefault="True"/>
|
||||
<Button x:Name="ContinueBtn" Content="Continue anyway" MinWidth="140" Margin="4,0" Padding="10,4" Click="ContinueBtn_Click"/>
|
||||
<Button x:Name="CancelBtn" Content="Cancel" MinWidth="90" Margin="4,0" Padding="10,4" Click="CancelBtn_Click" IsCancel="True"/>
|
||||
<Button x:Name="UpdateBtn" Content="{loc:Tr installer.selfUpdate.update}" MinWidth="90" Margin="4,0" Padding="10,4" Click="UpdateBtn_Click" IsDefault="True"/>
|
||||
<Button x:Name="ContinueBtn" Content="{loc:Tr installer.selfUpdate.continueAnyway}" MinWidth="140" Margin="4,0" Padding="10,4" Click="ContinueBtn_Click"/>
|
||||
<Button x:Name="CancelBtn" Content="{loc:Tr installer.nav.cancel}" MinWidth="90" Margin="4,0" Padding="10,4" Click="CancelBtn_Click" IsCancel="True"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Windows;
|
||||
using ClaudeDo.Installer.Core;
|
||||
using ClaudeDo.Localization;
|
||||
using ClaudeDo.Releases;
|
||||
using ClaudeDo.Installer.Steps;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
@@ -10,6 +11,7 @@ namespace ClaudeDo.Installer.Views;
|
||||
public partial class SettingsViewModel : ObservableObject
|
||||
{
|
||||
private readonly InstallContext _context;
|
||||
private readonly ILocalizer _localizer;
|
||||
private readonly IReleaseClient _releases;
|
||||
private readonly StopWorkerStep _stopService;
|
||||
private readonly StartWorkerStep _startService;
|
||||
@@ -37,6 +39,7 @@ public partial class SettingsViewModel : ObservableObject
|
||||
public SettingsViewModel(
|
||||
PageResolver resolver,
|
||||
InstallContext context,
|
||||
ILocalizer localizer,
|
||||
IReleaseClient releases,
|
||||
StopWorkerStep stopService,
|
||||
StartWorkerStep startService,
|
||||
@@ -46,6 +49,7 @@ public partial class SettingsViewModel : ObservableObject
|
||||
{
|
||||
Pages = resolver.SettingsPages;
|
||||
_context = context;
|
||||
_localizer = localizer;
|
||||
_releases = releases;
|
||||
_stopService = stopService;
|
||||
_startService = startService;
|
||||
@@ -104,6 +108,7 @@ public partial class SettingsViewModel : ObservableObject
|
||||
{
|
||||
DbPath = _context.UiDbPath,
|
||||
SignalRUrl = _context.SignalRUrl,
|
||||
Language = _localizer.CurrentCode,
|
||||
};
|
||||
uiCfg.Save();
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:views="clr-namespace:ClaudeDo.Installer.Views"
|
||||
xmlns:loc="clr-namespace:ClaudeDo.Installer.Localization"
|
||||
Title="ClaudeDo Settings"
|
||||
Icon="/ClaudeTaskSetup.ico"
|
||||
Width="720" Height="520"
|
||||
@@ -90,16 +91,16 @@
|
||||
</StackPanel>
|
||||
|
||||
<CheckBox Grid.Column="1" IsChecked="{Binding RemoveAppData}"
|
||||
Content="Remove user data (tasks, logs, configs in ~/.todo-app)"
|
||||
Content="{loc:Tr installer.settings.removeUserData}"
|
||||
Margin="0,0,12,0" VerticalAlignment="Center"/>
|
||||
<Button Grid.Column="2" Content="Uninstall" Margin="0,0,8,0"
|
||||
<Button Grid.Column="2" Content="{loc:Tr installer.settings.uninstall}" Margin="0,0,8,0"
|
||||
Command="{Binding UninstallCommand}"/>
|
||||
<Button Grid.Column="3" Content="Repair" Margin="0,0,8,0"
|
||||
<Button Grid.Column="3" Content="{loc:Tr installer.settings.repair}" Margin="0,0,8,0"
|
||||
Command="{Binding RepairCommand}"/>
|
||||
<Button Grid.Column="4" Content="Save" Margin="0,0,8,0"
|
||||
<Button Grid.Column="4" Content="{loc:Tr installer.settings.save}" Margin="0,0,8,0"
|
||||
Command="{Binding SaveCommand}"
|
||||
Style="{StaticResource AccentButton}"/>
|
||||
<Button Grid.Column="5" Content="Close"
|
||||
<Button Grid.Column="5" Content="{loc:Tr installer.settings.close}"
|
||||
Command="{Binding CloseCommand}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Windows;
|
||||
using ClaudeDo.Installer.Core;
|
||||
using ClaudeDo.Installer.Pages.InstallPage;
|
||||
using ClaudeDo.Installer.Pages.WelcomePage;
|
||||
using ClaudeDo.Localization;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
|
||||
@@ -11,8 +12,20 @@ namespace ClaudeDo.Installer.Views;
|
||||
public partial class WizardViewModel : ObservableObject
|
||||
{
|
||||
private readonly InstallContext _context;
|
||||
private readonly ILocalizer _localizer;
|
||||
|
||||
public IReadOnlyList<IInstallerPage> Pages { get; }
|
||||
public IReadOnlyList<LanguageOption> Languages { get; }
|
||||
|
||||
[ObservableProperty]
|
||||
private LanguageOption? _selectedLanguage;
|
||||
|
||||
partial void OnSelectedLanguageChanged(LanguageOption? value)
|
||||
{
|
||||
if (value is null) return;
|
||||
_localizer.SetLanguage(value.Value.Code);
|
||||
_context.Language = value.Value.Code;
|
||||
}
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(CanGoBack))]
|
||||
@@ -24,14 +37,20 @@ public partial class WizardViewModel : ObservableObject
|
||||
public IInstallerPage CurrentPage => Pages[CurrentPageIndex];
|
||||
public bool CanGoBack => CurrentPageIndex > 0;
|
||||
public bool IsLastPage => CurrentPageIndex == Pages.Count - 1;
|
||||
public string NextButtonText => IsLastPage ? "Install" : "Next \u2192";
|
||||
public string NextButtonText => IsLastPage
|
||||
? (_localizer["installer.nav.install"])
|
||||
: (_localizer["installer.nav.next"]);
|
||||
|
||||
[ObservableProperty]
|
||||
private string? _validationError;
|
||||
|
||||
public WizardViewModel(PageResolver resolver, InstallContext context)
|
||||
public WizardViewModel(PageResolver resolver, InstallContext context, ILocalizer localizer)
|
||||
{
|
||||
_context = context;
|
||||
_localizer = localizer;
|
||||
Languages = localizer.AvailableLanguages;
|
||||
_selectedLanguage = Languages.FirstOrDefault(l => l.Code == localizer.CurrentCode);
|
||||
_context.Language = localizer.CurrentCode;
|
||||
|
||||
var all = resolver.WizardPages;
|
||||
Pages = context.Mode == InstallerMode.Update
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:views="clr-namespace:ClaudeDo.Installer.Views"
|
||||
xmlns:loc="clr-namespace:ClaudeDo.Installer.Localization"
|
||||
Title="ClaudeDo Installer"
|
||||
Icon="/ClaudeTaskSetup.ico"
|
||||
Width="720" Height="520"
|
||||
@@ -27,6 +28,12 @@
|
||||
<Border Grid.Row="0" Background="{StaticResource IslandBgBrush}"
|
||||
BorderBrush="{StaticResource BorderSubtleBrush}" BorderThickness="0,0,0,1"
|
||||
Padding="20,14">
|
||||
<DockPanel>
|
||||
<ComboBox DockPanel.Dock="Right"
|
||||
ItemsSource="{Binding Languages}"
|
||||
SelectedItem="{Binding SelectedLanguage, Mode=TwoWay}"
|
||||
DisplayMemberPath="Name"
|
||||
Width="150" HorizontalAlignment="Right" VerticalAlignment="Center"/>
|
||||
<ItemsControl ItemsSource="{Binding Pages}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
@@ -61,6 +68,7 @@
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</DockPanel>
|
||||
</Border>
|
||||
|
||||
<!-- Page Content -->
|
||||
@@ -85,7 +93,7 @@
|
||||
VerticalAlignment="Center" FontSize="12"
|
||||
Visibility="{Binding ValidationError, Converter={StaticResource NullToCollapsedConverter}}"/>
|
||||
|
||||
<Button Grid.Column="1" Content="Back"
|
||||
<Button Grid.Column="1" Content="{loc:Tr installer.nav.back}"
|
||||
Command="{Binding GoBackCommand}"
|
||||
IsEnabled="{Binding CanGoBack}"
|
||||
Margin="0,0,8,0" MinWidth="80"/>
|
||||
|
||||
11
src/ClaudeDo.Localization/ClaudeDo.Localization.csproj
Normal file
11
src/ClaudeDo.Localization/ClaudeDo.Localization.csproj
Normal file
@@ -0,0 +1,11 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<InternalsVisibleTo Include="ClaudeDo.Localization.Tests" />
|
||||
</ItemGroup>
|
||||
<Import Project="Locales.targets" />
|
||||
</Project>
|
||||
16
src/ClaudeDo.Localization/CultureResolver.cs
Normal file
16
src/ClaudeDo.Localization/CultureResolver.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace ClaudeDo.Localization;
|
||||
|
||||
public static class CultureResolver
|
||||
{
|
||||
public static string Resolve(string cultureName, IReadOnlyCollection<string> available, string fallback = "en")
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(cultureName)) return fallback;
|
||||
|
||||
var exact = available.FirstOrDefault(c => string.Equals(c, cultureName, StringComparison.OrdinalIgnoreCase));
|
||||
if (exact is not null) return exact;
|
||||
|
||||
var primary = cultureName.Split('-')[0];
|
||||
var byPrimary = available.FirstOrDefault(c => string.Equals(c, primary, StringComparison.OrdinalIgnoreCase));
|
||||
return byPrimary ?? fallback;
|
||||
}
|
||||
}
|
||||
13
src/ClaudeDo.Localization/ILocalizer.cs
Normal file
13
src/ClaudeDo.Localization/ILocalizer.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace ClaudeDo.Localization;
|
||||
|
||||
public readonly record struct LanguageOption(string Code, string Name);
|
||||
|
||||
public interface ILocalizer
|
||||
{
|
||||
string this[string key] { get; }
|
||||
string Get(string key, params object[] args);
|
||||
string CurrentCode { get; }
|
||||
IReadOnlyList<LanguageOption> AvailableLanguages { get; }
|
||||
void SetLanguage(string code);
|
||||
event EventHandler? LanguageChanged;
|
||||
}
|
||||
15
src/ClaudeDo.Localization/LocaleFile.cs
Normal file
15
src/ClaudeDo.Localization/LocaleFile.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace ClaudeDo.Localization;
|
||||
|
||||
public sealed class LocaleFile
|
||||
{
|
||||
public LocaleFile(string code, string name, IReadOnlyDictionary<string, string> strings)
|
||||
{
|
||||
Code = code;
|
||||
Name = name;
|
||||
Strings = strings;
|
||||
}
|
||||
|
||||
public string Code { get; }
|
||||
public string Name { get; }
|
||||
public IReadOnlyDictionary<string, string> Strings { get; }
|
||||
}
|
||||
46
src/ClaudeDo.Localization/LocaleJson.cs
Normal file
46
src/ClaudeDo.Localization/LocaleJson.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System.Text.Json;
|
||||
|
||||
namespace ClaudeDo.Localization;
|
||||
|
||||
public static class LocaleJson
|
||||
{
|
||||
public static LocaleFile Parse(string json)
|
||||
{
|
||||
using var doc = JsonDocument.Parse(json);
|
||||
var root = doc.RootElement;
|
||||
|
||||
var code = "";
|
||||
var name = "";
|
||||
if (root.TryGetProperty("metadata", out var meta) && meta.ValueKind == JsonValueKind.Object)
|
||||
{
|
||||
if (meta.TryGetProperty("code", out var c)) code = c.GetString() ?? "";
|
||||
if (meta.TryGetProperty("name", out var n)) name = n.GetString() ?? "";
|
||||
}
|
||||
|
||||
var strings = new Dictionary<string, string>(StringComparer.Ordinal);
|
||||
foreach (var prop in root.EnumerateObject())
|
||||
{
|
||||
if (prop.NameEquals("metadata")) continue;
|
||||
Flatten(prop.Name, prop.Value, strings);
|
||||
}
|
||||
|
||||
return new LocaleFile(code, name, strings);
|
||||
}
|
||||
|
||||
private static void Flatten(string prefix, JsonElement el, IDictionary<string, string> into)
|
||||
{
|
||||
switch (el.ValueKind)
|
||||
{
|
||||
case JsonValueKind.Object:
|
||||
foreach (var p in el.EnumerateObject())
|
||||
Flatten($"{prefix}.{p.Name}", p.Value, into);
|
||||
break;
|
||||
case JsonValueKind.String:
|
||||
into[prefix] = el.GetString() ?? "";
|
||||
break;
|
||||
default:
|
||||
into[prefix] = el.ToString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
31
src/ClaudeDo.Localization/LocaleStore.cs
Normal file
31
src/ClaudeDo.Localization/LocaleStore.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
namespace ClaudeDo.Localization;
|
||||
|
||||
public sealed class LocaleStore
|
||||
{
|
||||
private readonly Dictionary<string, LocaleFile> _byCode;
|
||||
|
||||
private LocaleStore(Dictionary<string, LocaleFile> byCode) => _byCode = byCode;
|
||||
|
||||
public IReadOnlyList<LocaleFile> Available => _byCode.Values.ToList();
|
||||
|
||||
public bool TryGet(string code, out LocaleFile? file) => _byCode.TryGetValue(code, out file);
|
||||
|
||||
public static LocaleStore Load(string folder)
|
||||
{
|
||||
var byCode = new Dictionary<string, LocaleFile>(StringComparer.OrdinalIgnoreCase);
|
||||
if (Directory.Exists(folder))
|
||||
{
|
||||
foreach (var path in Directory.EnumerateFiles(folder, "*.json"))
|
||||
{
|
||||
try
|
||||
{
|
||||
var file = LocaleJson.Parse(File.ReadAllText(path));
|
||||
if (!string.IsNullOrWhiteSpace(file.Code))
|
||||
byCode[file.Code] = file;
|
||||
}
|
||||
catch { /* skip malformed locale files */ }
|
||||
}
|
||||
}
|
||||
return new LocaleStore(byCode);
|
||||
}
|
||||
}
|
||||
7
src/ClaudeDo.Localization/Locales.targets
Normal file
7
src/ClaudeDo.Localization/Locales.targets
Normal file
@@ -0,0 +1,7 @@
|
||||
<Project>
|
||||
<ItemGroup>
|
||||
<Content Include="$(MSBuildThisFileDirectory)locales\*.json"
|
||||
Link="locales\%(Filename)%(Extension)"
|
||||
CopyToOutputDirectory="PreserveNewest" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
55
src/ClaudeDo.Localization/Localizer.cs
Normal file
55
src/ClaudeDo.Localization/Localizer.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
namespace ClaudeDo.Localization;
|
||||
|
||||
public sealed class Localizer : ILocalizer
|
||||
{
|
||||
private readonly LocaleStore _store;
|
||||
private readonly string _fallbackCode;
|
||||
private LocaleFile? _active;
|
||||
private LocaleFile? _fallback;
|
||||
|
||||
public Localizer(LocaleStore store, string code, string fallbackCode = "en")
|
||||
{
|
||||
_store = store;
|
||||
_fallbackCode = fallbackCode;
|
||||
_store.TryGet(fallbackCode, out _fallback);
|
||||
SetLanguage(code);
|
||||
}
|
||||
|
||||
public string CurrentCode { get; private set; } = "";
|
||||
|
||||
public IReadOnlyList<LanguageOption> AvailableLanguages =>
|
||||
_store.Available.Select(f => new LanguageOption(f.Code, f.Name)).ToList();
|
||||
|
||||
public event EventHandler? LanguageChanged;
|
||||
|
||||
public string this[string key]
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_active is not null && _active.Strings.TryGetValue(key, out var v)) return v;
|
||||
if (_fallback is not null && _fallback.Strings.TryGetValue(key, out var fv)) return fv;
|
||||
return key;
|
||||
}
|
||||
}
|
||||
|
||||
public string Get(string key, params object[] args)
|
||||
{
|
||||
var fmt = this[key];
|
||||
return args.Length == 0 ? fmt : string.Format(fmt, args);
|
||||
}
|
||||
|
||||
public void SetLanguage(string code)
|
||||
{
|
||||
if (_store.TryGet(code, out var f) && f is not null)
|
||||
{
|
||||
_active = f;
|
||||
CurrentCode = f.Code;
|
||||
}
|
||||
else
|
||||
{
|
||||
_active = _fallback;
|
||||
CurrentCode = _fallback?.Code ?? code;
|
||||
}
|
||||
LanguageChanged?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
388
src/ClaudeDo.Localization/locales/de.json
Normal file
388
src/ClaudeDo.Localization/locales/de.json
Normal file
@@ -0,0 +1,388 @@
|
||||
{
|
||||
"metadata": { "code": "de", "name": "Deutsch" },
|
||||
"settings": {
|
||||
"title": "EINSTELLUNGEN",
|
||||
"save": "Speichern",
|
||||
"cancel": "Abbrechen",
|
||||
"language": "Sprache",
|
||||
"tabGeneral": "Allgemein",
|
||||
"tabWorktrees": "Worktrees",
|
||||
"tabFiles": "Dateien",
|
||||
"tabPrime": "Prime Claude",
|
||||
"general": {
|
||||
"defaultInstructions": "Standard-Anweisungen",
|
||||
"defaultInstructionsPlaceholder": "Basis-Anweisungen, die auf jede Aufgabe angewendet werden",
|
||||
"model": "Modell",
|
||||
"maxTurns": "Max. Durchläufe",
|
||||
"permission": "Berechtigung",
|
||||
"maxParallelExecutions": "Max. parallele Ausführungen",
|
||||
"maxParallelExecutionsHint": "Wie viele Aufgaben aus der Warteschlange der Worker gleichzeitig ausführt.",
|
||||
"reportExcludedPaths": "Bericht: ausgeschlossene Pfade (einer pro Zeile)",
|
||||
"standupWeekday": "Standup-Wochentag",
|
||||
"weekdaySunday": "Sonntag",
|
||||
"weekdayMonday": "Montag",
|
||||
"weekdayTuesday": "Dienstag",
|
||||
"weekdayWednesday": "Mittwoch",
|
||||
"weekdayThursday": "Donnerstag",
|
||||
"weekdayFriday": "Freitag",
|
||||
"weekdaySaturday": "Samstag"
|
||||
},
|
||||
"worktrees": {
|
||||
"strategy": "Strategie",
|
||||
"centralWorktreeRoot": "Zentrales Worktree-Verzeichnis",
|
||||
"autoCleanup": "Abgeschlossene Worktrees automatisch aufräumen nach",
|
||||
"days": "Tagen",
|
||||
"cleanupFinished": "Abgeschlossene Worktrees aufräumen",
|
||||
"forceRemoveAll": "Alle Worktrees zwangsweise entfernen",
|
||||
"confirmRemoveAll": "ALLE Worktrees entfernen? Nicht committete Arbeit geht verloren.",
|
||||
"removeAll": "Alle entfernen"
|
||||
},
|
||||
"files": {
|
||||
"agentsSection": "AGENTEN",
|
||||
"agentsHint": "Mitgelieferte Standard-Agenten wiederherstellen. Vorhandene Dateien werden nicht überschrieben.",
|
||||
"restoreDefaultAgents": "Standard-Agenten wiederherstellen",
|
||||
"promptsSection": "PROMPTS",
|
||||
"systemPrompt": "System",
|
||||
"planningPrompt": "Planung",
|
||||
"agentPrompt": "Agent",
|
||||
"openInEditor": "Im Editor öffnen"
|
||||
},
|
||||
"prime": {
|
||||
"description": "Bereite dein Claude-Nutzungsfenster vor, indem an den von dir gewählten Tagen zu einer bestimmten Zeit ein einzelner nicht-interaktiver Ping ausgelöst wird. Läuft nur, solange ClaudeDo geöffnet ist. Wenn die App innerhalb von 30 Minuten vor der Zielzeit startet, wird der Ping sofort ausgelöst.",
|
||||
"addSchedule": "+ Zeitplan hinzufügen",
|
||||
"dayMo": "Mo",
|
||||
"dayTu": "Di",
|
||||
"dayWe": "Mi",
|
||||
"dayTh": "Do",
|
||||
"dayFr": "Fr",
|
||||
"daySa": "Sa",
|
||||
"daySu": "So"
|
||||
}
|
||||
},
|
||||
"tasks": {
|
||||
"sortTip": "Sortieren",
|
||||
"showCompletedTip": "Abgeschlossene anzeigen",
|
||||
"listSettingsTip": "Listeneinstellungen",
|
||||
"addPlaceholder": "Aufgabe hinzufügen…",
|
||||
"enterKey": "ENTER",
|
||||
"notesPinnedRow": "Notizen (Tagesnotizen)",
|
||||
"overdue": "ÜBERFÄLLIG",
|
||||
"tasks": "AUFGABEN",
|
||||
"clearCompletedTip": "Alle abgeschlossenen löschen",
|
||||
"ctxSendToQueue": "In Warteschlange einreihen",
|
||||
"ctxRemoveFromQueue": "Aus Warteschlange entfernen",
|
||||
"ctxCancelExecution": "Ausführung abbrechen",
|
||||
"ctxMarkAs": "Markieren als",
|
||||
"ctxMarkDone": "Erledigt",
|
||||
"ctxMarkCancelled": "Abgebrochen",
|
||||
"ctxRunInteractively": "Interaktiv ausführen",
|
||||
"ctxOpenPlanningSession": "Planungssitzung öffnen",
|
||||
"ctxResumePlanningSession": "Planungssitzung fortsetzen",
|
||||
"ctxDiscardPlanningSession": "Planungssitzung verwerfen",
|
||||
"ctxQueueSubtasks": "Teilaufgaben nacheinander einreihen",
|
||||
"ctxScheduleFor": "Planen für...",
|
||||
"ctxClearSchedule": "Zeitplan entfernen",
|
||||
"badgeDraft": "ENTWURF",
|
||||
"badgePlanned": "GEPLANT",
|
||||
"approve": "Genehmigen",
|
||||
"approveTip": "Genehmigen — als Erledigt markieren",
|
||||
"reject": "Ablehnen",
|
||||
"rejectTip": "Mit Feedback ablehnen und erneut ausführen",
|
||||
"park": "Parken",
|
||||
"parkTip": "Zur manuellen Bearbeitung auf Leerlauf zurücksetzen",
|
||||
"cancel": "Abbrechen",
|
||||
"cancelTip": "Diese Aufgabe abbrechen",
|
||||
"removeFromQueueTip": "Aus Warteschlange entfernen",
|
||||
"scheduleTitle": "Aufgabe planen",
|
||||
"scheduleWhen": "WANN",
|
||||
"scheduleConfirm": "Planen",
|
||||
"rejectRerunTitle": "Ablehnen & erneut ausführen",
|
||||
"feedbackLabel": "FEEDBACK FÜR DEN AGENTEN",
|
||||
"feedbackPlaceholder": "Was soll der Agent korrigieren?",
|
||||
"rerun": "Erneut ausführen"
|
||||
},
|
||||
"lists": {
|
||||
"heading": "Listen",
|
||||
"searchPlaceholder": "Aufgaben suchen…",
|
||||
"searchKbd": "Strg K",
|
||||
"settingsTip": "Einstellungen",
|
||||
"smartListsLabel": "INTELLIGENTE LISTEN",
|
||||
"myListsLabel": "MEINE LISTEN",
|
||||
"contextSettings": "Einstellungen...",
|
||||
"contextWorktrees": "Worktrees…",
|
||||
"contextOpenExplorer": "Im Explorer öffnen",
|
||||
"contextOpenTerminal": "Im Terminal öffnen",
|
||||
"newList": "Neue Liste",
|
||||
"addReposTip": "Repos als Listen hinzufügen"
|
||||
},
|
||||
"details": {
|
||||
"deleteTaskTip": "Aufgabe löschen",
|
||||
"closeTip": "Schließen",
|
||||
"copyTaskIdTip": "Aufgaben-ID kopieren",
|
||||
"starTip": "Favorit",
|
||||
"agentSettingsTip": "Agent-Einstellungen",
|
||||
"agentSettingsHeading": "Agent-Einstellungen (Überschreibungen)",
|
||||
"modelLabel": "Modell",
|
||||
"systemPromptLabel": "System-Prompt (angehängt)",
|
||||
"agentFileLabel": "Agent-Datei",
|
||||
"mergeLabel": "MERGE",
|
||||
"mergeTargetLabel": "Merge-Ziel",
|
||||
"reviewCombinedDiff": "Kombiniertes Diff prüfen",
|
||||
"mergeAllSubtasks": "Alle Teilaufgaben mergen",
|
||||
"stepsLabel": "SCHRITTE",
|
||||
"addStepPlaceholder": "Schritt hinzufügen...",
|
||||
"detailsLabel": "DETAILS",
|
||||
"copyDescriptionTip": "Beschreibung in die Zwischenablage kopieren",
|
||||
"toggleEditPreviewTip": "Bearbeiten/Vorschau umschalten",
|
||||
"previewBtn": "Vorschau",
|
||||
"editBtn": "Bearbeiten",
|
||||
"descriptionPlaceholder": "Aufgabendetails hinzufügen (Markdown unterstützt)..."
|
||||
},
|
||||
"agent": {
|
||||
"stopTip": "Agent stoppen",
|
||||
"sendToQueue": "In Warteschlange einreihen",
|
||||
"sendToQueueTip": "Diese Aufgabe einreihen, damit der Worker sie übernimmt",
|
||||
"removeFromQueue": "Aus Warteschlange entfernen",
|
||||
"removeFromQueueTip": "Diese Aufgabe wieder aus der Warteschlange nehmen",
|
||||
"worktreeLabel": "WORKTREE",
|
||||
"copyPathTip": "Pfad kopieren",
|
||||
"diffLabel": "DIFF",
|
||||
"openDiff": "Diff öffnen",
|
||||
"worktreeBtn": "Worktree",
|
||||
"openWorktreeTip": "Worktree im Datei-Explorer öffnen",
|
||||
"continue": "Fortsetzen",
|
||||
"continueTip": "Die letzte Sitzung fortsetzen und weitermachen",
|
||||
"resetAndRetry": "Zurücksetzen & erneut versuchen",
|
||||
"resetAndRetryTip": "Den Worktree verwerfen und die Aufgabe erneut einreihen, um von vorn zu beginnen"
|
||||
},
|
||||
"notes": {
|
||||
"today": "Heute",
|
||||
"add": "Hinzufügen",
|
||||
"newNotePlaceholder": "Neue Notiz…",
|
||||
"save": "Speichern",
|
||||
"delete": "Löschen"
|
||||
},
|
||||
"session": {
|
||||
"chipLive": "LIVE",
|
||||
"chipDone": "FERTIG",
|
||||
"chipFailed": "FEHLGESCHLAGEN"
|
||||
},
|
||||
"modals": {
|
||||
"about": {
|
||||
"title": "ÜBER",
|
||||
"version": "Version",
|
||||
"data": "Daten",
|
||||
"logs": "Logs",
|
||||
"config": "Konfiguration",
|
||||
"open": "Öffnen"
|
||||
},
|
||||
"workerConnection": {
|
||||
"title": "WORKER NICHT ERREICHBAR",
|
||||
"body": "ClaudeDo kann den Hintergrund-Worker nicht erreichen. Normalerweise wird er bei der Anmeldung automatisch gestartet. Du kannst ihn jetzt starten oder neu installieren, falls das Problem bestehen bleibt.",
|
||||
"dismiss": "Ausblenden",
|
||||
"rerunInstaller": "Installer erneut ausführen",
|
||||
"startWorker": "Worker starten"
|
||||
},
|
||||
"listSettings": {
|
||||
"title": "LISTENEINSTELLUNGEN",
|
||||
"deleteList": "Liste löschen",
|
||||
"sectionGeneral": "ALLGEMEIN",
|
||||
"name": "Name",
|
||||
"workingDirectory": "Arbeitsverzeichnis",
|
||||
"workingDirectoryPlaceholder": "(keines)",
|
||||
"browse": "Durchsuchen...",
|
||||
"defaultCommitType": "Standard-Commit-Typ",
|
||||
"sectionAgent": "AGENT",
|
||||
"resetAgentSettings": "Agent-Einstellungen zurücksetzen",
|
||||
"model": "Modell",
|
||||
"systemPrompt": "System-Prompt (angehängt)",
|
||||
"agentFile": "Agent-Datei"
|
||||
},
|
||||
"merge": {
|
||||
"title": "WORKTREE MERGEN",
|
||||
"windowTitle": "Worktree mergen",
|
||||
"cancel": "Abbrechen",
|
||||
"merge": "Mergen",
|
||||
"targetBranch": "Ziel-Branch",
|
||||
"removeWorktree": "Worktree nach dem Mergen entfernen",
|
||||
"commitMessage": "Commit-Nachricht",
|
||||
"conflictedFiles": "Konfliktdateien:"
|
||||
},
|
||||
"diff": {
|
||||
"title": "DIFF",
|
||||
"windowTitle": "Diff",
|
||||
"merge": "Mergen…"
|
||||
},
|
||||
"worktree": {
|
||||
"title": "Worktree"
|
||||
},
|
||||
"worktreesOverview": {
|
||||
"refresh": "Aktualisieren",
|
||||
"cleanupFinished": "Abgeschlossene aufräumen",
|
||||
"columnTask": "AUFGABE",
|
||||
"columnState": "STATUS",
|
||||
"columnDiff": "DIFF",
|
||||
"columnAge": "ALTER",
|
||||
"phantom": "Phantom",
|
||||
"phantomTooltip": "Verzeichnis fehlt auf der Festplatte",
|
||||
"ctxShowDiff": "Diff anzeigen",
|
||||
"ctxOpenInExplorer": "Im Explorer öffnen",
|
||||
"ctxJumpToTask": "Zur Aufgabe springen",
|
||||
"ctxMerge": "Mergen…",
|
||||
"ctxDiscard": "Verwerfen",
|
||||
"ctxKeep": "Behalten",
|
||||
"ctxCopyBranch": "Branch kopieren",
|
||||
"ctxCopyPath": "Pfad kopieren",
|
||||
"ctxForceRemove": "Zwangsweise entfernen"
|
||||
},
|
||||
"repoImport": {
|
||||
"title": "REPOS ALS LISTEN HINZUFÜGEN",
|
||||
"windowTitle": "Repos als Listen hinzufügen",
|
||||
"cancel": "Abbrechen",
|
||||
"searchPlaceholder": "Repos suchen…",
|
||||
"addFolder": "Ordner hinzufügen…",
|
||||
"forgetFolders": "Ordner vergessen",
|
||||
"alreadyAdded": "(bereits hinzugefügt)"
|
||||
},
|
||||
"unfinishedPlanning": {
|
||||
"title": "UNVOLLENDETE PLANUNGSSITZUNG",
|
||||
"windowTitle": "Unvollendete Planungssitzung",
|
||||
"discard": "Verwerfen",
|
||||
"finalize": "Abschließen",
|
||||
"resume": "Fortsetzen",
|
||||
"draftTasksSuffix": " Entwurfsaufgabe(n) warten auf Abschluss."
|
||||
},
|
||||
"weeklyReport": {
|
||||
"title": "WOCHENBERICHT",
|
||||
"windowTitle": "Wochenbericht",
|
||||
"from": "Von",
|
||||
"to": "Bis",
|
||||
"generate": "Erstellen",
|
||||
"regenerate": "Neu erstellen",
|
||||
"emptyStateHint": "Noch kein Bericht für diesen Zeitraum. Klicke auf „Erstellen“."
|
||||
}
|
||||
},
|
||||
"installer": {
|
||||
"nav": {
|
||||
"back": "Zurück",
|
||||
"next": "Weiter →",
|
||||
"install": "Installieren",
|
||||
"browse": "Durchsuchen...",
|
||||
"cancel": "Abbrechen"
|
||||
},
|
||||
"welcome": {
|
||||
"title": "Willkommen",
|
||||
"heading": "ClaudeDo installieren",
|
||||
"subheading": "Wähle aus, wohin ClaudeDo installiert werden soll, und klicke dann auf Weiter.",
|
||||
"updateSubheading": "Deine Aufgaben, Konfiguration und Datenbank bleiben erhalten. Klicke auf Weiter, um fortzufahren.",
|
||||
"installDirectory": "Installationsverzeichnis",
|
||||
"registerMcp": "MCP-Server bei Claude registrieren",
|
||||
"registerMcpHint": "Führt 'claude mcp add' aus, damit Claude deine ClaudeDo-Aufgaben sehen und verwalten kann. Du kannst dies später ändern."
|
||||
},
|
||||
"paths": {
|
||||
"title": "Datenpfade",
|
||||
"subtitle": "Lege fest, wo ClaudeDo seine Daten speichert.",
|
||||
"databasePath": "Datenbankpfad",
|
||||
"logDirectory": "Log-Verzeichnis",
|
||||
"sandboxRoot": "Sandbox-Verzeichnis",
|
||||
"worktreeStrategy": "Worktree-Strategie",
|
||||
"centralWorktreeRoot": "Zentrales Worktree-Verzeichnis"
|
||||
},
|
||||
"service": {
|
||||
"title": "Worker",
|
||||
"subtitle": "Konfiguriere den ClaudeDo-Hintergrund-Worker.",
|
||||
"signalRPort": "SignalR-Port",
|
||||
"queueBackstopInterval": "Warteschlangen-Backstop-Intervall (ms)",
|
||||
"claudeCliPath": "Claude-CLI-Pfad",
|
||||
"autostart": "Worker bei der Anmeldung automatisch starten",
|
||||
"autostartHint": "Der Worker läuft als du (der angemeldete Benutzer) über eine benutzerbezogene Anmelde-Aufgabe, sodass er deine Claude-CLI-Authentifizierung nutzen kann.",
|
||||
"restartDelay": "Neustart-Verzögerung (ms)"
|
||||
},
|
||||
"uiSettings": {
|
||||
"title": "UI-Einstellungen",
|
||||
"subtitle": "Konfiguriere die Verbindungseinstellungen der ClaudeDo-Desktop-Oberfläche.",
|
||||
"syncWithService": "Mit Worker-Einstellungen synchronisieren",
|
||||
"signalRUrl": "SignalR-URL",
|
||||
"syncHint": "Bei Synchronisierung werden diese Werte aus den Seiten „Worker“ und „Datenpfade“ abgeleitet."
|
||||
},
|
||||
"install": {
|
||||
"title": "Installation",
|
||||
"subtitle": "Klicke auf Installieren, um ClaudeDo zu erstellen und bereitzustellen.",
|
||||
"launch": "ClaudeDo starten"
|
||||
},
|
||||
"settings": {
|
||||
"removeUserData": "Benutzerdaten entfernen (Aufgaben, Logs, Konfigurationen in ~/.todo-app)",
|
||||
"uninstall": "Deinstallieren",
|
||||
"repair": "Reparieren",
|
||||
"save": "Speichern",
|
||||
"close": "Schließen"
|
||||
},
|
||||
"selfUpdate": {
|
||||
"heading": "Ein neuerer Installer ist verfügbar",
|
||||
"update": "Aktualisieren",
|
||||
"continueAnyway": "Trotzdem fortfahren"
|
||||
}
|
||||
},
|
||||
"planning": {
|
||||
"conflict": {
|
||||
"windowTitle": "Merge-Konflikt",
|
||||
"modalTitle": "MERGE-KONFLIKT",
|
||||
"openInVsCode": "Alle in VS Code öffnen",
|
||||
"resolved": "Ich habe gelöst — fortfahren",
|
||||
"abort": "Diesen Merge abbrechen"
|
||||
},
|
||||
"diff": {
|
||||
"windowTitle": "Planung — Kombiniertes Diff",
|
||||
"modalTitle": "PLANUNG — KOMBINIERTES DIFF",
|
||||
"previewCombined": "Kombinierte Vorschau",
|
||||
"loading": "Wird geladen…"
|
||||
}
|
||||
},
|
||||
"controls": {
|
||||
"datePicker": {
|
||||
"today": "Heute",
|
||||
"tomorrow": "Morgen",
|
||||
"nextMon": "Nächster Mo",
|
||||
"clear": "Löschen",
|
||||
"time": "Zeit",
|
||||
"done": "Fertig"
|
||||
}
|
||||
},
|
||||
"shell": {
|
||||
"menu": {
|
||||
"help": "Hilfe",
|
||||
"checkForUpdates": "Nach Updates suchen",
|
||||
"restartWorker": "Worker neu starten",
|
||||
"worktrees": "Worktrees…",
|
||||
"weeklyReport": "Wochenbericht…",
|
||||
"about": "Über…",
|
||||
"addRepos": "Repos als Listen hinzufügen…"
|
||||
},
|
||||
"update": {
|
||||
"available": "Update verfügbar: v",
|
||||
"updateNow": "Jetzt aktualisieren",
|
||||
"dismiss": "Ausblenden"
|
||||
}
|
||||
},
|
||||
"vm": {
|
||||
"connection": { "online": "Online", "connecting": "Verbinden…", "offline": "Offline" },
|
||||
"shell": { "restartingWorker": "Worker wird neu gestartet…" },
|
||||
"agentStatus": { "idle": "Leerlauf", "queued": "In Warteschlange", "running": "Läuft", "done": "Fertig", "failed": "Fehlgeschlagen", "cancelled": "Abgebrochen" },
|
||||
"taskStatus": { "idle": "Leerlauf", "queued": "In Warteschlange", "running": "Läuft", "waitingForReview": "Wartet auf Prüfung", "done": "Fertig", "failed": "Fehlgeschlagen", "cancelled": "Abgebrochen" },
|
||||
"planningBadge": { "active": "PLANUNG", "finalized": "GEPLANT" },
|
||||
"taskRow": { "createdPrefix": "Erstellt {0}", "stepsText": "{0}/{1} Schritte" },
|
||||
"tasksIsland": { "completedHeader": "ABGESCHLOSSEN", "completedHeaderCount": "ABGESCHLOSSEN · {0}" },
|
||||
"diff": { "loadFailed": "Diff konnte nicht geladen werden: {0}", "noChanges": "Keine Änderungen anzuzeigen." },
|
||||
"planningDiff": { "hubError": "Kombinierte Vorschau konnte nicht erstellt werden (Hub-Fehler).", "conflict": "Kombinierte Vorschau nicht möglich: Teilaufgabe {0} steht im Konflikt mit einer früheren Teilaufgabe ({1} Dateien)." },
|
||||
"merge": { "commitMessage": "Merge-Aufgabe: {0}", "workerOfflineBranches": "Worker offline — Branches können nicht aufgelistet werden.", "loadBranchesFailed": "Branches konnten nicht geladen werden: {0}", "merged": "Zusammengeführt.", "conflict": "Merge-Konflikt — Ziel-Branch wiederhergestellt. Manuell oder über Fortsetzen lösen, dann erneut versuchen.", "blocked": "Blockiert: {0}", "unknownStatus": "Unbekannter Status: {0}", "mergeFailed": "Merge fehlgeschlagen: {0}" },
|
||||
"conflictResolution": { "vsCodeError": "VS Code konnte nicht gestartet werden: {0}. Die Pfade sind oben aufgeführt — kopiere sie manuell.", "subtaskPrefix": "Konflikte in Teilaufgabe: {0}", "targetPrefix": "Zusammenführen in: {0}" },
|
||||
"settingsModal": { "workerOffline": "Worker offline — Einstellungen schreibgeschützt.", "saveFailed": "Speichern fehlgeschlagen: {0}" },
|
||||
"weeklyReport": { "invalidRange": "Ungültiger Datumsbereich.", "generating": "Bericht wird erstellt…", "error": "Fehler: {0}" },
|
||||
"filesTab": { "workerOffline": "Worker offline.", "noneBundled": "Keine Standard-Agenten mitgeliefert.", "allPresent": "Alle Standard-Agenten bereits vorhanden.", "restored": "{0} Standard-Agent(en) wiederhergestellt.", "restoreFailed": "Wiederherstellung fehlgeschlagen: {0}", "openFailed": "Öffnen fehlgeschlagen: {0}" },
|
||||
"worktreesTab": { "workerOffline": "Worker offline.", "removed": "{0} Worktree(s) entfernt.", "blocked": "Zwangsentfernung nicht möglich: {0} Aufgabe(n) laufen noch. Brich sie zuerst ab.", "removedFrom": "{0} Worktree(s) von {1} Aufgabe(n) entfernt." },
|
||||
"worktreesOverview": { "titleAll": "Worktrees", "titleList": "Worktrees — {0}", "listFallback": "Liste", "cleanupFailed": "Aufräumen fehlgeschlagen.", "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." },
|
||||
"listSettings": { "untitled": "Unbenannt" },
|
||||
"details": { "effectiveIfInherited": "Effektiv bei Vererbung: {0}" },
|
||||
"lists": { "localSuffix": "{0} / lokal", "smartMyDay": "Mein Tag", "smartImportant": "Wichtig", "smartPlanned": "Geplant", "virtualQueue": "Warteschlange", "virtualRunning": "Läuft", "virtualReview": "Prüfung", "newList": "Neue Liste" }
|
||||
}
|
||||
}
|
||||
388
src/ClaudeDo.Localization/locales/en.json
Normal file
388
src/ClaudeDo.Localization/locales/en.json
Normal file
@@ -0,0 +1,388 @@
|
||||
{
|
||||
"metadata": { "code": "en", "name": "English" },
|
||||
"settings": {
|
||||
"title": "SETTINGS",
|
||||
"save": "Save",
|
||||
"cancel": "Cancel",
|
||||
"language": "Language",
|
||||
"tabGeneral": "General",
|
||||
"tabWorktrees": "Worktrees",
|
||||
"tabFiles": "Files",
|
||||
"tabPrime": "Prime Claude",
|
||||
"general": {
|
||||
"defaultInstructions": "Default instructions",
|
||||
"defaultInstructionsPlaceholder": "Baseline instructions applied to every task",
|
||||
"model": "Model",
|
||||
"maxTurns": "Max turns",
|
||||
"permission": "Permission",
|
||||
"maxParallelExecutions": "Max parallel executions",
|
||||
"maxParallelExecutionsHint": "How many queued tasks the worker runs at once.",
|
||||
"reportExcludedPaths": "Report: excluded paths (one per line)",
|
||||
"standupWeekday": "Standup weekday",
|
||||
"weekdaySunday": "Sunday",
|
||||
"weekdayMonday": "Monday",
|
||||
"weekdayTuesday": "Tuesday",
|
||||
"weekdayWednesday": "Wednesday",
|
||||
"weekdayThursday": "Thursday",
|
||||
"weekdayFriday": "Friday",
|
||||
"weekdaySaturday": "Saturday"
|
||||
},
|
||||
"worktrees": {
|
||||
"strategy": "Strategy",
|
||||
"centralWorktreeRoot": "Central worktree root",
|
||||
"autoCleanup": "Auto-cleanup finished worktrees after",
|
||||
"days": "days",
|
||||
"cleanupFinished": "Cleanup finished worktrees",
|
||||
"forceRemoveAll": "Force-remove all worktrees",
|
||||
"confirmRemoveAll": "Remove ALL worktrees? Uncommitted work will be lost.",
|
||||
"removeAll": "Remove All"
|
||||
},
|
||||
"files": {
|
||||
"agentsSection": "AGENTS",
|
||||
"agentsHint": "Restore bundled default agents. Existing files are not overwritten.",
|
||||
"restoreDefaultAgents": "Restore default agents",
|
||||
"promptsSection": "PROMPTS",
|
||||
"systemPrompt": "System",
|
||||
"planningPrompt": "Planning",
|
||||
"agentPrompt": "Agent",
|
||||
"openInEditor": "Open in editor"
|
||||
},
|
||||
"prime": {
|
||||
"description": "Prime your Claude usage window by firing a single non-interactive ping on the days you choose, at a chosen time. Only runs while ClaudeDo is open. If the app starts within 30 minutes of the target time, the ping fires immediately.",
|
||||
"addSchedule": "+ Add schedule",
|
||||
"dayMo": "Mo",
|
||||
"dayTu": "Tu",
|
||||
"dayWe": "We",
|
||||
"dayTh": "Th",
|
||||
"dayFr": "Fr",
|
||||
"daySa": "Sa",
|
||||
"daySu": "Su"
|
||||
}
|
||||
},
|
||||
"tasks": {
|
||||
"sortTip": "Sort",
|
||||
"showCompletedTip": "Show completed",
|
||||
"listSettingsTip": "List settings",
|
||||
"addPlaceholder": "Add a task…",
|
||||
"enterKey": "ENTER",
|
||||
"notesPinnedRow": "Notes (daily notes)",
|
||||
"overdue": "OVERDUE",
|
||||
"tasks": "TASKS",
|
||||
"clearCompletedTip": "Clear all completed",
|
||||
"ctxSendToQueue": "Send to queue",
|
||||
"ctxRemoveFromQueue": "Remove from queue",
|
||||
"ctxCancelExecution": "Cancel execution",
|
||||
"ctxMarkAs": "Mark as",
|
||||
"ctxMarkDone": "Done",
|
||||
"ctxMarkCancelled": "Cancelled",
|
||||
"ctxRunInteractively": "Run interactively",
|
||||
"ctxOpenPlanningSession": "Open planning Session",
|
||||
"ctxResumePlanningSession": "Resume planning Session",
|
||||
"ctxDiscardPlanningSession": "Discard planning session",
|
||||
"ctxQueueSubtasks": "Queue subtasks sequentially",
|
||||
"ctxScheduleFor": "Schedule for...",
|
||||
"ctxClearSchedule": "Clear schedule",
|
||||
"badgeDraft": "DRAFT",
|
||||
"badgePlanned": "PLANNED",
|
||||
"approve": "Approve",
|
||||
"approveTip": "Approve — mark Done",
|
||||
"reject": "Reject",
|
||||
"rejectTip": "Reject with feedback and re-run",
|
||||
"park": "Park",
|
||||
"parkTip": "Send back to Idle for manual editing",
|
||||
"cancel": "Cancel",
|
||||
"cancelTip": "Cancel this task",
|
||||
"removeFromQueueTip": "Remove from queue",
|
||||
"scheduleTitle": "Schedule task",
|
||||
"scheduleWhen": "WHEN",
|
||||
"scheduleConfirm": "Schedule",
|
||||
"rejectRerunTitle": "Reject & re-run",
|
||||
"feedbackLabel": "FEEDBACK FOR THE AGENT",
|
||||
"feedbackPlaceholder": "What should the agent fix?",
|
||||
"rerun": "Re-run"
|
||||
},
|
||||
"lists": {
|
||||
"heading": "Lists",
|
||||
"searchPlaceholder": "Search tasks…",
|
||||
"searchKbd": "Ctrl K",
|
||||
"settingsTip": "Settings",
|
||||
"smartListsLabel": "SMART LISTS",
|
||||
"myListsLabel": "MY LISTS",
|
||||
"contextSettings": "Settings...",
|
||||
"contextWorktrees": "Worktrees…",
|
||||
"contextOpenExplorer": "Open in Explorer",
|
||||
"contextOpenTerminal": "Open in Terminal",
|
||||
"newList": "New list",
|
||||
"addReposTip": "Add repos as lists"
|
||||
},
|
||||
"details": {
|
||||
"deleteTaskTip": "Delete task",
|
||||
"closeTip": "Close",
|
||||
"copyTaskIdTip": "Copy task ID",
|
||||
"starTip": "Star",
|
||||
"agentSettingsTip": "Agent settings",
|
||||
"agentSettingsHeading": "Agent settings (overrides)",
|
||||
"modelLabel": "Model",
|
||||
"systemPromptLabel": "System prompt (appended)",
|
||||
"agentFileLabel": "Agent file",
|
||||
"mergeLabel": "MERGE",
|
||||
"mergeTargetLabel": "Merge target",
|
||||
"reviewCombinedDiff": "Review combined diff",
|
||||
"mergeAllSubtasks": "Merge all subtasks",
|
||||
"stepsLabel": "STEPS",
|
||||
"addStepPlaceholder": "Add a step...",
|
||||
"detailsLabel": "DETAILS",
|
||||
"copyDescriptionTip": "Copy description to clipboard",
|
||||
"toggleEditPreviewTip": "Toggle edit/preview",
|
||||
"previewBtn": "Preview",
|
||||
"editBtn": "Edit",
|
||||
"descriptionPlaceholder": "Add task details (markdown supported)..."
|
||||
},
|
||||
"agent": {
|
||||
"stopTip": "Stop agent",
|
||||
"sendToQueue": "Send to queue",
|
||||
"sendToQueueTip": "Queue this task for the worker to pick up",
|
||||
"removeFromQueue": "Remove from queue",
|
||||
"removeFromQueueTip": "Take this task back out of the queue",
|
||||
"worktreeLabel": "WORKTREE",
|
||||
"copyPathTip": "Copy path",
|
||||
"diffLabel": "DIFF",
|
||||
"openDiff": "Open diff",
|
||||
"worktreeBtn": "Worktree",
|
||||
"openWorktreeTip": "Open worktree in file explorer",
|
||||
"continue": "Continue",
|
||||
"continueTip": "Resume the last session and keep going",
|
||||
"resetAndRetry": "Reset & retry",
|
||||
"resetAndRetryTip": "Discard the worktree and re-queue the task to run from scratch"
|
||||
},
|
||||
"notes": {
|
||||
"today": "Today",
|
||||
"add": "Add",
|
||||
"newNotePlaceholder": "New note…",
|
||||
"save": "Save",
|
||||
"delete": "Delete"
|
||||
},
|
||||
"session": {
|
||||
"chipLive": "LIVE",
|
||||
"chipDone": "DONE",
|
||||
"chipFailed": "FAILED"
|
||||
},
|
||||
"modals": {
|
||||
"about": {
|
||||
"title": "ABOUT",
|
||||
"version": "Version",
|
||||
"data": "Data",
|
||||
"logs": "Logs",
|
||||
"config": "Config",
|
||||
"open": "Open"
|
||||
},
|
||||
"workerConnection": {
|
||||
"title": "WORKER NOT REACHABLE",
|
||||
"body": "ClaudeDo can't reach the background worker. It is normally started automatically at logon. You can start it now, or reinstall if the problem persists.",
|
||||
"dismiss": "Dismiss",
|
||||
"rerunInstaller": "Rerun Installer",
|
||||
"startWorker": "Start Worker"
|
||||
},
|
||||
"listSettings": {
|
||||
"title": "LIST SETTINGS",
|
||||
"deleteList": "Delete list",
|
||||
"sectionGeneral": "GENERAL",
|
||||
"name": "Name",
|
||||
"workingDirectory": "Working directory",
|
||||
"workingDirectoryPlaceholder": "(none)",
|
||||
"browse": "Browse...",
|
||||
"defaultCommitType": "Default commit type",
|
||||
"sectionAgent": "AGENT",
|
||||
"resetAgentSettings": "Reset agent settings",
|
||||
"model": "Model",
|
||||
"systemPrompt": "System prompt (appended)",
|
||||
"agentFile": "Agent file"
|
||||
},
|
||||
"merge": {
|
||||
"title": "MERGE WORKTREE",
|
||||
"windowTitle": "Merge worktree",
|
||||
"cancel": "Cancel",
|
||||
"merge": "Merge",
|
||||
"targetBranch": "Target branch",
|
||||
"removeWorktree": "Remove worktree after merge",
|
||||
"commitMessage": "Commit message",
|
||||
"conflictedFiles": "Conflicted files:"
|
||||
},
|
||||
"diff": {
|
||||
"title": "DIFF",
|
||||
"windowTitle": "Diff",
|
||||
"merge": "Merge…"
|
||||
},
|
||||
"worktree": {
|
||||
"title": "Worktree"
|
||||
},
|
||||
"worktreesOverview": {
|
||||
"refresh": "Refresh",
|
||||
"cleanupFinished": "Cleanup finished",
|
||||
"columnTask": "TASK",
|
||||
"columnState": "STATE",
|
||||
"columnDiff": "DIFF",
|
||||
"columnAge": "AGE",
|
||||
"phantom": "phantom",
|
||||
"phantomTooltip": "Directory missing on disk",
|
||||
"ctxShowDiff": "Show diff",
|
||||
"ctxOpenInExplorer": "Open in Explorer",
|
||||
"ctxJumpToTask": "Jump to task",
|
||||
"ctxMerge": "Merge…",
|
||||
"ctxDiscard": "Discard",
|
||||
"ctxKeep": "Keep",
|
||||
"ctxCopyBranch": "Copy branch",
|
||||
"ctxCopyPath": "Copy path",
|
||||
"ctxForceRemove": "Force remove"
|
||||
},
|
||||
"repoImport": {
|
||||
"title": "ADD REPOS AS LISTS",
|
||||
"windowTitle": "Add repos as lists",
|
||||
"cancel": "Cancel",
|
||||
"searchPlaceholder": "Search repos…",
|
||||
"addFolder": "Add folder…",
|
||||
"forgetFolders": "Forget folders",
|
||||
"alreadyAdded": "(already added)"
|
||||
},
|
||||
"unfinishedPlanning": {
|
||||
"title": "UNFINISHED PLANNING SESSION",
|
||||
"windowTitle": "Unfinished planning session",
|
||||
"discard": "Discard",
|
||||
"finalize": "Finalize",
|
||||
"resume": "Resume",
|
||||
"draftTasksSuffix": " draft task(s) waiting to be finalized."
|
||||
},
|
||||
"weeklyReport": {
|
||||
"title": "WEEKLY REPORT",
|
||||
"windowTitle": "Weekly Report",
|
||||
"from": "From",
|
||||
"to": "To",
|
||||
"generate": "Generate",
|
||||
"regenerate": "Regenerate",
|
||||
"emptyStateHint": "No report for this range yet. Click “Generate”."
|
||||
}
|
||||
},
|
||||
"installer": {
|
||||
"nav": {
|
||||
"back": "Back",
|
||||
"next": "Next →",
|
||||
"install": "Install",
|
||||
"browse": "Browse...",
|
||||
"cancel": "Cancel"
|
||||
},
|
||||
"welcome": {
|
||||
"title": "Welcome",
|
||||
"heading": "Install ClaudeDo",
|
||||
"subheading": "Choose where to install ClaudeDo, then click Next.",
|
||||
"updateSubheading": "Your tasks, config, and database will be preserved. Click Next to continue.",
|
||||
"installDirectory": "Install Directory",
|
||||
"registerMcp": "Register MCP server with Claude",
|
||||
"registerMcpHint": "Runs 'claude mcp add' so Claude can view and manage your ClaudeDo tasks. You can change this later."
|
||||
},
|
||||
"paths": {
|
||||
"title": "Data Paths",
|
||||
"subtitle": "Configure where ClaudeDo stores its data.",
|
||||
"databasePath": "Database Path",
|
||||
"logDirectory": "Log Directory",
|
||||
"sandboxRoot": "Sandbox Root",
|
||||
"worktreeStrategy": "Worktree Strategy",
|
||||
"centralWorktreeRoot": "Central Worktree Root"
|
||||
},
|
||||
"service": {
|
||||
"title": "Worker",
|
||||
"subtitle": "Configure the ClaudeDo background worker.",
|
||||
"signalRPort": "SignalR Port",
|
||||
"queueBackstopInterval": "Queue Backstop Interval (ms)",
|
||||
"claudeCliPath": "Claude CLI Path",
|
||||
"autostart": "Start worker automatically at logon",
|
||||
"autostartHint": "The worker runs as you (the logged-in user) via a per-user logon task, so it can use your Claude CLI authentication.",
|
||||
"restartDelay": "Restart Delay (ms)"
|
||||
},
|
||||
"uiSettings": {
|
||||
"title": "UI Settings",
|
||||
"subtitle": "Configure the ClaudeDo desktop UI connection settings.",
|
||||
"syncWithService": "Sync with service settings",
|
||||
"signalRUrl": "SignalR URL",
|
||||
"syncHint": "When synced, these values are derived from the Service and Paths pages."
|
||||
},
|
||||
"install": {
|
||||
"title": "Installation",
|
||||
"subtitle": "Click Install to build and deploy ClaudeDo.",
|
||||
"launch": "Launch ClaudeDo"
|
||||
},
|
||||
"settings": {
|
||||
"removeUserData": "Remove user data (tasks, logs, configs in ~/.todo-app)",
|
||||
"uninstall": "Uninstall",
|
||||
"repair": "Repair",
|
||||
"save": "Save",
|
||||
"close": "Close"
|
||||
},
|
||||
"selfUpdate": {
|
||||
"heading": "A newer installer is available",
|
||||
"update": "Update",
|
||||
"continueAnyway": "Continue anyway"
|
||||
}
|
||||
},
|
||||
"planning": {
|
||||
"conflict": {
|
||||
"windowTitle": "Merge conflict",
|
||||
"modalTitle": "MERGE CONFLICT",
|
||||
"openInVsCode": "Open all in VS Code",
|
||||
"resolved": "I've resolved — continue",
|
||||
"abort": "Abort this merge"
|
||||
},
|
||||
"diff": {
|
||||
"windowTitle": "Planning — Combined diff",
|
||||
"modalTitle": "PLANNING — COMBINED DIFF",
|
||||
"previewCombined": "Preview combined",
|
||||
"loading": "Loading…"
|
||||
}
|
||||
},
|
||||
"controls": {
|
||||
"datePicker": {
|
||||
"today": "Today",
|
||||
"tomorrow": "Tomorrow",
|
||||
"nextMon": "Next Mon",
|
||||
"clear": "Clear",
|
||||
"time": "Time",
|
||||
"done": "Done"
|
||||
}
|
||||
},
|
||||
"shell": {
|
||||
"menu": {
|
||||
"help": "Help",
|
||||
"checkForUpdates": "Check for updates",
|
||||
"restartWorker": "Restart worker",
|
||||
"worktrees": "Worktrees…",
|
||||
"weeklyReport": "Weekly Report…",
|
||||
"about": "About…",
|
||||
"addRepos": "Add repos as lists…"
|
||||
},
|
||||
"update": {
|
||||
"available": "Update available: v",
|
||||
"updateNow": "Update now",
|
||||
"dismiss": "Dismiss"
|
||||
}
|
||||
},
|
||||
"vm": {
|
||||
"connection": { "online": "Online", "connecting": "Connecting…", "offline": "Offline" },
|
||||
"shell": { "restartingWorker": "Restarting worker…" },
|
||||
"agentStatus": { "idle": "Idle", "queued": "Queued", "running": "Running", "done": "Done", "failed": "Failed", "cancelled": "Cancelled" },
|
||||
"taskStatus": { "idle": "Idle", "queued": "Queued", "running": "Running", "waitingForReview": "Waiting for Review", "done": "Done", "failed": "Failed", "cancelled": "Cancelled" },
|
||||
"planningBadge": { "active": "PLANNING", "finalized": "PLANNED" },
|
||||
"taskRow": { "createdPrefix": "Created {0}", "stepsText": "{0}/{1} steps" },
|
||||
"tasksIsland": { "completedHeader": "COMPLETED", "completedHeaderCount": "COMPLETED · {0}" },
|
||||
"diff": { "loadFailed": "Failed to load diff: {0}", "noChanges": "No changes to show." },
|
||||
"planningDiff": { "hubError": "Could not build combined preview (hub error).", "conflict": "Cannot build combined preview: subtask {0} conflicts with an earlier subtask ({1} files)." },
|
||||
"merge": { "commitMessage": "Merge task: {0}", "workerOfflineBranches": "Worker offline — cannot list branches.", "loadBranchesFailed": "Failed to load branches: {0}", "merged": "Merged.", "conflict": "Merge conflict — target branch restored. Resolve manually or via Continue, then retry.", "blocked": "Blocked: {0}", "unknownStatus": "Unknown status: {0}", "mergeFailed": "Merge failed: {0}" },
|
||||
"conflictResolution": { "vsCodeError": "Could not launch VS Code: {0}. Paths are listed above — copy them manually.", "subtaskPrefix": "Conflicts in subtask: {0}", "targetPrefix": "Merging into: {0}" },
|
||||
"settingsModal": { "workerOffline": "Worker offline — settings read-only.", "saveFailed": "Save failed: {0}" },
|
||||
"weeklyReport": { "invalidRange": "Invalid date range.", "generating": "Generating report…", "error": "Error: {0}" },
|
||||
"filesTab": { "workerOffline": "Worker offline.", "noneBundled": "No default agents bundled.", "allPresent": "All default agents already present.", "restored": "Restored {0} default agent(s).", "restoreFailed": "Restore failed: {0}", "openFailed": "Open failed: {0}" },
|
||||
"worktreesTab": { "workerOffline": "Worker offline.", "removed": "Removed {0} worktree(s).", "blocked": "Cannot force-remove: {0} task(s) still running. Cancel them first.", "removedFrom": "Removed {0} worktree(s) from {1} task(s)." },
|
||||
"worktreesOverview": { "titleAll": "Worktrees", "titleList": "Worktrees — {0}", "listFallback": "list", "cleanupFailed": "Cleanup failed.", "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." },
|
||||
"listSettings": { "untitled": "Untitled" },
|
||||
"details": { "effectiveIfInherited": "Effective if inherited: {0}" },
|
||||
"lists": { "localSuffix": "{0} / local", "smartMyDay": "My Day", "smartImportant": "Important", "smartPlanned": "Planned", "virtualQueue": "Queue", "virtualRunning": "Running", "virtualReview": "Review", "newList": "New list" }
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ public sealed class AppSettings
|
||||
{
|
||||
public string DbPath { get; set; } = "~/.todo-app/todo.db";
|
||||
public string SignalRUrl { get; set; } = "http://127.0.0.1:47821/hub";
|
||||
public string Language { get; set; } = "";
|
||||
|
||||
private static readonly string ConfigPath = Paths.Expand("~/.todo-app/ui.config.json");
|
||||
|
||||
@@ -27,4 +28,12 @@ public sealed class AppSettings
|
||||
}
|
||||
return new();
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
var dir = Path.GetDirectoryName(ConfigPath);
|
||||
if (!string.IsNullOrEmpty(dir)) Directory.CreateDirectory(dir);
|
||||
var json = JsonSerializer.Serialize(this, new JsonSerializerOptions { WriteIndented = true });
|
||||
File.WriteAllText(ConfigPath, json);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,9 @@ MVVM with CommunityToolkit.Mvvm source generators:
|
||||
- **StatusBarView** — Connection status indicator, active task display
|
||||
- **ListSettingsModalView** — edits list name, working dir, default commit type, and per-list Model/SystemPrompt/AgentPath; also deletes the list (and its tasks) via a confirmed "Delete list" button. Opened via context menu or gear button on a list row.
|
||||
- **RepoImportModalView** — bulk-creates lists from git repos discovered under chosen parent folders. Opened via the folder button beside "New list" in the Lists island, or the "Add repos as lists…" Help-menu item. Repos already wired to a list show as disabled/"(already added)".
|
||||
- **DetailsIslandView** — contains an "Agent settings (overrides)" expander with per-task Model/SystemPrompt/AgentPath, showing inherited effective values. Disabled while task is running.
|
||||
- **DetailsIslandView** — contains an "Agent settings (overrides)" expander with per-task Model/SystemPrompt/AgentPath, showing inherited effective values. Disabled while task is running. When notes mode is active (`IsNotesMode`), it hosts **NotesEditorView** instead of the task detail.
|
||||
- **WeeklyReportModalView** — opened from Help menu ("Wochenbericht…"); date-range pickers default to "since last standup weekday → today"; Generate/Regenerate button; renders markdown via MarkdownView; reports are cached per range.
|
||||
- **NotesEditorView** — day navigator (prev/next/date-picker/Today), bullet add/edit/delete for daily notes.
|
||||
|
||||
All views use compiled bindings (`x:DataType`).
|
||||
|
||||
@@ -31,10 +33,15 @@ All views use compiled bindings (`x:DataType`).
|
||||
- **TaskItemViewModel** / **ListItemViewModel** — lightweight display VMs
|
||||
- **TaskEditorViewModel** / **ListEditorViewModel** — dialog VMs with validation
|
||||
- **StatusBarViewModel** — connection state and active tasks
|
||||
- **WeeklyReportModalViewModel** — drives the weekly report modal
|
||||
- **NotesEditorViewModel** — manages daily note bullet CRUD for the selected day
|
||||
- **DetailsIslandViewModel** gains `IsNotesMode`, `ShowNotes()`, and hosts `NotesEditorViewModel`
|
||||
- **TasksIslandViewModel** gains a pinned "Notes" pseudo-row (`ShowNotesRow`, `OpenNotesCommand`, `NotesRequested` event) that switches the Details island to notes mode
|
||||
|
||||
## Services
|
||||
|
||||
- **WorkerClient** — SignalR client connecting to `http://127.0.0.1:47821/hub`. Auto-reconnect with exponential backoff. Methods: StartAsync, RunNowAsync, CancelTaskAsync, WakeQueueAsync, ContinueTaskAsync, ResetTaskAsync, GetAgentsAsync, UpdateAppSettingsAsync, UpdateListAsync, UpdateListConfigAsync, GetListConfigAsync, UpdateTaskAgentSettingsAsync. Events: TaskStarted, TaskFinished, TaskMessage, TaskUpdated, WorktreeUpdated, ListUpdated
|
||||
- **WorkerClient** / **IWorkerClient** — SignalR client connecting to `http://127.0.0.1:47821/hub`. Auto-reconnect with exponential backoff. Methods: StartAsync, RunNowAsync, CancelTaskAsync, WakeQueueAsync, ContinueTaskAsync, ResetTaskAsync, GetAgentsAsync, UpdateAppSettingsAsync, UpdateListAsync, UpdateListConfigAsync, GetListConfigAsync, UpdateTaskAgentSettingsAsync, `GetWeekReportAsync`, `GenerateWeekReportAsync`, `GetDailyNotesAsync`, `AddDailyNoteAsync`, `UpdateDailyNoteAsync`, `DeleteDailyNoteAsync`. Events: TaskStarted, TaskFinished, TaskMessage, TaskUpdated, WorktreeUpdated, ListUpdated
|
||||
- **INotesApi** / **WorkerNotesApi** — thin wrapper over the daily-note WorkerClient methods (mirrors `IPrimeScheduleApi`). UI DTO: `DailyNoteDto(Id, Date, Text, SortOrder)`.
|
||||
|
||||
## Converters
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ClaudeDo.Data\ClaudeDo.Data.csproj" />
|
||||
<ProjectReference Include="..\ClaudeDo.Localization\ClaudeDo.Localization.csproj" />
|
||||
<ProjectReference Include="..\ClaudeDo.Releases\ClaudeDo.Releases.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -15,6 +15,8 @@ public class StatusColorConverter : IValueConverter
|
||||
{
|
||||
"queued" => Brushes.DodgerBlue,
|
||||
"running" => Brushes.Orange,
|
||||
"waitingforreview" => Brushes.MediumPurple,
|
||||
"waiting_for_review" => Brushes.MediumPurple,
|
||||
"done" => Brushes.Green,
|
||||
"failed" => Brushes.Red,
|
||||
"manual" => Brushes.Gray,
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
using System.Globalization;
|
||||
using Avalonia.Data.Converters;
|
||||
|
||||
namespace ClaudeDo.Ui.Converters;
|
||||
|
||||
public sealed class TimeSpanToHhmmConverter : IValueConverter
|
||||
{
|
||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) =>
|
||||
value is TimeSpan t ? $"{t.Hours:00}:{t.Minutes:00}" : "07:00";
|
||||
|
||||
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is not string s) return new TimeSpan(7, 0, 0);
|
||||
var parts = s.Split(':');
|
||||
if (parts.Length == 2 &&
|
||||
int.TryParse(parts[0], out var h) && h is >= 0 and <= 23 &&
|
||||
int.TryParse(parts[1], out var m) && m is >= 0 and <= 59)
|
||||
return new TimeSpan(h, m, 0);
|
||||
return new TimeSpan(7, 0, 0);
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,7 @@
|
||||
<!-- Window control icons — filled geometries (PathIcon fills, not strokes) -->
|
||||
<StreamGeometry x:Key="Icon.WinMin">M4 9 H16 V11 H4 Z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icon.WinMax">M4 4 H16 V6 H4 Z M4 14 H16 V16 H4 Z M4 4 H6 V16 H4 Z M14 4 H16 V16 H14 Z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icon.WinRestore">M4 7 H13 V9 H4 Z M4 14 H13 V16 H4 Z M4 7 H6 V16 H4 Z M11 7 H13 V16 H11 Z M7 4 H16 V6 H7 Z M14 4 H16 V13 H14 Z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icon.WinClose">M4 5 L5 4 L16 15 L15 16 Z M15 4 L16 5 L5 16 L4 15 Z</StreamGeometry>
|
||||
<!-- Brand check glyph — filled rounded square with inset tick -->
|
||||
<StreamGeometry x:Key="Icon.BrandCheck">M3 3 H21 V21 H3 Z M6 12 L7 11 L10 14 L17 7 L18 8 L10 16 Z</StreamGeometry>
|
||||
@@ -184,6 +185,15 @@
|
||||
<Setter Property="Foreground" Value="{StaticResource StatusQueuedBrush}" />
|
||||
</Style>
|
||||
|
||||
<!-- done → green (#6FA86B) -->
|
||||
<Style Selector="Border.chip.done">
|
||||
<Setter Property="Background" Value="{StaticResource DoneTintBrush}" />
|
||||
<Setter Property="BorderBrush" Value="{StaticResource DoneTintBorderBrush}" />
|
||||
</Style>
|
||||
<Style Selector="Border.chip.done > TextBlock">
|
||||
<Setter Property="Foreground" Value="{StaticResource StatusDoneBrush}" />
|
||||
</Style>
|
||||
|
||||
<!-- idle → TextMute (#6B7973) -->
|
||||
<Style Selector="Border.chip.idle">
|
||||
<Setter Property="Background" Value="{StaticResource Surface2Brush}" />
|
||||
@@ -1025,4 +1035,23 @@
|
||||
<Setter Property="FontWeight" Value="SemiBold" />
|
||||
</Style>
|
||||
|
||||
<!-- ============================================================ -->
|
||||
<!-- DAY TOGGLE -->
|
||||
<!-- Small ToggleButton for weekday pickers (Prime schedule row) -->
|
||||
<!-- ============================================================ -->
|
||||
<Style Selector="ToggleButton.day-toggle">
|
||||
<Setter Property="MinWidth" Value="34"/>
|
||||
<Setter Property="Padding" Value="6,4"/>
|
||||
<Setter Property="Margin" Value="0"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||
<Setter Property="Background" Value="{DynamicResource DeepBrush}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextBrush}"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource LineBrush}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="CornerRadius" Value="4"/>
|
||||
</Style>
|
||||
<Style Selector="ToggleButton.day-toggle:checked /template/ ContentPresenter">
|
||||
<Setter Property="Background" Value="{DynamicResource AccentBrush}"/>
|
||||
</Style>
|
||||
|
||||
</Styles>
|
||||
|
||||
@@ -83,6 +83,7 @@
|
||||
<SolidColorBrush x:Key="StatusErrorBrush" Color="{StaticResource StatusErrorColor}" />
|
||||
<SolidColorBrush x:Key="StatusQueuedBrush" Color="{StaticResource StatusQueuedColor}" />
|
||||
<SolidColorBrush x:Key="StatusIdleBrush" Color="{StaticResource StatusIdleColor}" />
|
||||
<SolidColorBrush x:Key="StatusDoneBrush" Color="#6FA86B" />
|
||||
|
||||
<!-- Subtle white overlay (island hairline border) -->
|
||||
<SolidColorBrush x:Key="HairlineOverlayBrush" Color="#0DFFFFFF" />
|
||||
@@ -96,6 +97,8 @@
|
||||
<SolidColorBrush x:Key="ErrorTintBorderBrush" Color="#4CC87060" />
|
||||
<SolidColorBrush x:Key="QueuedTintBrush" Color="#1F8B9D7A" />
|
||||
<SolidColorBrush x:Key="QueuedTintBorderBrush" Color="#4C8B9D7A" />
|
||||
<SolidColorBrush x:Key="DoneTintBrush" Color="#1F6FA86B" />
|
||||
<SolidColorBrush x:Key="DoneTintBorderBrush" Color="#4C6FA86B" />
|
||||
|
||||
<!-- Window-body gradient layers (apply as LinearGradientBrush in the main content Border) -->
|
||||
<LinearGradientBrush x:Key="DesktopBackgroundBrush" StartPoint="0%,0%" EndPoint="0%,100%">
|
||||
|
||||
43
src/ClaudeDo.Ui/Localization/Loc.cs
Normal file
43
src/ClaudeDo.Ui/Localization/Loc.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using ClaudeDo.Localization;
|
||||
|
||||
namespace ClaudeDo.Ui.Localization;
|
||||
|
||||
/// Ambient access to the active localizer for code-built (ViewModel) strings.
|
||||
/// Set once at startup. Defaults to a key-echo localizer so unit tests that
|
||||
/// construct ViewModels without startup wiring do not crash.
|
||||
public static class Loc
|
||||
{
|
||||
private static ILocalizer _current = new KeyEchoLocalizer();
|
||||
|
||||
public static ILocalizer Current
|
||||
{
|
||||
get => _current;
|
||||
set
|
||||
{
|
||||
if (_current is not null) _current.LanguageChanged -= OnInnerChanged;
|
||||
_current = value;
|
||||
_current.LanguageChanged += OnInnerChanged;
|
||||
OnInnerChanged(value, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
public static event EventHandler? LanguageChanged;
|
||||
|
||||
private static void OnInnerChanged(object? sender, EventArgs e) =>
|
||||
LanguageChanged?.Invoke(sender, e);
|
||||
|
||||
public static string T(string key) => Current[key];
|
||||
public static string T(string key, params object[] args) => Current.Get(key, args);
|
||||
|
||||
private sealed class KeyEchoLocalizer : ILocalizer
|
||||
{
|
||||
public string this[string key] => key;
|
||||
public string Get(string key, params object[] args) => key;
|
||||
public string CurrentCode => "en";
|
||||
public IReadOnlyList<LanguageOption> AvailableLanguages => Array.Empty<LanguageOption>();
|
||||
public void SetLanguage(string code) { }
|
||||
public event EventHandler? LanguageChanged { add { } remove { } }
|
||||
}
|
||||
}
|
||||
22
src/ClaudeDo.Ui/Localization/LocalizedString.cs
Normal file
22
src/ClaudeDo.Ui/Localization/LocalizedString.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.ComponentModel;
|
||||
using ClaudeDo.Localization;
|
||||
|
||||
namespace ClaudeDo.Ui.Localization;
|
||||
|
||||
public sealed class LocalizedString : INotifyPropertyChanged
|
||||
{
|
||||
private readonly ILocalizer _localizer;
|
||||
private readonly string _key;
|
||||
|
||||
public LocalizedString(ILocalizer localizer, string key)
|
||||
{
|
||||
_localizer = localizer;
|
||||
_key = key;
|
||||
_localizer.LanguageChanged += (_, _) =>
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Value)));
|
||||
}
|
||||
|
||||
public string Value => _localizer[_key];
|
||||
|
||||
public event PropertyChangedEventHandler? PropertyChanged;
|
||||
}
|
||||
25
src/ClaudeDo.Ui/Localization/TrExtension.cs
Normal file
25
src/ClaudeDo.Ui/Localization/TrExtension.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Avalonia.Data;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using ClaudeDo.Localization;
|
||||
|
||||
namespace ClaudeDo.Ui.Localization;
|
||||
|
||||
public sealed class TrExtension : MarkupExtension
|
||||
{
|
||||
public TrExtension() { }
|
||||
public TrExtension(string key) => Key = key;
|
||||
|
||||
public string Key { get; set; } = "";
|
||||
|
||||
public static ILocalizer? Localizer { get; set; }
|
||||
|
||||
public override object ProvideValue(IServiceProvider serviceProvider)
|
||||
{
|
||||
var loc = Localizer ?? throw new InvalidOperationException("TrExtension.Localizer not initialized");
|
||||
return new Binding(nameof(LocalizedString.Value))
|
||||
{
|
||||
Source = new LocalizedString(loc, Key),
|
||||
Mode = BindingMode.OneWay
|
||||
};
|
||||
}
|
||||
}
|
||||
11
src/ClaudeDo.Ui/Services/Interfaces/INotesApi.cs
Normal file
11
src/ClaudeDo.Ui/Services/Interfaces/INotesApi.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using ClaudeDo.Ui.Services;
|
||||
|
||||
namespace ClaudeDo.Ui.Services.Interfaces;
|
||||
|
||||
public interface INotesApi
|
||||
{
|
||||
Task<List<DailyNoteDto>> ListAsync(DateOnly day);
|
||||
Task<DailyNoteDto?> AddAsync(DateOnly day, string text);
|
||||
Task UpdateAsync(string id, string text);
|
||||
Task DeleteAsync(string id);
|
||||
}
|
||||
@@ -33,6 +33,10 @@ public interface IWorkerClient : INotifyPropertyChanged
|
||||
Task<ListConfigDto?> GetListConfigAsync(string listId);
|
||||
Task UpdateTaskAgentSettingsAsync(UpdateTaskAgentSettingsDto dto);
|
||||
Task SetTaskStatusAsync(string taskId, TaskStatus status);
|
||||
Task ApproveReviewAsync(string taskId);
|
||||
Task RejectReviewToQueueAsync(string taskId, string feedback);
|
||||
Task RejectReviewToIdleAsync(string taskId);
|
||||
Task CancelReviewAsync(string taskId);
|
||||
Task StartPlanningSessionAsync(string taskId, CancellationToken ct = default);
|
||||
Task OpenInteractiveTerminalAsync(string taskId, CancellationToken ct = default);
|
||||
Task ResumePlanningSessionAsync(string taskId, CancellationToken ct = default);
|
||||
@@ -46,4 +50,11 @@ public interface IWorkerClient : INotifyPropertyChanged
|
||||
Task ContinuePlanningMergeAsync(string planningTaskId);
|
||||
Task AbortPlanningMergeAsync(string planningTaskId);
|
||||
Task QueuePlanningSubtasksAsync(string parentTaskId, CancellationToken ct = default);
|
||||
Task<string?> GetWeekReportAsync(DateOnly start, DateOnly end);
|
||||
Task<string> GenerateWeekReportAsync(DateOnly start, DateOnly end);
|
||||
Task<AppSettingsDto?> GetAppSettingsAsync();
|
||||
Task<List<DailyNoteDto>> GetDailyNotesAsync(DateOnly day);
|
||||
Task<DailyNoteDto?> AddDailyNoteAsync(DateOnly day, string text);
|
||||
Task UpdateDailyNoteAsync(string id, string text);
|
||||
Task DeleteDailyNoteAsync(string id);
|
||||
}
|
||||
|
||||
@@ -2,10 +2,8 @@ namespace ClaudeDo.Ui.Services;
|
||||
|
||||
public sealed record PrimeScheduleDto(
|
||||
Guid Id,
|
||||
DateOnly StartDate,
|
||||
DateOnly EndDate,
|
||||
int Days,
|
||||
TimeSpan TimeOfDay,
|
||||
bool WorkdaysOnly,
|
||||
bool Enabled,
|
||||
DateTimeOffset? LastRunAt,
|
||||
string? PromptOverride);
|
||||
|
||||
3
src/ClaudeDo.Ui/Services/ReportDtos.cs
Normal file
3
src/ClaudeDo.Ui/Services/ReportDtos.cs
Normal file
@@ -0,0 +1,3 @@
|
||||
namespace ClaudeDo.Ui.Services;
|
||||
|
||||
public sealed record DailyNoteDto(string Id, string Date, string Text, int SortOrder);
|
||||
@@ -326,6 +326,26 @@ public partial class WorkerClient : ObservableObject, IAsyncDisposable, IWorkerC
|
||||
catch { /* offline */ }
|
||||
}
|
||||
|
||||
private static string IsoDay(DateOnly d) => d.ToString("yyyy-MM-dd");
|
||||
|
||||
public Task<string?> GetWeekReportAsync(DateOnly start, DateOnly end)
|
||||
=> TryInvokeAsync<string>("GetWeekReport", IsoDay(start), IsoDay(end));
|
||||
|
||||
public Task<string> GenerateWeekReportAsync(DateOnly start, DateOnly end)
|
||||
=> _hub.InvokeAsync<string>("GenerateWeekReport", IsoDay(start), IsoDay(end));
|
||||
|
||||
public async Task<List<DailyNoteDto>> GetDailyNotesAsync(DateOnly day)
|
||||
=> await TryInvokeAsync<List<DailyNoteDto>>("GetDailyNotes", IsoDay(day)) ?? new List<DailyNoteDto>();
|
||||
|
||||
public Task<DailyNoteDto?> AddDailyNoteAsync(DateOnly day, string text)
|
||||
=> TryInvokeAsync<DailyNoteDto>("AddDailyNote", IsoDay(day), text);
|
||||
|
||||
public async Task UpdateDailyNoteAsync(string id, string text)
|
||||
=> await _hub.InvokeAsync("UpdateDailyNote", id, text);
|
||||
|
||||
public async Task DeleteDailyNoteAsync(string id)
|
||||
=> await _hub.InvokeAsync("DeleteDailyNote", id);
|
||||
|
||||
public async Task UpdateListAsync(UpdateListDto dto)
|
||||
{
|
||||
await _hub.InvokeAsync("UpdateList", dto);
|
||||
@@ -349,6 +369,26 @@ public partial class WorkerClient : ObservableObject, IAsyncDisposable, IWorkerC
|
||||
await _hub.InvokeAsync("SetTaskStatus", taskId, status.ToString());
|
||||
}
|
||||
|
||||
public async Task ApproveReviewAsync(string taskId)
|
||||
{
|
||||
await _hub.InvokeAsync("ApproveReview", taskId);
|
||||
}
|
||||
|
||||
public async Task RejectReviewToQueueAsync(string taskId, string feedback)
|
||||
{
|
||||
await _hub.InvokeAsync("RejectReviewToQueue", taskId, feedback);
|
||||
}
|
||||
|
||||
public async Task RejectReviewToIdleAsync(string taskId)
|
||||
{
|
||||
await _hub.InvokeAsync("RejectReviewToIdle", taskId);
|
||||
}
|
||||
|
||||
public async Task CancelReviewAsync(string taskId)
|
||||
{
|
||||
await _hub.InvokeAsync("CancelReview", taskId);
|
||||
}
|
||||
|
||||
public Task<WorktreeCleanupDto?> CleanupFinishedWorktreesAsync(string? listId = null)
|
||||
=> TryInvokeAsync<WorktreeCleanupDto>("CleanupFinishedWorktrees", listId);
|
||||
|
||||
@@ -454,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);
|
||||
|
||||
13
src/ClaudeDo.Ui/Services/WorkerNotesApi.cs
Normal file
13
src/ClaudeDo.Ui/Services/WorkerNotesApi.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using ClaudeDo.Ui.Services.Interfaces;
|
||||
|
||||
namespace ClaudeDo.Ui.Services;
|
||||
|
||||
public sealed class WorkerNotesApi : INotesApi
|
||||
{
|
||||
private readonly WorkerClient _client;
|
||||
public WorkerNotesApi(WorkerClient client) => _client = client;
|
||||
public Task<List<DailyNoteDto>> ListAsync(DateOnly day) => _client.GetDailyNotesAsync(day);
|
||||
public Task<DailyNoteDto?> AddAsync(DateOnly day, string text) => _client.AddDailyNoteAsync(day, text);
|
||||
public Task UpdateAsync(string id, string text) => _client.UpdateDailyNoteAsync(id, text);
|
||||
public Task DeleteAsync(string id) => _client.DeleteDailyNoteAsync(id);
|
||||
}
|
||||
@@ -6,7 +6,9 @@ using ClaudeDo.Data;
|
||||
using ClaudeDo.Data.Models;
|
||||
using ClaudeDo.Data.Repositories;
|
||||
using ClaudeDo.Ui.Helpers;
|
||||
using ClaudeDo.Ui.Localization;
|
||||
using ClaudeDo.Ui.Services;
|
||||
using ClaudeDo.Ui.Services.Interfaces;
|
||||
using ClaudeDo.Ui.ViewModels.Modals;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
@@ -49,6 +51,10 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase
|
||||
private readonly IDbContextFactory<ClaudeDoDbContext> _dbFactory;
|
||||
private readonly IWorkerClient _worker;
|
||||
private readonly IServiceProvider _services;
|
||||
private readonly INotesApi _notesApi;
|
||||
|
||||
[ObservableProperty] private bool _isNotesMode;
|
||||
public NotesEditorViewModel Notes { get; private set; } = null!;
|
||||
|
||||
// Current task row (set by IslandsShellViewModel via Bind)
|
||||
[ObservableProperty]
|
||||
@@ -94,13 +100,14 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase
|
||||
[NotifyCanExecuteChangedFor(nameof(DequeueCommand))]
|
||||
[NotifyCanExecuteChangedFor(nameof(ResetAndRetryCommand))]
|
||||
[NotifyCanExecuteChangedFor(nameof(ContinueCommand))]
|
||||
private string _agentStatusLabel = "Idle";
|
||||
public bool IsIdle => AgentStatusLabel == "Idle";
|
||||
public bool IsQueued => AgentStatusLabel == "Queued";
|
||||
public bool IsRunning => AgentStatusLabel == "Running";
|
||||
public bool IsDone => AgentStatusLabel == "Done";
|
||||
public bool IsFailed => AgentStatusLabel == "Failed";
|
||||
public bool IsCancelled => AgentStatusLabel == "Cancelled";
|
||||
private string _agentState = "idle";
|
||||
public string AgentStatusLabel => Loc.T($"vm.agentStatus.{AgentState}");
|
||||
public bool IsIdle => AgentState == "idle";
|
||||
public bool IsQueued => AgentState == "queued";
|
||||
public bool IsRunning => AgentState == "running";
|
||||
public bool IsDone => AgentState == "done";
|
||||
public bool IsFailed => AgentState == "failed";
|
||||
public bool IsCancelled => AgentState == "cancelled";
|
||||
|
||||
// Recovery actions: Continue (resume session) for Failed/Cancelled.
|
||||
public bool ShowContinue => IsFailed || IsCancelled;
|
||||
@@ -111,8 +118,9 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase
|
||||
[NotifyCanExecuteChangedFor(nameof(ContinueCommand))]
|
||||
private string? _latestRunSessionId;
|
||||
|
||||
partial void OnAgentStatusLabelChanged(string value)
|
||||
partial void OnAgentStateChanged(string value)
|
||||
{
|
||||
OnPropertyChanged(nameof(AgentStatusLabel));
|
||||
OnPropertyChanged(nameof(IsIdle));
|
||||
OnPropertyChanged(nameof(IsQueued));
|
||||
OnPropertyChanged(nameof(IsRunning));
|
||||
@@ -122,6 +130,8 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase
|
||||
OnPropertyChanged(nameof(ShowContinue));
|
||||
OnPropertyChanged(nameof(ShowResetAndRetry));
|
||||
OnPropertyChanged(nameof(IsAgentSectionEnabled));
|
||||
OnPropertyChanged(nameof(EffectiveModelLabel));
|
||||
OnPropertyChanged(nameof(EffectiveAgentLabel));
|
||||
}
|
||||
[ObservableProperty] private string? _model;
|
||||
|
||||
@@ -134,6 +144,12 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase
|
||||
[ObservableProperty] private string _effectiveSystemPromptHint = "";
|
||||
[ObservableProperty] private string _effectiveAgentHint = "";
|
||||
|
||||
public string EffectiveModelLabel => Loc.T("vm.details.effectiveIfInherited", EffectiveModelHint);
|
||||
public string EffectiveAgentLabel => Loc.T("vm.details.effectiveIfInherited", EffectiveAgentHint);
|
||||
|
||||
partial void OnEffectiveModelHintChanged(string value) => OnPropertyChanged(nameof(EffectiveModelLabel));
|
||||
partial void OnEffectiveAgentHintChanged(string value) => OnPropertyChanged(nameof(EffectiveAgentLabel));
|
||||
|
||||
public System.Collections.ObjectModel.ObservableCollection<string> TaskModelOptions { get; } = new(
|
||||
new[] { ModelRegistry.TaskInheritSentinel }.Concat(ModelRegistry.Aliases));
|
||||
|
||||
@@ -218,6 +234,26 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase
|
||||
// Set by the view so DeleteTaskCommand can show an error message
|
||||
public Func<string, System.Threading.Tasks.Task>? ShowErrorAsync { get; set; }
|
||||
|
||||
private static string StatusToStateKey(ClaudeDo.Data.Models.TaskStatus status) => status switch
|
||||
{
|
||||
ClaudeDo.Data.Models.TaskStatus.Queued => "queued",
|
||||
ClaudeDo.Data.Models.TaskStatus.Running => "running",
|
||||
ClaudeDo.Data.Models.TaskStatus.WaitingForReview => "running",
|
||||
ClaudeDo.Data.Models.TaskStatus.Done => "done",
|
||||
ClaudeDo.Data.Models.TaskStatus.Failed => "failed",
|
||||
ClaudeDo.Data.Models.TaskStatus.Cancelled => "cancelled",
|
||||
_ => "idle",
|
||||
};
|
||||
|
||||
private static string FinishedStatusToStateKey(string status) => status switch
|
||||
{
|
||||
"done" => "done",
|
||||
"failed" => "failed",
|
||||
"cancelled" => "cancelled",
|
||||
"waiting_for_review" => "running",
|
||||
_ => status.ToLowerInvariant(),
|
||||
};
|
||||
|
||||
private async System.Threading.Tasks.Task RefreshStatusAsync(string taskId)
|
||||
{
|
||||
try
|
||||
@@ -228,16 +264,24 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase
|
||||
.FirstOrDefaultAsync(t => t.Id == taskId);
|
||||
if (entity is null || Task?.Id != taskId) return;
|
||||
|
||||
AgentStatusLabel = entity.Status.ToString();
|
||||
AgentState = StatusToStateKey(entity.Status);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
public DetailsIslandViewModel(IDbContextFactory<ClaudeDoDbContext> dbFactory, IWorkerClient worker, IServiceProvider services)
|
||||
public DetailsIslandViewModel(IDbContextFactory<ClaudeDoDbContext> dbFactory, IWorkerClient worker, IServiceProvider services, INotesApi notesApi)
|
||||
{
|
||||
_dbFactory = dbFactory;
|
||||
_worker = worker;
|
||||
_services = services;
|
||||
_notesApi = notesApi;
|
||||
Notes = new NotesEditorViewModel(_notesApi);
|
||||
Loc.LanguageChanged += (_, _) =>
|
||||
{
|
||||
OnPropertyChanged(nameof(AgentStatusLabel));
|
||||
OnPropertyChanged(nameof(EffectiveModelLabel));
|
||||
OnPropertyChanged(nameof(EffectiveAgentLabel));
|
||||
};
|
||||
|
||||
// Subscribe once; filter by current task id inside the handler
|
||||
_worker.TaskMessageEvent += OnTaskMessage;
|
||||
@@ -257,7 +301,7 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase
|
||||
// If the task row's live status changes (e.g. TaskStarted/Finished), mirror it.
|
||||
_worker.TaskStartedEvent += (slot, taskId, startedAt) =>
|
||||
{
|
||||
if (Task?.Id == taskId) AgentStatusLabel = "Running";
|
||||
if (Task?.Id == taskId) AgentState = "running";
|
||||
};
|
||||
_worker.TaskFinishedEvent += (slot, taskId, status, finishedAt) =>
|
||||
{
|
||||
@@ -268,7 +312,7 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase
|
||||
Kind = LogKind.Done,
|
||||
Text = $"── {status.ToUpperInvariant()} · {finishedAt.ToLocalTime():HH:mm:ss} ──",
|
||||
});
|
||||
AgentStatusLabel = status;
|
||||
AgentState = FinishedStatusToStateKey(status);
|
||||
// Re-query to pick up worktree created during the run.
|
||||
_ = RefreshWorktreeAsync(taskId);
|
||||
};
|
||||
@@ -431,8 +475,16 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase
|
||||
}
|
||||
}
|
||||
|
||||
public void ShowNotes()
|
||||
{
|
||||
Bind(null);
|
||||
IsNotesMode = true;
|
||||
_ = Notes.LoadDayAsync(DateOnly.FromDateTime(DateTime.Today));
|
||||
}
|
||||
|
||||
public void Bind(TaskRowViewModel? row)
|
||||
{
|
||||
IsNotesMode = false;
|
||||
_loadCts?.Cancel();
|
||||
_loadCts?.Dispose();
|
||||
_loadCts = new CancellationTokenSource();
|
||||
@@ -458,7 +510,7 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase
|
||||
WorktreePath = null;
|
||||
WorktreeStateLabel = null;
|
||||
BranchLine = null;
|
||||
AgentStatusLabel = "Idle";
|
||||
AgentState = "idle";
|
||||
LatestRunSessionId = null;
|
||||
_suppressAgentSave = true;
|
||||
try
|
||||
@@ -504,7 +556,7 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase
|
||||
WorktreeBaseCommit = entity.Worktree?.BaseCommit;
|
||||
WorktreeStateLabel = entity.Worktree?.State.ToString();
|
||||
BranchLine = entity.Worktree is { } w ? $"{w.BranchName} \u2190 main" : null;
|
||||
AgentStatusLabel = entity.Status.ToString();
|
||||
AgentState = StatusToStateKey(entity.Status);
|
||||
await LoadAgentSettingsAsync(entity, ct);
|
||||
ct.ThrowIfCancellationRequested();
|
||||
|
||||
@@ -715,7 +767,7 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase
|
||||
WorktreeBaseCommit = entity.Worktree?.BaseCommit;
|
||||
WorktreeStateLabel = entity.Worktree?.State.ToString();
|
||||
BranchLine = entity.Worktree is { } w ? $"{w.BranchName} ← main" : null;
|
||||
AgentStatusLabel = entity.Status.ToString();
|
||||
AgentState = StatusToStateKey(entity.Status);
|
||||
if (Task is { } row && entity.Worktree?.DiffStat is { } stat)
|
||||
row.DiffStat = stat;
|
||||
}
|
||||
@@ -793,7 +845,7 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase
|
||||
? ClaudeDo.Data.Models.TaskStatus.Done
|
||||
: ClaudeDo.Data.Models.TaskStatus.Idle;
|
||||
Task.Status = entity.Status;
|
||||
AgentStatusLabel = entity.Status.ToString();
|
||||
AgentState = StatusToStateKey(entity.Status);
|
||||
await repo.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
@@ -907,7 +959,7 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase
|
||||
try
|
||||
{
|
||||
await _worker.SetTaskStatusAsync(Task.Id, ClaudeDo.Data.Models.TaskStatus.Queued);
|
||||
AgentStatusLabel = "Queued";
|
||||
AgentState = "queued";
|
||||
}
|
||||
catch { /* offline */ }
|
||||
}
|
||||
@@ -923,7 +975,7 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase
|
||||
try
|
||||
{
|
||||
await _worker.SetTaskStatusAsync(Task.Id, ClaudeDo.Data.Models.TaskStatus.Idle);
|
||||
AgentStatusLabel = "Idle";
|
||||
AgentState = "idle";
|
||||
}
|
||||
catch { /* offline */ }
|
||||
}
|
||||
@@ -958,7 +1010,7 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase
|
||||
try
|
||||
{
|
||||
await _worker.SetTaskStatusAsync(Task.Id, ClaudeDo.Data.Models.TaskStatus.Queued);
|
||||
AgentStatusLabel = "Queued";
|
||||
AgentState = "queued";
|
||||
}
|
||||
catch { /* offline */ }
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ using ClaudeDo.Data.Filtering;
|
||||
using ClaudeDo.Data.Models;
|
||||
using TaskStatus = ClaudeDo.Data.Models.TaskStatus;
|
||||
using ClaudeDo.Data.Repositories;
|
||||
using ClaudeDo.Ui.Localization;
|
||||
using ClaudeDo.Ui.Services;
|
||||
using ClaudeDo.Ui.ViewModels.Modals;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
@@ -137,6 +138,7 @@ public sealed partial class ListsIslandViewModel : ViewModelBase
|
||||
|
||||
public string UserName { get; } = Environment.UserName;
|
||||
public string MachineName { get; } = Environment.MachineName;
|
||||
public string MachineNameLocal => Loc.T("vm.lists.localSuffix", MachineName);
|
||||
public string UserInitials { get; }
|
||||
|
||||
public ListsIslandViewModel(IDbContextFactory<ClaudeDoDbContext> dbFactory, IServiceProvider? services = null, WorkerClient? worker = null)
|
||||
@@ -160,6 +162,26 @@ public sealed partial class ListsIslandViewModel : ViewModelBase
|
||||
_worker.WorktreeUpdatedEvent += _id => _ = RefreshCountsAsync();
|
||||
_worker.ConnectionRestoredEvent += () => _ = RefreshCountsAsync();
|
||||
}
|
||||
|
||||
Loc.LanguageChanged += (_, _) => RefreshLocalizedLabels();
|
||||
}
|
||||
|
||||
private static string? SmartListNameKey(string id) => id switch
|
||||
{
|
||||
"smart:my-day" => "vm.lists.smartMyDay",
|
||||
"smart:important" => "vm.lists.smartImportant",
|
||||
"smart:planned" => "vm.lists.smartPlanned",
|
||||
"virtual:queued" => "vm.lists.virtualQueue",
|
||||
"virtual:running" => "vm.lists.virtualRunning",
|
||||
"virtual:review" => "vm.lists.virtualReview",
|
||||
_ => null,
|
||||
};
|
||||
|
||||
private void RefreshLocalizedLabels()
|
||||
{
|
||||
foreach (var item in SmartLists)
|
||||
if (SmartListNameKey(item.Id) is { } key) item.Name = Loc.T(key);
|
||||
OnPropertyChanged(nameof(MachineNameLocal));
|
||||
}
|
||||
|
||||
public async Task LoadAsync(CancellationToken ct = default)
|
||||
@@ -170,12 +192,12 @@ public sealed partial class ListsIslandViewModel : ViewModelBase
|
||||
|
||||
var smart = new[]
|
||||
{
|
||||
new ListNavItemViewModel { Id = "smart:my-day", Name = "My Day", Kind = ListKind.Smart, IconKey = "Sun" },
|
||||
new ListNavItemViewModel { Id = "smart:important", Name = "Important", Kind = ListKind.Smart, IconKey = "Star" },
|
||||
new ListNavItemViewModel { Id = "smart:planned", Name = "Planned", Kind = ListKind.Smart, IconKey = "Calendar" },
|
||||
new ListNavItemViewModel { Id = "virtual:queued", Name = "Queue", Kind = ListKind.Virtual, IconKey = "Inbox" },
|
||||
new ListNavItemViewModel { Id = "virtual:running", Name = "Running", Kind = ListKind.Virtual, IconKey = "Activity" },
|
||||
new ListNavItemViewModel { Id = "virtual:review", Name = "Review", Kind = ListKind.Virtual, IconKey = "Eye" },
|
||||
new ListNavItemViewModel { Id = "smart:my-day", Name = Loc.T("vm.lists.smartMyDay"), Kind = ListKind.Smart, IconKey = "Sun" },
|
||||
new ListNavItemViewModel { Id = "smart:important", Name = Loc.T("vm.lists.smartImportant"), Kind = ListKind.Smart, IconKey = "Star" },
|
||||
new ListNavItemViewModel { Id = "smart:planned", Name = Loc.T("vm.lists.smartPlanned"), Kind = ListKind.Smart, IconKey = "Calendar" },
|
||||
new ListNavItemViewModel { Id = "virtual:queued", Name = Loc.T("vm.lists.virtualQueue"), Kind = ListKind.Virtual, IconKey = "Inbox" },
|
||||
new ListNavItemViewModel { Id = "virtual:running", Name = Loc.T("vm.lists.virtualRunning"), Kind = ListKind.Virtual, IconKey = "Activity" },
|
||||
new ListNavItemViewModel { Id = "virtual:review", Name = Loc.T("vm.lists.virtualReview"), Kind = ListKind.Virtual, IconKey = "Eye" },
|
||||
};
|
||||
foreach (var s in smart) { Items.Add(s); SmartLists.Add(s); }
|
||||
|
||||
@@ -242,7 +264,7 @@ public sealed partial class ListsIslandViewModel : ViewModelBase
|
||||
var entity = new ListEntity
|
||||
{
|
||||
Id = Guid.NewGuid().ToString("N"),
|
||||
Name = "New list",
|
||||
Name = Loc.T("vm.lists.newList"),
|
||||
DefaultCommitType = CommitTypeRegistry.DefaultType,
|
||||
CreatedAt = DateTime.UtcNow,
|
||||
};
|
||||
|
||||
83
src/ClaudeDo.Ui/ViewModels/Islands/NotesEditorViewModel.cs
Normal file
83
src/ClaudeDo.Ui/ViewModels/Islands/NotesEditorViewModel.cs
Normal file
@@ -0,0 +1,83 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using ClaudeDo.Ui.Services.Interfaces;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
|
||||
namespace ClaudeDo.Ui.ViewModels.Islands;
|
||||
|
||||
public sealed partial class NoteBulletViewModel : ViewModelBase
|
||||
{
|
||||
private readonly Func<NoteBulletViewModel, Task> _save;
|
||||
private readonly Func<NoteBulletViewModel, Task> _delete;
|
||||
|
||||
public string Id { get; }
|
||||
|
||||
[ObservableProperty] private string _text;
|
||||
|
||||
public NoteBulletViewModel(string id, string text,
|
||||
Func<NoteBulletViewModel, Task> save, Func<NoteBulletViewModel, Task> delete)
|
||||
{
|
||||
Id = id;
|
||||
_text = text;
|
||||
_save = save;
|
||||
_delete = delete;
|
||||
}
|
||||
|
||||
[RelayCommand] private Task Save() => _save(this);
|
||||
[RelayCommand] private Task Delete() => _delete(this);
|
||||
}
|
||||
|
||||
public sealed partial class NotesEditorViewModel : ViewModelBase
|
||||
{
|
||||
private readonly INotesApi _api;
|
||||
|
||||
public NotesEditorViewModel(INotesApi api) => _api = api;
|
||||
|
||||
public ObservableCollection<NoteBulletViewModel> Bullets { get; } = new();
|
||||
|
||||
[ObservableProperty] private DateOnly _currentDay = DateOnly.FromDateTime(DateTime.Today);
|
||||
[ObservableProperty] private string _newBulletText = "";
|
||||
|
||||
public DateTime CurrentDate
|
||||
{
|
||||
get => CurrentDay.ToDateTime(TimeOnly.MinValue);
|
||||
set { var d = DateOnly.FromDateTime(value); if (d != CurrentDay) _ = LoadDayAsync(d); }
|
||||
}
|
||||
|
||||
public string CurrentDayLabel => CurrentDay.ToString("dddd, dd.MM.yyyy");
|
||||
|
||||
public async Task LoadDayAsync(DateOnly day)
|
||||
{
|
||||
CurrentDay = day;
|
||||
OnPropertyChanged(nameof(CurrentDate));
|
||||
OnPropertyChanged(nameof(CurrentDayLabel));
|
||||
Bullets.Clear();
|
||||
foreach (var dto in await _api.ListAsync(day))
|
||||
Bullets.Add(MakeBullet(dto.Id, dto.Text));
|
||||
}
|
||||
|
||||
private NoteBulletViewModel MakeBullet(string id, string text) =>
|
||||
new(id, text, SaveBulletAsync, DeleteBulletAsync);
|
||||
|
||||
[RelayCommand]
|
||||
private async Task AddBullet()
|
||||
{
|
||||
var text = NewBulletText.Trim();
|
||||
if (text.Length == 0) return;
|
||||
var dto = await _api.AddAsync(CurrentDay, text);
|
||||
if (dto is not null) Bullets.Add(MakeBullet(dto.Id, dto.Text));
|
||||
NewBulletText = "";
|
||||
}
|
||||
|
||||
[RelayCommand] private Task PrevDay() => LoadDayAsync(CurrentDay.AddDays(-1));
|
||||
[RelayCommand] private Task NextDay() => LoadDayAsync(CurrentDay.AddDays(1));
|
||||
[RelayCommand] private Task Today() => LoadDayAsync(DateOnly.FromDateTime(DateTime.Today));
|
||||
|
||||
private Task SaveBulletAsync(NoteBulletViewModel b) => _api.UpdateAsync(b.Id, b.Text);
|
||||
|
||||
private async Task DeleteBulletAsync(NoteBulletViewModel b)
|
||||
{
|
||||
await _api.DeleteAsync(b.Id);
|
||||
Bullets.Remove(b);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using ClaudeDo.Data.Models;
|
||||
using ClaudeDo.Ui.Localization;
|
||||
using TaskStatus = ClaudeDo.Data.Models.TaskStatus;
|
||||
|
||||
namespace ClaudeDo.Ui.ViewModels.Islands;
|
||||
@@ -31,7 +32,7 @@ public sealed partial class TaskRowViewModel : ViewModelBase
|
||||
[ObservableProperty] private bool _parentFinalized;
|
||||
|
||||
public DateTime CreatedAt { get; init; }
|
||||
public string CreatedAtFormatted => CreatedAt == default ? "—" : $"Created {CreatedAt:MMM d}";
|
||||
public string CreatedAtFormatted => CreatedAt == default ? "—" : Loc.T("vm.taskRow.createdPrefix", CreatedAt.ToString("MMM d"));
|
||||
|
||||
public int StepsCount { get; init; }
|
||||
public int StepsCompleted { get; init; }
|
||||
@@ -50,8 +51,8 @@ public sealed partial class TaskRowViewModel : ViewModelBase
|
||||
|
||||
public string? PlanningBadge => PlanningPhase switch
|
||||
{
|
||||
PlanningPhase.Active => "PLANNING",
|
||||
PlanningPhase.Finalized => "PLANNED",
|
||||
PlanningPhase.Active => Loc.T("vm.planningBadge.active"),
|
||||
PlanningPhase.Finalized => Loc.T("vm.planningBadge.finalized"),
|
||||
_ => null,
|
||||
};
|
||||
|
||||
@@ -63,10 +64,11 @@ public sealed partial class TaskRowViewModel : ViewModelBase
|
||||
public bool HasSteps => StepsCount > 0;
|
||||
public bool IsOverdue => ScheduledFor is { } d && d.Date < DateTime.Today && !Done;
|
||||
public bool IsRunning => Status == TaskStatus.Running;
|
||||
public bool IsWaitingForReview => Status == TaskStatus.WaitingForReview;
|
||||
public bool IsQueued => Status == TaskStatus.Queued && string.IsNullOrEmpty(BlockedByTaskId);
|
||||
public bool IsWaiting => Status == TaskStatus.Queued && !string.IsNullOrEmpty(BlockedByTaskId);
|
||||
public bool CanRemoveFromQueue => IsQueued || HasQueuedSubtasks;
|
||||
public bool CanSendToQueue => !IsRunning && !IsQueued && !HasQueuedSubtasks
|
||||
public bool CanSendToQueue => !IsRunning && !IsQueued && !IsWaitingForReview && !HasQueuedSubtasks
|
||||
&& (!IsChild || ParentFinalized);
|
||||
// Parent-level "send plan to queue" — only once the plan is finalized (children Planned).
|
||||
public bool CanQueuePlan => !IsChild && HasPlanningChildren
|
||||
@@ -76,13 +78,26 @@ public sealed partial class TaskRowViewModel : ViewModelBase
|
||||
|
||||
public string DiffAdditionsText => $"+{DiffAdditions}";
|
||||
public string DiffDeletionsText => $"−{DiffDeletions}";
|
||||
public string StepsText => $"{StepsCompleted}/{StepsCount} steps";
|
||||
public string StepsText => Loc.T("vm.taskRow.stepsText", StepsCompleted, StepsCount);
|
||||
|
||||
public string StatusLabel => Status switch
|
||||
{
|
||||
TaskStatus.Idle => Loc.T("vm.taskStatus.idle"),
|
||||
TaskStatus.Queued => Loc.T("vm.taskStatus.queued"),
|
||||
TaskStatus.Running => Loc.T("vm.taskStatus.running"),
|
||||
TaskStatus.WaitingForReview => Loc.T("vm.taskStatus.waitingForReview"),
|
||||
TaskStatus.Done => Loc.T("vm.taskStatus.done"),
|
||||
TaskStatus.Failed => Loc.T("vm.taskStatus.failed"),
|
||||
TaskStatus.Cancelled => Loc.T("vm.taskStatus.cancelled"),
|
||||
_ => Status.ToString(),
|
||||
};
|
||||
|
||||
public string StatusChipClass => (Status, IsBlocked: !string.IsNullOrEmpty(BlockedByTaskId)) switch
|
||||
{
|
||||
(TaskStatus.Running, _) => "running",
|
||||
(TaskStatus.WaitingForReview, _) => "review",
|
||||
(TaskStatus.Failed, _) => "error",
|
||||
(TaskStatus.Done, _) => "review",
|
||||
(TaskStatus.Done, _) => "done",
|
||||
(TaskStatus.Queued, true) => "waiting",
|
||||
(TaskStatus.Queued, false) => "queued",
|
||||
_ => "idle",
|
||||
@@ -91,7 +106,9 @@ public sealed partial class TaskRowViewModel : ViewModelBase
|
||||
partial void OnStatusChanged(TaskStatus value)
|
||||
{
|
||||
OnPropertyChanged(nameof(StatusChipClass));
|
||||
OnPropertyChanged(nameof(StatusLabel));
|
||||
OnPropertyChanged(nameof(IsRunning));
|
||||
OnPropertyChanged(nameof(IsWaitingForReview));
|
||||
OnPropertyChanged(nameof(IsQueued));
|
||||
OnPropertyChanged(nameof(IsWaiting));
|
||||
OnPropertyChanged(nameof(IsDraft));
|
||||
@@ -158,6 +175,14 @@ public sealed partial class TaskRowViewModel : ViewModelBase
|
||||
partial void OnDiffAdditionsChanged(int value) { OnPropertyChanged(nameof(HasDiff)); OnPropertyChanged(nameof(DiffAdditionsText)); }
|
||||
partial void OnDiffDeletionsChanged(int value) { OnPropertyChanged(nameof(HasDiff)); OnPropertyChanged(nameof(DiffDeletionsText)); }
|
||||
|
||||
public void RefreshLocalized()
|
||||
{
|
||||
OnPropertyChanged(nameof(StatusLabel));
|
||||
OnPropertyChanged(nameof(PlanningBadge));
|
||||
OnPropertyChanged(nameof(CreatedAtFormatted));
|
||||
OnPropertyChanged(nameof(StepsText));
|
||||
}
|
||||
|
||||
public static TaskRowViewModel FromEntity(TaskEntity t)
|
||||
{
|
||||
var row = new TaskRowViewModel { Id = t.Id, CreatedAt = t.CreatedAt };
|
||||
|
||||
@@ -6,6 +6,7 @@ using ClaudeDo.Data;
|
||||
using ClaudeDo.Data.Filtering;
|
||||
using ClaudeDo.Data.Models;
|
||||
using ClaudeDo.Data.Repositories;
|
||||
using ClaudeDo.Ui.Localization;
|
||||
using ClaudeDo.Ui.Services;
|
||||
using ClaudeDo.Ui.ViewModels.Modals;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
@@ -25,8 +26,16 @@ public sealed partial class TasksIslandViewModel : ViewModelBase
|
||||
public event EventHandler? SelectionChanged;
|
||||
public event EventHandler? FocusAddTaskRequested;
|
||||
public event EventHandler? TasksChanged;
|
||||
public event Action? NotesRequested;
|
||||
public void RequestFocusAddTask() => FocusAddTaskRequested?.Invoke(this, EventArgs.Empty);
|
||||
|
||||
[RelayCommand]
|
||||
private void OpenNotes()
|
||||
{
|
||||
SelectedTask = null;
|
||||
NotesRequested?.Invoke();
|
||||
}
|
||||
|
||||
public ObservableCollection<TaskRowViewModel> Items { get; } = new();
|
||||
public ObservableCollection<TaskRowViewModel> OverdueItems { get; } = new();
|
||||
public ObservableCollection<TaskRowViewModel> OpenItems { get; } = new();
|
||||
@@ -44,7 +53,8 @@ public sealed partial class TasksIslandViewModel : ViewModelBase
|
||||
[ObservableProperty] private bool _hasOpen;
|
||||
[ObservableProperty] private bool _hasCompleted;
|
||||
[ObservableProperty] private bool _showOpenLabel;
|
||||
[ObservableProperty] private string _completedHeader = "COMPLETED";
|
||||
[ObservableProperty] private string _completedHeader = "";
|
||||
[ObservableProperty] private bool _showNotesRow;
|
||||
|
||||
public Func<UnfinishedPlanningModalViewModel, Task>? ShowUnfinishedPlanningModal { get; set; }
|
||||
|
||||
@@ -52,6 +62,7 @@ public sealed partial class TasksIslandViewModel : ViewModelBase
|
||||
{
|
||||
_dbFactory = dbFactory;
|
||||
_worker = worker;
|
||||
CompletedHeader = Loc.T("vm.tasksIsland.completedHeader");
|
||||
if (_worker is not null)
|
||||
{
|
||||
_worker.TaskUpdatedEvent += OnWorkerTaskUpdated;
|
||||
@@ -59,6 +70,14 @@ public sealed partial class TasksIslandViewModel : ViewModelBase
|
||||
_worker.ListUpdatedEvent += OnWorkerListUpdated;
|
||||
_worker.ConnectionRestoredEvent += () => LoadForList(_currentList);
|
||||
}
|
||||
Loc.LanguageChanged += (_, _) => RefreshLocalizedText();
|
||||
}
|
||||
|
||||
private void RefreshLocalizedText()
|
||||
{
|
||||
CompletedHeader = Loc.T("vm.tasksIsland.completedHeader");
|
||||
foreach (var row in Items) row.RefreshLocalized();
|
||||
foreach (var row in CompletedItems) row.RefreshLocalized();
|
||||
}
|
||||
|
||||
private async void OnWorkerListUpdated(string listId)
|
||||
@@ -176,10 +195,12 @@ public sealed partial class TasksIslandViewModel : ViewModelBase
|
||||
HasOpen = false;
|
||||
HasCompleted = false;
|
||||
ShowOpenLabel = false;
|
||||
ShowNotesRow = false;
|
||||
if (list is null) return;
|
||||
|
||||
HeaderTitle = list.Name;
|
||||
HeaderEyebrow = DateTime.Now.ToString("dddd · MMM dd", CultureInfo.InvariantCulture).ToUpperInvariant();
|
||||
ShowNotesRow = list.Id == "smart:my-day";
|
||||
|
||||
_ = LoadForListAsync(list, ct);
|
||||
}
|
||||
@@ -329,7 +350,7 @@ public sealed partial class TasksIslandViewModel : ViewModelBase
|
||||
HasOpen = OpenItems.Count > 0;
|
||||
HasCompleted = CompletedItems.Count > 0;
|
||||
ShowOpenLabel = HasOpen && HasOverdue;
|
||||
CompletedHeader = $"COMPLETED · {CompletedItems.Count}";
|
||||
CompletedHeader = Loc.T("vm.tasksIsland.completedHeaderCount", CompletedItems.Count);
|
||||
}
|
||||
|
||||
private void UpdateSubtitle()
|
||||
@@ -602,6 +623,42 @@ public sealed partial class TasksIslandViewModel : ViewModelBase
|
||||
catch { /* worker offline; the broadcast will reconcile when it returns */ }
|
||||
}
|
||||
|
||||
// ── Review actions (visible when a task is WaitingForReview) ─────────────
|
||||
// Each delegates to the worker hub, which performs the transition and
|
||||
// broadcasts TaskUpdated; the row refreshes from that broadcast.
|
||||
|
||||
[RelayCommand]
|
||||
private async Task ApproveReviewAsync(TaskRowViewModel? row)
|
||||
{
|
||||
if (row is null || !row.IsWaitingForReview || _worker is null) return;
|
||||
try { await _worker.ApproveReviewAsync(row.Id); }
|
||||
catch { /* offline; broadcast reconciles on return */ }
|
||||
}
|
||||
|
||||
public async Task RejectReviewToQueueAsync(TaskRowViewModel row, string feedback)
|
||||
{
|
||||
if (!row.IsWaitingForReview || _worker is null) return;
|
||||
if (string.IsNullOrWhiteSpace(feedback)) return;
|
||||
try { await _worker.RejectReviewToQueueAsync(row.Id, feedback); }
|
||||
catch { /* offline; broadcast reconciles on return */ }
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private async Task RejectReviewToIdleAsync(TaskRowViewModel? row)
|
||||
{
|
||||
if (row is null || !row.IsWaitingForReview || _worker is null) return;
|
||||
try { await _worker.RejectReviewToIdleAsync(row.Id); }
|
||||
catch { /* offline; broadcast reconciles on return */ }
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private async Task CancelReviewAsync(TaskRowViewModel? row)
|
||||
{
|
||||
if (row is null || !row.IsWaitingForReview || _worker is null) return;
|
||||
try { await _worker.CancelReviewAsync(row.Id); }
|
||||
catch { /* offline; broadcast reconciles on return */ }
|
||||
}
|
||||
|
||||
public async Task SetScheduledForAsync(TaskRowViewModel row, DateTime? when)
|
||||
{
|
||||
if (row is null) return;
|
||||
|
||||
@@ -6,6 +6,7 @@ using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using ClaudeDo.Data;
|
||||
using ClaudeDo.Data.Models;
|
||||
using ClaudeDo.Ui.Localization;
|
||||
using ClaudeDo.Ui.Services;
|
||||
using ClaudeDo.Ui.ViewModels.Islands;
|
||||
using ClaudeDo.Ui.ViewModels.Modals;
|
||||
@@ -23,9 +24,9 @@ public sealed partial class IslandsShellViewModel : ViewModelBase
|
||||
public UpdateCheckService UpdateCheck => _updateCheck;
|
||||
|
||||
public string ConnectionText =>
|
||||
Worker?.IsConnected == true ? "Online"
|
||||
: Worker?.IsReconnecting == true ? "Connecting…"
|
||||
: "Offline";
|
||||
Worker?.IsConnected == true ? Loc.T("vm.connection.online")
|
||||
: Worker?.IsReconnecting == true ? Loc.T("vm.connection.connecting")
|
||||
: Loc.T("vm.connection.offline");
|
||||
|
||||
public bool IsOffline => Worker?.IsConnected != true && Worker?.IsReconnecting != true;
|
||||
|
||||
@@ -34,6 +35,7 @@ public sealed partial class IslandsShellViewModel : ViewModelBase
|
||||
private readonly WorkerLocator _workerLocator = null!;
|
||||
private readonly IDbContextFactory<ClaudeDoDbContext>? _dbFactory;
|
||||
private readonly Func<WorktreesOverviewModalViewModel> _worktreesOverviewVmFactory = () => null!;
|
||||
private readonly Func<WeeklyReportModalViewModel> _weeklyReportVmFactory = () => null!;
|
||||
private readonly Func<MergeModalViewModel> _mergeVmFactory = () => null!;
|
||||
private readonly Func<RepoImportModalViewModel>? _repoImportVmFactory;
|
||||
|
||||
@@ -51,6 +53,9 @@ public sealed partial class IslandsShellViewModel : ViewModelBase
|
||||
// Set by MainWindow to open the global worktrees overview dialog.
|
||||
public Func<WorktreesOverviewModalViewModel, Task>? ShowWorktreesOverviewModal { get; set; }
|
||||
|
||||
// Set by MainWindow to open the weekly report dialog.
|
||||
public Func<WeeklyReportModalViewModel, Task>? ShowWeeklyReportModal { get; set; }
|
||||
|
||||
// Set by MainWindow to open the worker-connection help dialog.
|
||||
public Func<WorkerConnectionModalViewModel, Task>? ShowWorkerConnectionModal { get; set; }
|
||||
|
||||
@@ -178,6 +183,7 @@ public sealed partial class IslandsShellViewModel : ViewModelBase
|
||||
WorkerLocator workerLocator,
|
||||
IDbContextFactory<ClaudeDoDbContext> dbFactory,
|
||||
Func<WorktreesOverviewModalViewModel> worktreesOverviewVmFactory,
|
||||
Func<WeeklyReportModalViewModel> weeklyReportVmFactory,
|
||||
Func<MergeModalViewModel> mergeVmFactory,
|
||||
Func<RepoImportModalViewModel> repoImportVmFactory)
|
||||
{
|
||||
@@ -187,10 +193,12 @@ public sealed partial class IslandsShellViewModel : ViewModelBase
|
||||
_workerLocator = workerLocator;
|
||||
_dbFactory = dbFactory;
|
||||
_worktreesOverviewVmFactory = worktreesOverviewVmFactory;
|
||||
_weeklyReportVmFactory = weeklyReportVmFactory;
|
||||
_mergeVmFactory = mergeVmFactory;
|
||||
_repoImportVmFactory = repoImportVmFactory;
|
||||
Lists.SelectionChanged += (_, _) => Tasks.LoadForList(Lists.SelectedList);
|
||||
Tasks.SelectionChanged += (_, _) => Details.Bind(Tasks.SelectedTask);
|
||||
Tasks.NotesRequested += () => Details.ShowNotes();
|
||||
Tasks.TasksChanged += (_, _) => _ = Lists.RefreshCountsAsync();
|
||||
Tasks.OpenListSettingsRequested += (_, _) =>
|
||||
{
|
||||
@@ -324,6 +332,22 @@ public sealed partial class IslandsShellViewModel : ViewModelBase
|
||||
finally { _worktreesOverviewOpen = false; }
|
||||
}
|
||||
|
||||
private bool _weeklyReportOpen;
|
||||
|
||||
[RelayCommand]
|
||||
private async Task OpenWeeklyReport()
|
||||
{
|
||||
if (ShowWeeklyReportModal is null || _weeklyReportOpen) return;
|
||||
_weeklyReportOpen = true;
|
||||
try
|
||||
{
|
||||
var vm = _weeklyReportVmFactory();
|
||||
await vm.InitializeAsync();
|
||||
await ShowWeeklyReportModal(vm);
|
||||
}
|
||||
finally { _weeklyReportOpen = false; }
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private async Task CheckForUpdatesAsync()
|
||||
{
|
||||
@@ -335,7 +359,7 @@ public sealed partial class IslandsShellViewModel : ViewModelBase
|
||||
[RelayCommand]
|
||||
private async Task RestartWorkerAsync()
|
||||
{
|
||||
RestartWorkerStatus = "Restarting worker…";
|
||||
RestartWorkerStatus = Loc.T("vm.shell.restartingWorker");
|
||||
try
|
||||
{
|
||||
await Task.Run(RestartWorkerService);
|
||||
|
||||
@@ -2,6 +2,7 @@ using System.Collections.ObjectModel;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using ClaudeDo.Data.Git;
|
||||
using ClaudeDo.Ui.Localization;
|
||||
|
||||
namespace ClaudeDo.Ui.ViewModels.Modals;
|
||||
|
||||
@@ -91,13 +92,13 @@ public sealed partial class DiffModalViewModel : ViewModelBase
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
StatusMessage = $"Failed to load diff: {ex.Message}";
|
||||
StatusMessage = Loc.T("vm.diff.loadFailed", ex.Message);
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(raw))
|
||||
{
|
||||
StatusMessage = "No changes to show.";
|
||||
StatusMessage = Loc.T("vm.diff.noChanges");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -169,7 +170,7 @@ public sealed partial class DiffModalViewModel : ViewModelBase
|
||||
}
|
||||
|
||||
SelectedFile = Files.Count > 0 ? Files[0] : null;
|
||||
if (Files.Count == 0) StatusMessage = "No changes to show.";
|
||||
if (Files.Count == 0) StatusMessage = Loc.T("vm.diff.noChanges");
|
||||
}
|
||||
|
||||
private static void ParseHunkHeader(string header, out int oldStart, out int newStart)
|
||||
|
||||
@@ -2,6 +2,7 @@ using System.Collections.ObjectModel;
|
||||
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;
|
||||
@@ -80,7 +81,7 @@ public sealed partial class ListSettingsModalViewModel : ViewModelBase
|
||||
|
||||
await _worker.UpdateListAsync(new UpdateListDto(
|
||||
ListId,
|
||||
string.IsNullOrWhiteSpace(Name) ? "Untitled" : Name,
|
||||
string.IsNullOrWhiteSpace(Name) ? Loc.T("vm.listSettings.untitled") : Name,
|
||||
string.IsNullOrWhiteSpace(WorkingDir) ? null : WorkingDir,
|
||||
DefaultCommitType));
|
||||
|
||||
@@ -93,7 +94,7 @@ public sealed partial class ListSettingsModalViewModel : ViewModelBase
|
||||
[RelayCommand]
|
||||
private async Task DeleteAsync()
|
||||
{
|
||||
var displayName = string.IsNullOrWhiteSpace(Name) ? "Untitled" : Name;
|
||||
var displayName = string.IsNullOrWhiteSpace(Name) ? Loc.T("vm.listSettings.untitled") : Name;
|
||||
if (ConfirmAsync is not null)
|
||||
{
|
||||
var ok = await ConfirmAsync($"Delete list \"{displayName}\" and all its tasks? This cannot be undone.");
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using ClaudeDo.Ui.Localization;
|
||||
using ClaudeDo.Ui.Services;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
@@ -36,7 +37,7 @@ public sealed partial class MergeModalViewModel : ViewModelBase
|
||||
{
|
||||
TaskId = taskId;
|
||||
TaskTitle = taskTitle;
|
||||
CommitMessage = $"Merge task: {taskTitle}";
|
||||
CommitMessage = Loc.T("vm.merge.commitMessage", taskTitle);
|
||||
|
||||
IsBusy = true;
|
||||
try
|
||||
@@ -45,7 +46,7 @@ public sealed partial class MergeModalViewModel : ViewModelBase
|
||||
Branches.Clear();
|
||||
if (targets is null)
|
||||
{
|
||||
ErrorMessage = "Worker offline — cannot list branches.";
|
||||
ErrorMessage = Loc.T("vm.merge.workerOfflineBranches");
|
||||
return;
|
||||
}
|
||||
foreach (var b in targets.LocalBranches) Branches.Add(b);
|
||||
@@ -55,7 +56,7 @@ public sealed partial class MergeModalViewModel : ViewModelBase
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ErrorMessage = $"Failed to load branches: {ex.Message}";
|
||||
ErrorMessage = Loc.T("vm.merge.loadBranchesFailed", ex.Message);
|
||||
}
|
||||
finally { IsBusy = false; }
|
||||
}
|
||||
@@ -81,7 +82,7 @@ public sealed partial class MergeModalViewModel : ViewModelBase
|
||||
case "merged":
|
||||
SuccessMessage = result.ErrorMessage is not null
|
||||
? $"Merged with warning: {result.ErrorMessage}"
|
||||
: "Merged.";
|
||||
: Loc.T("vm.merge.merged");
|
||||
// Auto-close after a short delay.
|
||||
_ = Task.Run(async () =>
|
||||
{
|
||||
@@ -92,19 +93,19 @@ public sealed partial class MergeModalViewModel : ViewModelBase
|
||||
case "conflict":
|
||||
HasConflict = true;
|
||||
ConflictFiles = result.ConflictFiles;
|
||||
ErrorMessage = "Merge conflict — target branch restored. Resolve manually or via Continue, then retry.";
|
||||
ErrorMessage = Loc.T("vm.merge.conflict");
|
||||
break;
|
||||
case "blocked":
|
||||
ErrorMessage = $"Blocked: {result.ErrorMessage}";
|
||||
ErrorMessage = Loc.T("vm.merge.blocked", result.ErrorMessage ?? "");
|
||||
break;
|
||||
default:
|
||||
ErrorMessage = $"Unknown status: {result.Status}";
|
||||
ErrorMessage = Loc.T("vm.merge.unknownStatus", result.Status);
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ErrorMessage = $"Merge failed: {ex.Message}";
|
||||
ErrorMessage = Loc.T("vm.merge.mergeFailed", ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Diagnostics;
|
||||
using ClaudeDo.Data;
|
||||
using ClaudeDo.Ui.Localization;
|
||||
using ClaudeDo.Ui.Services;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
@@ -26,13 +27,13 @@ public sealed partial class FilesSettingsTabViewModel : ViewModelBase
|
||||
try
|
||||
{
|
||||
var r = await _worker.RestoreDefaultAgentsAsync();
|
||||
if (r is null) StatusMessage = "Worker offline.";
|
||||
else if (r.Copied == 0 && r.Skipped == 0) StatusMessage = "No default agents bundled.";
|
||||
else if (r.Copied == 0) StatusMessage = "All default agents already present.";
|
||||
else StatusMessage = $"Restored {r.Copied} default agent(s).";
|
||||
if (r is null) StatusMessage = Loc.T("vm.filesTab.workerOffline");
|
||||
else if (r.Copied == 0 && r.Skipped == 0) StatusMessage = Loc.T("vm.filesTab.noneBundled");
|
||||
else if (r.Copied == 0) StatusMessage = Loc.T("vm.filesTab.allPresent");
|
||||
else StatusMessage = Loc.T("vm.filesTab.restored", r.Copied);
|
||||
await _worker.RefreshAgentsAsync();
|
||||
}
|
||||
catch (Exception ex) { StatusMessage = $"Restore failed: {ex.Message}"; }
|
||||
catch (Exception ex) { StatusMessage = Loc.T("vm.filesTab.restoreFailed", ex.Message); }
|
||||
finally { IsBusy = false; }
|
||||
}
|
||||
|
||||
@@ -46,6 +47,6 @@ public sealed partial class FilesSettingsTabViewModel : ViewModelBase
|
||||
var path = PromptFiles.PathFor(kind);
|
||||
Process.Start(new ProcessStartInfo(path) { UseShellExecute = true });
|
||||
}
|
||||
catch (Exception ex) { StatusMessage = $"Open failed: {ex.Message}"; }
|
||||
catch (Exception ex) { StatusMessage = Loc.T("vm.filesTab.openFailed", ex.Message); }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,48 @@
|
||||
using ClaudeDo.Data.Models;
|
||||
using ClaudeDo.Localization;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace ClaudeDo.Ui.ViewModels.Modals.Settings;
|
||||
|
||||
public sealed partial class GeneralSettingsTabViewModel : ViewModelBase
|
||||
{
|
||||
private readonly ILocalizer? _localizer;
|
||||
private readonly Action<string>? _persist;
|
||||
|
||||
[ObservableProperty] private string _defaultClaudeInstructions = "";
|
||||
[ObservableProperty] private string _defaultModel = ModelRegistry.DefaultAlias;
|
||||
[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;
|
||||
|
||||
public GeneralSettingsTabViewModel() { }
|
||||
|
||||
public GeneralSettingsTabViewModel(ILocalizer localizer, Action<string> persist)
|
||||
{
|
||||
_localizer = localizer;
|
||||
_persist = persist;
|
||||
Languages = localizer.AvailableLanguages;
|
||||
_selectedLanguage = Languages.FirstOrDefault(l => l.Code == localizer.CurrentCode);
|
||||
}
|
||||
|
||||
public IReadOnlyList<LanguageOption> Languages { get; } = Array.Empty<LanguageOption>();
|
||||
|
||||
[ObservableProperty] private LanguageOption? _selectedLanguage;
|
||||
|
||||
partial void OnSelectedLanguageChanged(LanguageOption? value)
|
||||
{
|
||||
if (value is null || _localizer is null) return;
|
||||
_localizer.SetLanguage(value.Value.Code);
|
||||
_persist?.Invoke(value.Value.Code);
|
||||
}
|
||||
|
||||
public string? Validate()
|
||||
{
|
||||
if (DefaultMaxTurns < 1 || DefaultMaxTurns > 200)
|
||||
|
||||
@@ -30,8 +30,8 @@ public sealed partial class PrimeClaudeTabViewModel : ViewModelBase
|
||||
{
|
||||
foreach (var r in Rows)
|
||||
{
|
||||
if (r.StartDate > r.EndDate)
|
||||
return $"Schedule {r.TimeOfDay:hh\\:mm}: start date is after end date.";
|
||||
if (r.DaysMask() == 0)
|
||||
return $"Schedule {r.TimeOfDay:hh\\:mm}: select at least one day.";
|
||||
if (r.TimeOfDay < TimeSpan.Zero || r.TimeOfDay >= TimeSpan.FromDays(1))
|
||||
return "Time must be between 00:00 and 23:59.";
|
||||
}
|
||||
@@ -52,13 +52,10 @@ public sealed partial class PrimeClaudeTabViewModel : ViewModelBase
|
||||
[RelayCommand]
|
||||
private void AddSchedule()
|
||||
{
|
||||
var today = DateOnly.FromDateTime(DateTime.Today);
|
||||
var dto = new PrimeScheduleDto(
|
||||
Id: Guid.NewGuid(),
|
||||
StartDate: today,
|
||||
EndDate: today.AddDays(30),
|
||||
Days: 31, // Mon–Fri
|
||||
TimeOfDay: new TimeSpan(7, 0, 0),
|
||||
WorkdaysOnly: true,
|
||||
Enabled: true,
|
||||
LastRunAt: null,
|
||||
PromptOverride: null);
|
||||
|
||||
@@ -5,14 +5,20 @@ namespace ClaudeDo.Ui.ViewModels.Modals.Settings;
|
||||
|
||||
public sealed partial class PrimeScheduleRowViewModel : ViewModelBase
|
||||
{
|
||||
private const int Mon = 1, Tue = 2, Wed = 4, Thu = 8, Fri = 16, Sat = 32, Sun = 64;
|
||||
|
||||
public Guid Id { get; }
|
||||
public bool IsExisting { get; }
|
||||
|
||||
[ObservableProperty] private bool _enabled;
|
||||
[ObservableProperty] private DateOnly _startDate;
|
||||
[ObservableProperty] private DateOnly _endDate;
|
||||
[ObservableProperty] private bool _monday;
|
||||
[ObservableProperty] private bool _tuesday;
|
||||
[ObservableProperty] private bool _wednesday;
|
||||
[ObservableProperty] private bool _thursday;
|
||||
[ObservableProperty] private bool _friday;
|
||||
[ObservableProperty] private bool _saturday;
|
||||
[ObservableProperty] private bool _sunday;
|
||||
[ObservableProperty] private TimeSpan _timeOfDay;
|
||||
[ObservableProperty] private bool _workdaysOnly;
|
||||
[ObservableProperty] private DateTimeOffset? _lastRunAt;
|
||||
|
||||
public string LastRunLabel => LastRunAt is { } v ? v.LocalDateTime.ToString("g") : "—";
|
||||
@@ -24,13 +30,30 @@ public sealed partial class PrimeScheduleRowViewModel : ViewModelBase
|
||||
Id = dto.Id;
|
||||
IsExisting = isExisting;
|
||||
Enabled = dto.Enabled;
|
||||
StartDate = dto.StartDate;
|
||||
EndDate = dto.EndDate;
|
||||
Monday = (dto.Days & Mon) != 0;
|
||||
Tuesday = (dto.Days & Tue) != 0;
|
||||
Wednesday = (dto.Days & Wed) != 0;
|
||||
Thursday = (dto.Days & Thu) != 0;
|
||||
Friday = (dto.Days & Fri) != 0;
|
||||
Saturday = (dto.Days & Sat) != 0;
|
||||
Sunday = (dto.Days & Sun) != 0;
|
||||
TimeOfDay = dto.TimeOfDay;
|
||||
WorkdaysOnly = dto.WorkdaysOnly;
|
||||
LastRunAt = dto.LastRunAt;
|
||||
}
|
||||
|
||||
public int DaysMask()
|
||||
{
|
||||
int m = 0;
|
||||
if (Monday) m |= Mon;
|
||||
if (Tuesday) m |= Tue;
|
||||
if (Wednesday) m |= Wed;
|
||||
if (Thursday) m |= Thu;
|
||||
if (Friday) m |= Fri;
|
||||
if (Saturday) m |= Sat;
|
||||
if (Sunday) m |= Sun;
|
||||
return m;
|
||||
}
|
||||
|
||||
public PrimeScheduleDto ToDto() =>
|
||||
new(Id, StartDate, EndDate, TimeOfDay, WorkdaysOnly, Enabled, LastRunAt, null);
|
||||
new(Id, DaysMask(), TimeOfDay, Enabled, LastRunAt, null);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.IO;
|
||||
using ClaudeDo.Ui.Localization;
|
||||
using ClaudeDo.Ui.Services;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
@@ -43,7 +44,7 @@ public sealed partial class WorktreesSettingsTabViewModel : ViewModelBase
|
||||
try
|
||||
{
|
||||
var r = await _worker.CleanupFinishedWorktreesAsync();
|
||||
StatusMessage = r is null ? "Worker offline." : $"Removed {r.Removed} worktree(s).";
|
||||
StatusMessage = r is null ? Loc.T("vm.worktreesTab.workerOffline") : Loc.T("vm.worktreesTab.removed", r.Removed);
|
||||
}
|
||||
finally { IsBusy = false; }
|
||||
}
|
||||
@@ -58,9 +59,9 @@ public sealed partial class WorktreesSettingsTabViewModel : ViewModelBase
|
||||
try
|
||||
{
|
||||
var r = await _worker.ResetAllWorktreesAsync();
|
||||
if (r is null) StatusMessage = "Worker offline.";
|
||||
else if (r.Blocked) StatusMessage = $"Cannot force-remove: {r.RunningTasks} task(s) still running. Cancel them first.";
|
||||
else StatusMessage = $"Removed {r.Removed} worktree(s) from {r.TasksAffected} task(s).";
|
||||
if (r is null) StatusMessage = Loc.T("vm.worktreesTab.workerOffline");
|
||||
else if (r.Blocked) StatusMessage = Loc.T("vm.worktreesTab.blocked", r.RunningTasks);
|
||||
else StatusMessage = Loc.T("vm.worktreesTab.removedFrom", r.Removed, r.TasksAffected);
|
||||
}
|
||||
finally { IsBusy = false; }
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using System.Linq;
|
||||
using ClaudeDo.Data;
|
||||
using ClaudeDo.Localization;
|
||||
using ClaudeDo.Ui.Localization;
|
||||
using ClaudeDo.Ui.Services;
|
||||
using ClaudeDo.Ui.ViewModels.Modals.Settings;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
@@ -21,10 +24,15 @@ public sealed partial class SettingsModalViewModel : ViewModelBase
|
||||
|
||||
public Action? CloseAction { get; set; }
|
||||
|
||||
public SettingsModalViewModel(WorkerClient worker, PrimeClaudeTabViewModel prime)
|
||||
public SettingsModalViewModel(WorkerClient worker, PrimeClaudeTabViewModel prime,
|
||||
ILocalizer localizer, AppSettings appSettings)
|
||||
{
|
||||
_worker = worker;
|
||||
General = new GeneralSettingsTabViewModel();
|
||||
General = new GeneralSettingsTabViewModel(localizer, code =>
|
||||
{
|
||||
appSettings.Language = code;
|
||||
appSettings.Save();
|
||||
});
|
||||
Worktrees = new WorktreesSettingsTabViewModel(worker);
|
||||
Files = new FilesSettingsTabViewModel(worker);
|
||||
Prime = prime;
|
||||
@@ -47,8 +55,13 @@ 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 is >= 0 and <= 6 ? dto.StandupWeekday : (int)DayOfWeek.Wednesday;
|
||||
}
|
||||
else StatusMessage = "Worker offline — settings read-only.";
|
||||
else StatusMessage = Loc.T("vm.settingsModal.workerOffline");
|
||||
|
||||
await Prime.LoadAsync();
|
||||
}
|
||||
@@ -74,12 +87,16 @@ 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();
|
||||
}
|
||||
catch (Exception ex) { StatusMessage = $"Save failed: {ex.Message}"; }
|
||||
catch (Exception ex) { StatusMessage = Loc.T("vm.settingsModal.saveFailed", ex.Message); }
|
||||
finally { IsBusy = false; }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
using ClaudeDo.Ui.Localization;
|
||||
using ClaudeDo.Ui.Services;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
|
||||
namespace ClaudeDo.Ui.ViewModels.Modals;
|
||||
|
||||
public sealed partial class WeeklyReportModalViewModel : ViewModelBase
|
||||
{
|
||||
private readonly IWorkerClient _worker;
|
||||
|
||||
public WeeklyReportModalViewModel(IWorkerClient worker) => _worker = worker;
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(HasReport))]
|
||||
[NotifyPropertyChangedFor(nameof(EmptyStateVisible))]
|
||||
private string? _reportMarkdown;
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(EmptyStateVisible))]
|
||||
[NotifyCanExecuteChangedFor(nameof(GenerateCommand))]
|
||||
private bool _isBusy;
|
||||
|
||||
[ObservableProperty] private DateTime? _startDate;
|
||||
[ObservableProperty] private DateTime? _endDate;
|
||||
[ObservableProperty] private string _statusMessage = "";
|
||||
|
||||
public bool HasReport => !string.IsNullOrWhiteSpace(ReportMarkdown);
|
||||
public bool EmptyStateVisible => !HasReport && !IsBusy;
|
||||
|
||||
public Action? CloseAction { get; set; }
|
||||
[RelayCommand] private void Close() => CloseAction?.Invoke();
|
||||
|
||||
public static (DateOnly Start, DateOnly End) DefaultRange(DayOfWeek standup, DateOnly today)
|
||||
{
|
||||
int diff = ((int)today.DayOfWeek - (int)standup + 7) % 7;
|
||||
if (diff == 0) diff = 7;
|
||||
return (today.AddDays(-diff), today);
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
{
|
||||
var standup = DayOfWeek.Wednesday;
|
||||
var settings = await _worker.GetAppSettingsAsync();
|
||||
if (settings is not null && settings.StandupWeekday is >= 0 and <= 6)
|
||||
standup = (DayOfWeek)settings.StandupWeekday;
|
||||
|
||||
var (start, end) = DefaultRange(standup, DateOnly.FromDateTime(DateTime.Today));
|
||||
StartDate = start.ToDateTime(TimeOnly.MinValue);
|
||||
EndDate = end.ToDateTime(TimeOnly.MinValue);
|
||||
await LoadStoredAsync();
|
||||
}
|
||||
|
||||
partial void OnStartDateChanged(DateTime? value) => _ = LoadStoredAsync();
|
||||
partial void OnEndDateChanged(DateTime? value) => _ = LoadStoredAsync();
|
||||
|
||||
private bool RangeValid => StartDate is not null && EndDate is not null && StartDate <= EndDate;
|
||||
|
||||
private async Task LoadStoredAsync()
|
||||
{
|
||||
if (!RangeValid) return;
|
||||
StatusMessage = "";
|
||||
try
|
||||
{
|
||||
ReportMarkdown = await _worker.GetWeekReportAsync(
|
||||
DateOnly.FromDateTime(StartDate!.Value), DateOnly.FromDateTime(EndDate!.Value));
|
||||
}
|
||||
catch (Exception ex) { StatusMessage = ex.Message; }
|
||||
}
|
||||
|
||||
private bool CanGenerate() => !IsBusy;
|
||||
|
||||
[RelayCommand(CanExecute = nameof(CanGenerate))]
|
||||
private async Task Generate()
|
||||
{
|
||||
if (!RangeValid) { StatusMessage = Loc.T("vm.weeklyReport.invalidRange"); return; }
|
||||
IsBusy = true;
|
||||
StatusMessage = Loc.T("vm.weeklyReport.generating");
|
||||
try
|
||||
{
|
||||
ReportMarkdown = await _worker.GenerateWeekReportAsync(
|
||||
DateOnly.FromDateTime(StartDate!.Value), DateOnly.FromDateTime(EndDate!.Value));
|
||||
StatusMessage = "";
|
||||
}
|
||||
catch (Exception ex) { StatusMessage = Loc.T("vm.weeklyReport.error", ex.Message); }
|
||||
finally { IsBusy = false; }
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user