From 46ac3fc93035cbb7ab76d166f5967f319021622f Mon Sep 17 00:00:00 2001 From: mika kuns Date: Wed, 3 Jun 2026 16:36:25 +0200 Subject: [PATCH] feat(daily-prep): add Prepare-day button to MyDay header --- src/ClaudeDo.Localization/locales/de.json | 1 + src/ClaudeDo.Localization/locales/en.json | 1 + .../ViewModels/Islands/TasksIslandViewModel.cs | 10 ++++++++++ src/ClaudeDo.Ui/Views/Islands/TasksIslandView.axaml | 8 ++++++++ 4 files changed, 20 insertions(+) diff --git a/src/ClaudeDo.Localization/locales/de.json b/src/ClaudeDo.Localization/locales/de.json index 58aa72c..10fc822 100644 --- a/src/ClaudeDo.Localization/locales/de.json +++ b/src/ClaudeDo.Localization/locales/de.json @@ -67,6 +67,7 @@ "addPlaceholder": "Aufgabe hinzufügen…", "enterKey": "ENTER", "notesPinnedRow": "Notizen (Tagesnotizen)", + "prepareDay": "Tag vorbereiten", "overdue": "ÜBERFÄLLIG", "tasks": "AUFGABEN", "clearCompletedTip": "Alle abgeschlossenen löschen", diff --git a/src/ClaudeDo.Localization/locales/en.json b/src/ClaudeDo.Localization/locales/en.json index fddf5e2..ea4a852 100644 --- a/src/ClaudeDo.Localization/locales/en.json +++ b/src/ClaudeDo.Localization/locales/en.json @@ -67,6 +67,7 @@ "addPlaceholder": "Add a task…", "enterKey": "ENTER", "notesPinnedRow": "Notes (daily notes)", + "prepareDay": "Prepare day", "overdue": "OVERDUE", "tasks": "TASKS", "clearCompletedTip": "Clear all completed", diff --git a/src/ClaudeDo.Ui/ViewModels/Islands/TasksIslandViewModel.cs b/src/ClaudeDo.Ui/ViewModels/Islands/TasksIslandViewModel.cs index ac2bdd6..fa65b95 100644 --- a/src/ClaudeDo.Ui/ViewModels/Islands/TasksIslandViewModel.cs +++ b/src/ClaudeDo.Ui/ViewModels/Islands/TasksIslandViewModel.cs @@ -36,6 +36,14 @@ public sealed partial class TasksIslandViewModel : ViewModelBase NotesRequested?.Invoke(); } + [RelayCommand] + private async Task PrepareDayAsync() + { + if (_worker is null) return; + try { await _worker.RunDailyPrepNowAsync(); } + catch { /* worker offline; broadcast will reconcile on return */ } + } + public ObservableCollection Items { get; } = new(); public ObservableCollection OverdueItems { get; } = new(); public ObservableCollection OpenItems { get; } = new(); @@ -55,6 +63,7 @@ public sealed partial class TasksIslandViewModel : ViewModelBase [ObservableProperty] private bool _showOpenLabel; [ObservableProperty] private string _completedHeader = ""; [ObservableProperty] private bool _showNotesRow; + [ObservableProperty] private bool _isMyDayList; public Func? ShowUnfinishedPlanningModal { get; set; } @@ -201,6 +210,7 @@ public sealed partial class TasksIslandViewModel : ViewModelBase HeaderTitle = list.Name; HeaderEyebrow = DateTime.Now.ToString("dddd · MMM dd", CultureInfo.InvariantCulture).ToUpperInvariant(); ShowNotesRow = list.Id == "smart:my-day"; + IsMyDayList = list.Id == "smart:my-day"; _ = LoadForListAsync(list, ct); } diff --git a/src/ClaudeDo.Ui/Views/Islands/TasksIslandView.axaml b/src/ClaudeDo.Ui/Views/Islands/TasksIslandView.axaml index 15bd25b..020d4fe 100644 --- a/src/ClaudeDo.Ui/Views/Islands/TasksIslandView.axaml +++ b/src/ClaudeDo.Ui/Views/Islands/TasksIslandView.axaml @@ -74,6 +74,14 @@ Command="{Binding OpenNotesCommand}" Content="{loc:Tr tasks.notesPinnedRow}"/> + +