refactor(tags): remove tag entity and all references

Drops TagEntity, TagRepository, and tag wiring across data layer, worker,
and UI. Adds RemoveTags migration to clean up schema.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
mika kuns
2026-05-19 08:07:24 +02:00
parent 8d34db3f9b
commit 623ebf147b
42 changed files with 333 additions and 1118 deletions

View File

@@ -1,5 +1,3 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using CommunityToolkit.Mvvm.ComponentModel;
using ClaudeDo.Data.Models;
using TaskStatus = ClaudeDo.Data.Models.TaskStatus;
@@ -8,11 +6,6 @@ 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 = "";
@@ -39,7 +32,6 @@ public sealed partial class TaskRowViewModel : ViewModelBase
public DateTime CreatedAt { get; init; }
public string CreatedAtFormatted => CreatedAt == default ? "—" : $"Created {CreatedAt:MMM d}";
public ObservableCollection<string> Tags { get; } = new();
public int StepsCount { get; init; }
public int StepsCompleted { get; init; }
@@ -62,13 +54,13 @@ public sealed partial class TaskRowViewModel : ViewModelBase
public bool HasBranch => !string.IsNullOrWhiteSpace(Branch);
public bool HasDiff => DiffAdditions > 0 || DiffDeletions > 0;
public bool HasTags => Tags.Count > 0;
public bool HasSteps => StepsCount > 0;
public bool IsOverdue => ScheduledFor is { } d && d.Date < DateTime.Today && !Done;
public bool IsRunning => Status == TaskStatus.Running;
public bool IsQueued => Status == TaskStatus.Queued && string.IsNullOrEmpty(BlockedByTaskId);
public bool IsWaiting => Status == TaskStatus.Queued && !string.IsNullOrEmpty(BlockedByTaskId);
public bool CanRemoveFromQueue => IsQueued || HasQueuedSubtasks;
public bool CanSendToQueue => !IsRunning && !IsQueued && !HasQueuedSubtasks;
public bool HasSchedule => ScheduledFor.HasValue;
public bool HasLiveTail => IsRunning && !string.IsNullOrEmpty(LiveTail);
@@ -96,6 +88,7 @@ public sealed partial class TaskRowViewModel : ViewModelBase
OnPropertyChanged(nameof(IsDraft));
OnPropertyChanged(nameof(CanOpenPlanningSession));
OnPropertyChanged(nameof(CanRemoveFromQueue));
OnPropertyChanged(nameof(CanSendToQueue));
}
partial void OnPlanningPhaseChanged(PlanningPhase value)
@@ -107,7 +100,10 @@ public sealed partial class TaskRowViewModel : ViewModelBase
}
partial void OnHasQueuedSubtasksChanged(bool value)
=> OnPropertyChanged(nameof(CanRemoveFromQueue));
{
OnPropertyChanged(nameof(CanRemoveFromQueue));
OnPropertyChanged(nameof(CanSendToQueue));
}
partial void OnBlockedByTaskIdChanged(string? value)
{
@@ -160,15 +156,6 @@ 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".