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:
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user