feat(daily-prep): trigger planning from inside the prep-log window with an empty-state hint

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
mika kuns
2026-06-04 10:01:27 +02:00
parent 26758b6e8a
commit 7d743f17c6
9 changed files with 55 additions and 36 deletions

View File

@@ -66,7 +66,6 @@
"addPlaceholder": "Aufgabe hinzufügen…",
"enterKey": "ENTER",
"notesPinnedRow": "Notizen (Tagesnotizen)",
"prepareDay": "Tag vorbereiten",
"clearDayTip": "Tag leeren",
"prepLogTip": "Vorbereitungs-Log",
"overdue": "ÜBERFÄLLIG",
@@ -140,7 +139,9 @@
"previewBtn": "Vorschau",
"editBtn": "Bearbeiten",
"descriptionPlaceholder": "Aufgabendetails hinzufügen (Markdown unterstützt)...",
"prepTitle": "Tagesvorbereitung"
"prepTitle": "Tagesvorbereitung",
"planDay": "Tag planen",
"prepEmpty": "Heute noch keine Vorbereitung — klick Tag planen"
},
"agent": {
"stopTip": "Agent stoppen",

View File

@@ -66,7 +66,6 @@
"addPlaceholder": "Add a task…",
"enterKey": "ENTER",
"notesPinnedRow": "Notes (daily notes)",
"prepareDay": "Prepare day",
"clearDayTip": "Clear day",
"prepLogTip": "Prep log",
"overdue": "OVERDUE",
@@ -140,7 +139,9 @@
"previewBtn": "Preview",
"editBtn": "Edit",
"descriptionPlaceholder": "Add task details (markdown supported)...",
"prepTitle": "Daily prep"
"prepTitle": "Daily prep",
"planDay": "Plan day",
"prepEmpty": "No prep run today yet — click Plan day"
},
"agent": {
"stopTip": "Stop agent",

View File

@@ -346,6 +346,8 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase
RecomputeCanMergeAll();
ReviewCombinedDiffCommand.NotifyCanExecuteChanged();
};
PrepLog.CollectionChanged += (_, _) => OnPropertyChanged(nameof(ShowPrepEmptyState));
}
private void OnTaskMessage(string taskId, string line)
@@ -381,6 +383,18 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase
AppendClaudeText(formatted, target, buf);
}
[RelayCommand]
private async Task PlanDayAsync()
{
if (_worker is null) return;
try { await _worker.RunDailyPrepNowAsync(); }
catch { /* worker offline; PrepStarted/PrepLine will reconcile */ }
}
public bool ShowPrepEmptyState => !IsPrepRunning && PrepLog.Count == 0;
partial void OnIsPrepRunningChanged(bool value) => OnPropertyChanged(nameof(ShowPrepEmptyState));
private void OnPrepStarted()
{
PrepLog.Clear();

View File

@@ -37,15 +37,6 @@ public sealed partial class TasksIslandViewModel : ViewModelBase
NotesRequested?.Invoke();
}
[RelayCommand]
private async Task PrepareDayAsync()
{
if (_worker is null) return;
PrepRequested?.Invoke();
try { await _worker.RunDailyPrepNowAsync(); }
catch { /* worker offline; broadcast will reconcile on return */ }
}
[RelayCommand]
private void ShowPrepLog() => PrepRequested?.Invoke();

View File

@@ -303,9 +303,23 @@
<islands:NotesEditorView DataContext="{Binding Notes}"/>
</Panel>
<Panel IsVisible="{Binding IsPrepMode}">
<islands:SessionTerminalView
Entries="{Binding PrepLog}" Label="daily-prep"
IsRunning="{Binding IsPrepRunning}"/>
<DockPanel>
<Border DockPanel.Dock="Top" Padding="12,8">
<Button Classes="btn primary"
Command="{Binding PlanDayCommand}"
IsEnabled="{Binding !IsPrepRunning}"
Content="{loc:Tr details.planDay}"/>
</Border>
<Panel>
<islands:SessionTerminalView
Entries="{Binding PrepLog}" Label="daily-prep"
IsRunning="{Binding IsPrepRunning}"/>
<TextBlock IsVisible="{Binding ShowPrepEmptyState}"
HorizontalAlignment="Center" VerticalAlignment="Center"
Foreground="{DynamicResource TextMuteBrush}"
Text="{loc:Tr details.prepEmpty}"/>
</Panel>
</DockPanel>
</Panel>
</Grid>

View File

@@ -79,14 +79,6 @@
Command="{Binding OpenNotesCommand}"
Content="{loc:Tr tasks.notesPinnedRow}"/>
<!-- Prepare Day button (My Day only) -->
<Button DockPanel.Dock="Top"
Classes="btn" HorizontalAlignment="Stretch" HorizontalContentAlignment="Left"
Margin="16,0,16,8"
IsVisible="{Binding IsMyDayList}"
Command="{Binding PrepareDayCommand}"
Content="{loc:Tr tasks.prepareDay}"/>
<!-- Task list -->
<ScrollViewer>
<StackPanel Margin="10,4">