diff --git a/src/ClaudeDo.Ui/ViewModels/Islands/DetailsIslandViewModel.cs b/src/ClaudeDo.Ui/ViewModels/Islands/DetailsIslandViewModel.cs index 2be5bd2..c73429d 100644 --- a/src/ClaudeDo.Ui/ViewModels/Islands/DetailsIslandViewModel.cs +++ b/src/ClaudeDo.Ui/ViewModels/Islands/DetailsIslandViewModel.cs @@ -104,15 +104,28 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase [RelayCommand] private void ToggleDescriptionExpanded() => IsDescriptionExpanded = !IsDescriptionExpanded; - // ── Description/Steps card (redesign) ────────────────────────────── - [ObservableProperty] - [NotifyPropertyChangedFor(nameof(IsDescriptionView))] - private bool _isStepsView; - - public bool IsDescriptionView => !IsStepsView; + // ── Description / Steps card (redesign) ───────────────────────────── + // Description is always the card body; steps live in an expandable summary + // strip below it so step presence is visible without switching views. + [ObservableProperty] private bool _isStepsExpanded; [RelayCommand] - private void ToggleCardView() => IsStepsView = !IsStepsView; + private void ToggleStepsExpanded() => IsStepsExpanded = !IsStepsExpanded; + + public int TotalStepCount => Subtasks.Count; + public int OpenStepCount => Subtasks.Count(s => !s.Done); + public string StepsSummary => + TotalStepCount == 0 ? "no steps yet" + : OpenStepCount == 0 ? $"all done · {TotalStepCount} total" + : $"{OpenStepCount} open · {TotalStepCount} total"; + + private void NotifyStepsChanged() + { + OnPropertyChanged(nameof(TotalStepCount)); + OnPropertyChanged(nameof(OpenStepCount)); + OnPropertyChanged(nameof(StepsSummary)); + OnPropertyChanged(nameof(ComposedPreview)); + } // The exact text handed to Claude: title + description + open steps only. public string ComposedPreview => @@ -375,7 +388,7 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase _services = services; _notesApi = notesApi; Notes = new NotesEditorViewModel(_notesApi); - Subtasks.CollectionChanged += (_, _) => OnPropertyChanged(nameof(ComposedPreview)); + Subtasks.CollectionChanged += (_, _) => NotifyStepsChanged(); Loc.LanguageChanged += (_, _) => { OnPropertyChanged(nameof(AgentStatusLabel)); @@ -1140,7 +1153,7 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase { if (row is null) return; row.Done = !row.Done; - OnPropertyChanged(nameof(ComposedPreview)); + NotifyStepsChanged(); await using var ctx = _dbFactory.CreateDbContext(); var repo = new SubtaskRepository(ctx); var subs = await repo.GetByTaskIdAsync(Task?.Id ?? ""); diff --git a/src/ClaudeDo.Ui/Views/Islands/Detail/DescriptionStepsCard.axaml b/src/ClaudeDo.Ui/Views/Islands/Detail/DescriptionStepsCard.axaml index a8459fd..ee30847 100644 --- a/src/ClaudeDo.Ui/Views/Islands/Detail/DescriptionStepsCard.axaml +++ b/src/ClaudeDo.Ui/Views/Islands/Detail/DescriptionStepsCard.axaml @@ -5,69 +5,46 @@ x:Class="ClaudeDo.Ui.Views.Islands.Detail.DescriptionStepsCard" x:DataType="vm:DetailsIslandViewModel"> - + - + - + - - - - - + - - - + - + - - - - + - - + + - - - - - - - - + + + - - + + + + + + + + + + + + + @@ -153,8 +153,10 @@ - - + + + +