feat(ui): pinned Notes row in My Day opens the notes editor
Add ShowNotesRow/OpenNotesCommand to TasksIslandViewModel; wire NotesRequested event to Details.ShowNotes() in the shell; show a Notes button above the task list when the My Day smart list is active. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -25,8 +25,16 @@ public sealed partial class TasksIslandViewModel : ViewModelBase
|
|||||||
public event EventHandler? SelectionChanged;
|
public event EventHandler? SelectionChanged;
|
||||||
public event EventHandler? FocusAddTaskRequested;
|
public event EventHandler? FocusAddTaskRequested;
|
||||||
public event EventHandler? TasksChanged;
|
public event EventHandler? TasksChanged;
|
||||||
|
public event Action? NotesRequested;
|
||||||
public void RequestFocusAddTask() => FocusAddTaskRequested?.Invoke(this, EventArgs.Empty);
|
public void RequestFocusAddTask() => FocusAddTaskRequested?.Invoke(this, EventArgs.Empty);
|
||||||
|
|
||||||
|
[RelayCommand]
|
||||||
|
private void OpenNotes()
|
||||||
|
{
|
||||||
|
SelectedTask = null;
|
||||||
|
NotesRequested?.Invoke();
|
||||||
|
}
|
||||||
|
|
||||||
public ObservableCollection<TaskRowViewModel> Items { get; } = new();
|
public ObservableCollection<TaskRowViewModel> Items { get; } = new();
|
||||||
public ObservableCollection<TaskRowViewModel> OverdueItems { get; } = new();
|
public ObservableCollection<TaskRowViewModel> OverdueItems { get; } = new();
|
||||||
public ObservableCollection<TaskRowViewModel> OpenItems { get; } = new();
|
public ObservableCollection<TaskRowViewModel> OpenItems { get; } = new();
|
||||||
@@ -45,6 +53,7 @@ public sealed partial class TasksIslandViewModel : ViewModelBase
|
|||||||
[ObservableProperty] private bool _hasCompleted;
|
[ObservableProperty] private bool _hasCompleted;
|
||||||
[ObservableProperty] private bool _showOpenLabel;
|
[ObservableProperty] private bool _showOpenLabel;
|
||||||
[ObservableProperty] private string _completedHeader = "COMPLETED";
|
[ObservableProperty] private string _completedHeader = "COMPLETED";
|
||||||
|
[ObservableProperty] private bool _showNotesRow;
|
||||||
|
|
||||||
public Func<UnfinishedPlanningModalViewModel, Task>? ShowUnfinishedPlanningModal { get; set; }
|
public Func<UnfinishedPlanningModalViewModel, Task>? ShowUnfinishedPlanningModal { get; set; }
|
||||||
|
|
||||||
@@ -176,10 +185,12 @@ public sealed partial class TasksIslandViewModel : ViewModelBase
|
|||||||
HasOpen = false;
|
HasOpen = false;
|
||||||
HasCompleted = false;
|
HasCompleted = false;
|
||||||
ShowOpenLabel = false;
|
ShowOpenLabel = false;
|
||||||
|
ShowNotesRow = false;
|
||||||
if (list is null) return;
|
if (list is null) return;
|
||||||
|
|
||||||
HeaderTitle = list.Name;
|
HeaderTitle = list.Name;
|
||||||
HeaderEyebrow = DateTime.Now.ToString("dddd · MMM dd", CultureInfo.InvariantCulture).ToUpperInvariant();
|
HeaderEyebrow = DateTime.Now.ToString("dddd · MMM dd", CultureInfo.InvariantCulture).ToUpperInvariant();
|
||||||
|
ShowNotesRow = list.Id == "smart:my-day";
|
||||||
|
|
||||||
_ = LoadForListAsync(list, ct);
|
_ = LoadForListAsync(list, ct);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -197,6 +197,7 @@ public sealed partial class IslandsShellViewModel : ViewModelBase
|
|||||||
_repoImportVmFactory = repoImportVmFactory;
|
_repoImportVmFactory = repoImportVmFactory;
|
||||||
Lists.SelectionChanged += (_, _) => Tasks.LoadForList(Lists.SelectedList);
|
Lists.SelectionChanged += (_, _) => Tasks.LoadForList(Lists.SelectedList);
|
||||||
Tasks.SelectionChanged += (_, _) => Details.Bind(Tasks.SelectedTask);
|
Tasks.SelectionChanged += (_, _) => Details.Bind(Tasks.SelectedTask);
|
||||||
|
Tasks.NotesRequested += () => Details.ShowNotes();
|
||||||
Tasks.TasksChanged += (_, _) => _ = Lists.RefreshCountsAsync();
|
Tasks.TasksChanged += (_, _) => _ = Lists.RefreshCountsAsync();
|
||||||
Tasks.OpenListSettingsRequested += (_, _) =>
|
Tasks.OpenListSettingsRequested += (_, _) =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -65,6 +65,14 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
|
<!-- Notes pinned row (My Day only) -->
|
||||||
|
<Button DockPanel.Dock="Top"
|
||||||
|
Classes="btn" HorizontalAlignment="Stretch" HorizontalContentAlignment="Left"
|
||||||
|
Margin="16,0,16,8"
|
||||||
|
IsVisible="{Binding ShowNotesRow}"
|
||||||
|
Command="{Binding OpenNotesCommand}"
|
||||||
|
Content="Notizen (Tagesnotizen)"/>
|
||||||
|
|
||||||
<!-- Task list -->
|
<!-- Task list -->
|
||||||
<ScrollViewer>
|
<ScrollViewer>
|
||||||
<StackPanel Margin="10,4">
|
<StackPanel Margin="10,4">
|
||||||
|
|||||||
Reference in New Issue
Block a user