From 9b1178ca2f03fbed212d6ffbc7f26248efaf84c0 Mon Sep 17 00:00:00 2001 From: mika kuns Date: Mon, 20 Apr 2026 11:39:40 +0200 Subject: [PATCH] style(ui): subtasks, notes, details metadata footer Co-Authored-By: Claude Sonnet 4.6 --- src/ClaudeDo.Ui/Design/IslandStyles.axaml | 21 +++ .../Islands/DetailsIslandViewModel.cs | 34 +++++ .../ViewModels/Islands/TaskRowViewModel.cs | 4 + .../Views/Islands/DetailsIslandView.axaml | 122 +++++++++++++----- .../Views/Islands/DetailsIslandView.axaml.cs | 7 + 5 files changed, 158 insertions(+), 30 deletions(-) diff --git a/src/ClaudeDo.Ui/Design/IslandStyles.axaml b/src/ClaudeDo.Ui/Design/IslandStyles.axaml index 36b4da8..bbf0438 100644 --- a/src/ClaudeDo.Ui/Design/IslandStyles.axaml +++ b/src/ClaudeDo.Ui/Design/IslandStyles.axaml @@ -759,6 +759,27 @@ + + + + + + + diff --git a/src/ClaudeDo.Ui/ViewModels/Islands/DetailsIslandViewModel.cs b/src/ClaudeDo.Ui/ViewModels/Islands/DetailsIslandViewModel.cs index 3c39a2b..dcfe566 100644 --- a/src/ClaudeDo.Ui/ViewModels/Islands/DetailsIslandViewModel.cs +++ b/src/ClaudeDo.Ui/ViewModels/Islands/DetailsIslandViewModel.cs @@ -66,6 +66,12 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase private CancellationTokenSource? _loadCts; + // Set by shell so CloseDetailCommand can clear SelectedTask + public Action? CloseDetail { get; set; } + + // Set by shell so DeleteTaskCommand can remove from list + public Func? DeleteFromList { get; set; } + // Set by the view so OpenDiffCommand can show the modal as a dialog public Func? ShowDiffModal { get; set; } @@ -198,6 +204,34 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase await System.Threading.Tasks.Task.CompletedTask; } + [RelayCommand] + private void CloseDetails() => CloseDetail?.Invoke(); + + [RelayCommand] + private async System.Threading.Tasks.Task DeleteTaskAsync() + { + if (Task == null) return; + var row = Task; + await using var ctx = _dbFactory.CreateDbContext(); + var repo = new TaskRepository(ctx); + await repo.DeleteAsync(row.Id); + if (DeleteFromList != null) + await DeleteFromList(row); + CloseDetail?.Invoke(); + } + + [RelayCommand] + private async System.Threading.Tasks.Task SaveNotesAsync() + { + if (Task == null) return; + await using var ctx = _dbFactory.CreateDbContext(); + var repo = new TaskRepository(ctx); + var entity = await repo.GetByIdAsync(Task.Id); + if (entity == null) return; + entity.Notes = Notes; + await repo.UpdateAsync(entity); + } + [RelayCommand] private async System.Threading.Tasks.Task ApproveMergeAsync() { diff --git a/src/ClaudeDo.Ui/ViewModels/Islands/TaskRowViewModel.cs b/src/ClaudeDo.Ui/ViewModels/Islands/TaskRowViewModel.cs index 5f56782..4010c3d 100644 --- a/src/ClaudeDo.Ui/ViewModels/Islands/TaskRowViewModel.cs +++ b/src/ClaudeDo.Ui/ViewModels/Islands/TaskRowViewModel.cs @@ -22,6 +22,9 @@ public sealed partial class TaskRowViewModel : ViewModelBase [ObservableProperty] private int _diffAdditions; [ObservableProperty] private int _diffDeletions; + public DateTime CreatedAt { get; init; } + public string CreatedAtFormatted => CreatedAt == default ? "—" : $"Created {CreatedAt:MMM d}"; + public IReadOnlyList Tags { get; init; } = Array.Empty(); public int StepsCount { get; init; } public int StepsCompleted { get; init; } @@ -78,6 +81,7 @@ public sealed partial class TaskRowViewModel : ViewModelBase ScheduledFor = t.ScheduledFor, DiffAdditions = add, DiffDeletions = del, + CreatedAt = t.CreatedAt, }; } diff --git a/src/ClaudeDo.Ui/Views/Islands/DetailsIslandView.axaml b/src/ClaudeDo.Ui/Views/Islands/DetailsIslandView.axaml index c4a5114..96e7746 100644 --- a/src/ClaudeDo.Ui/Views/Islands/DetailsIslandView.axaml +++ b/src/ClaudeDo.Ui/Views/Islands/DetailsIslandView.axaml @@ -5,11 +5,43 @@ x:Class="ClaudeDo.Ui.Views.Islands.DetailsIslandView" x:DataType="vm:DetailsIslandViewModel"> + + + + + + + + + + + + + - - - + + + @@ -17,33 +49,29 @@ FontFamily="{DynamicResource MonoFont}" FontSize="10" Foreground="{DynamicResource TextFaintBrush}" VerticalAlignment="Center" - HorizontalAlignment="Right" Margin="8,0,0,0"/> - - + - + - + - - -