fix(claude-do): Fix: Statuswechsel schlägt in Task-Row und Detail-Pane erst

## Problem (vom Nutzer bestätigt am 2026-08-05)
Wechselt ein Task den Status, bleiben zwei Stellen stehen, bis man die Liste wechselt und zurückwechselt:

1. **Task-Row in der offenen Liste** (mittlere Insel) — Status-Chip und Gruppen-Einordnung aktualisieren sich nicht.
2. **Detail-Pane des ausgewählten Tasks** (rechte Insel) — Status, Review-Buttons und Header-Bar zeigen weiter den alten Zustand

ClaudeDo-Task: 181d4abf368046b99bd57d5e2a7ab97a
This commit is contained in:
mika kuns
2026-08-05 09:19:10 +02:00
parent 63d8b5c28d
commit 3a07b319f9
4 changed files with 274 additions and 3 deletions
@@ -237,6 +237,12 @@ public sealed partial class TasksIslandViewModel : ViewModelBase, IDisposable
// the selection so a live update never yanks the detail pane away.
var listChanged = !string.Equals(_currentList?.Id, list?.Id, StringComparison.Ordinal);
// A same-list reload (triggered by OnWorkerTaskUpdated's full-reload branches) rebuilds
// every row from scratch. Reusing the previous instances by id — instead of handing back
// brand new ones — keeps SelectedTask (and the bound DetailsIslandViewModel.Task) pointed
// at a live row instead of an orphan that never receives another update.
var reusable = listChanged ? null : Items.ToDictionary(r => r.Id);
if (_currentList is not null)
_currentList.PropertyChanged -= OnCurrentListPropertyChanged;
_currentList = list;
@@ -261,10 +267,11 @@ public sealed partial class TasksIslandViewModel : ViewModelBase, IDisposable
IsMyDayList = list.Id == "smart:my-day";
IsLetClaudeVisible = list.Kind == ListKind.User && !string.IsNullOrWhiteSpace(list.WorkingDir);
LoadTask = LoadForListAsync(list, ct);
LoadTask = LoadForListAsync(list, ct, reusable);
}
private async Task LoadForListAsync(ListNavItemViewModel list, CancellationToken ct)
private async Task LoadForListAsync(
ListNavItemViewModel list, CancellationToken ct, Dictionary<string, TaskRowViewModel>? reusable)
{
try
{
@@ -292,7 +299,16 @@ public sealed partial class TasksIslandViewModel : ViewModelBase, IDisposable
var showListChip = list.Kind == ListKind.Virtual;
foreach (var t in filteredList)
{
var row = TaskRowViewModel.FromEntity(t);
TaskRowViewModel row;
if (reusable is not null && reusable.TryGetValue(t.Id, out var existing))
{
row = existing;
row.UpdateFromEntity(t);
}
else
{
row = TaskRowViewModel.FromEntity(t);
}
row.ShowListChip = showListChip;
row.HasInteractiveSession = _interactiveSessionIds.Contains(row.Id);
Items.Add(row);