# 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" `