feat(ui): editable task status and tags from details panel

Adds a status ComboBox in the Details header (no transition guards)
and a Tags section with chips + AutoCompleteBox. TaskRowViewModel.Tags
becomes an ObservableCollection so chip lists stay live. TasksIsland
caches AllTags for the row context menu and exposes Set/Toggle helpers.
Test fakes updated for the new IWorkerClient methods.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
mika kuns
2026-04-29 10:40:03 +02:00
parent 47b07373af
commit c1856657b5
10 changed files with 252 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using CommunityToolkit.Mvvm.ComponentModel;
using ClaudeDo.Data.Models;
using TaskStatus = ClaudeDo.Data.Models.TaskStatus;
@@ -7,6 +8,11 @@ namespace ClaudeDo.Ui.ViewModels.Islands;
public sealed partial class TaskRowViewModel : ViewModelBase
{
public TaskRowViewModel()
{
Tags.CollectionChanged += (_, _) => OnPropertyChanged(nameof(HasTags));
}
public required string Id { get; init; }
[ObservableProperty] private string _title = "";
[ObservableProperty] private string _listName = "";
@@ -33,7 +39,7 @@ public sealed partial class TaskRowViewModel : ViewModelBase
public DateTime CreatedAt { get; init; }
public string CreatedAtFormatted => CreatedAt == default ? "—" : $"Created {CreatedAt:MMM d}";
public IReadOnlyList<string> Tags { get; init; } = Array.Empty<string>();
public ObservableCollection<string> Tags { get; } = new();
public int StepsCount { get; init; }
public int StepsCompleted { get; init; }
@@ -154,6 +160,15 @@ public sealed partial class TaskRowViewModel : ViewModelBase
DiffDeletions = del;
ParentTaskId = t.ParentTaskId;
BlockedByTaskId = t.BlockedByTaskId;
SetTags(t.Tags.Select(tag => tag.Name));
}
public void SetTags(IEnumerable<string> names)
{
var snapshot = names.ToList();
if (Tags.SequenceEqual(snapshot)) return;
Tags.Clear();
foreach (var n in snapshot) Tags.Add(n);
}
// Best-effort parse of diff stat strings like "+12 -3" or "12 additions, 3 deletions".