From 53d897aff4547f93e6c393e92a97a2ab113bf6f3 Mon Sep 17 00:00:00 2001 From: mika kuns Date: Thu, 4 Jun 2026 10:02:29 +0200 Subject: [PATCH] docs(daily-prep): add plan-day-in-log-window plan Co-Authored-By: Claude Opus 4.7 --- .../2026-06-04-plan-day-in-log-window.md | 120 ++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 docs/superpowers/plans/2026-06-04-plan-day-in-log-window.md diff --git a/docs/superpowers/plans/2026-06-04-plan-day-in-log-window.md b/docs/superpowers/plans/2026-06-04-plan-day-in-log-window.md new file mode 100644 index 0000000..9c65510 --- /dev/null +++ b/docs/superpowers/plans/2026-06-04-plan-day-in-log-window.md @@ -0,0 +1,120 @@ +# Move "Plan day" into the Prep-Log Window — Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: superpowers:subagent-driven-development. Steps use `- [ ]`. + +**Goal:** Guard daily-prep planning behind a second click. The MyDay header's full-width "Tag vorbereiten" button is removed; instead the user opens the prep-log window (list icon), sees the last run or an empty-state hint, and clicks a **"Plan day"** button inside that window to run the prep. + +**Approved flow:** Header list-icon (`ShowPrepLogCommand`) opens the prep window → if empty, an empty-state hint shows → "Plan day" button in the window runs `RunDailyPrepNowAsync()`. + +**Tech:** Avalonia + CommunityToolkit.Mvvm, xUnit. + +## Build/test +```bash +dotnet build src/ClaudeDo.App/ClaudeDo.App.csproj -c Release +dotnet test tests/ClaudeDo.Ui.Tests/ClaudeDo.Ui.Tests.csproj -c Release +dotnet test tests/ClaudeDo.Localization.Tests/ClaudeDo.Localization.Tests.csproj -c Release +``` +GUI not headlessly verifiable — note it; human verifies visuals. + +--- + +## Task: relocate planning trigger + empty-state + +**Files:** +- Modify: `src/ClaudeDo.Ui/ViewModels/Islands/TasksIslandViewModel.cs` (remove PrepareDay) +- Modify: `src/ClaudeDo.Ui/Views/Islands/TasksIslandView.axaml` (remove header button) +- Modify: `src/ClaudeDo.Ui/ViewModels/Islands/DetailsIslandViewModel.cs` (PlanDayCommand + empty-state) +- Modify: `src/ClaudeDo.Ui/Views/Islands/DetailsIslandView.axaml` (prep panel toolbar + empty hint) +- Modify: `src/ClaudeDo.Localization/locales/en.json`, `de.json` +- Test: `tests/ClaudeDo.Ui.Tests/ViewModels/DetailsIslandPrepModeTests.cs`, and the existing `TasksIslandDailyPrepTests.cs` (remove the obsolete prepare test) + +- [ ] **Step 1: Write/adjust tests first.** + - In `DetailsIslandPrepModeTests.cs` add: + ```csharp + [Fact] + public async Task PlanDayCommand_calls_worker() + { + var stub = new StubWorkerClient(); + var vm = NewDetailsVm(stub); + await vm.PlanDayCommand.ExecuteAsync(null); + Assert.Equal(1, stub.RunDailyPrepNowCalls); + } + + [Fact] + public void ShowPrepEmptyState_true_when_empty_and_not_running() + { + var vm = NewDetailsVm(new StubWorkerClient()); + Assert.True(vm.ShowPrepEmptyState); + } + ``` + `StubWorkerClient` needs a `RunDailyPrepNowCalls` counter incremented in `RunDailyPrepNowAsync` (add if missing; it currently likely returns `Task.FromResult(true)` — keep that and bump a counter). + - In `TasksIslandDailyPrepTests.cs` **remove** `PrepareDayCommand_raises_PrepRequested` (the command is being deleted). Keep `ClearDayCommand_calls_worker`. + +- [ ] **Step 2: Run — expect FAIL/compile error.** + +- [ ] **Step 3: `TasksIslandViewModel` — remove planning trigger.** + - Delete the `PrepareDayAsync` `[RelayCommand]` entirely. + - Keep the `PrepRequested` event and `ShowPrepLog` command (the list icon still raises `PrepRequested` to open the window). + - Grep the VM for any remaining `PrepareDay` references and remove them. + +- [ ] **Step 4: `TasksIslandView.axaml` — remove the header button.** Delete the full-width "Prepare day" `