feat(ui): live task updates from worker events + planning polish

Wire TasksIslandViewModel to TaskUpdated/WorktreeUpdated/TaskMessage worker
events so rows refresh without a full reload; add ForegroundHelper to permit
wt.exe to take foreground on planning launch; misc UI polish on lists, task
rows and settings modal.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
mika kuns
2026-04-24 11:12:27 +02:00
parent e455d85578
commit b7c60f5838
18 changed files with 200 additions and 56 deletions

View File

@@ -101,25 +101,27 @@ public sealed partial class TaskRowViewModel : ViewModelBase
partial void OnDiffDeletionsChanged(int value) { OnPropertyChanged(nameof(HasDiff)); OnPropertyChanged(nameof(DiffDeletionsText)); }
public static TaskRowViewModel FromEntity(TaskEntity t)
{
var row = new TaskRowViewModel { Id = t.Id, CreatedAt = t.CreatedAt };
row.UpdateFromEntity(t);
return row;
}
public void UpdateFromEntity(TaskEntity t)
{
var (add, del) = ParseDiffStat(t.Worktree?.DiffStat);
return new TaskRowViewModel
{
Id = t.Id,
Title = t.Title,
ListName = t.List?.Name ?? "",
Done = t.Status == TaskStatus.Done,
IsStarred = t.IsStarred,
IsMyDay = t.IsMyDay,
Status = t.Status,
Branch = t.Worktree?.BranchName,
DiffStat = t.Worktree?.DiffStat,
ScheduledFor = t.ScheduledFor,
DiffAdditions = add,
DiffDeletions = del,
CreatedAt = t.CreatedAt,
ParentTaskId = t.ParentTaskId,
};
Title = t.Title;
ListName = t.List?.Name ?? "";
Done = t.Status == TaskStatus.Done;
IsStarred = t.IsStarred;
IsMyDay = t.IsMyDay;
Status = t.Status;
Branch = t.Worktree?.BranchName;
DiffStat = t.Worktree?.DiffStat;
ScheduledFor = t.ScheduledFor;
DiffAdditions = add;
DiffDeletions = del;
ParentTaskId = t.ParentTaskId;
}
// Best-effort parse of diff stat strings like "+12 -3" or "12 additions, 3 deletions".