feat(worker): report worktree-creation phase on OperationProgress
Fills the silent gap between Queued and the first agent output: WorktreeManager now broadcasts a "creating_worktree" phase (before the initial git worktree add and again for the self-heal retry section) through the existing OperationProgress channel, and the task row shows it via the pre-existing but unused ops.worker.creatingWorktree locale key until the next entity refresh clears it. Confirmed the 2026-08-07 triage finding still holds: TaskRunner already broadcasts WorktreeUpdated right after WorktreeManager.CreateAsync (TaskRunner.cs:342-346, :501) -- no second broadcast added there.
This commit is contained in:
@@ -188,6 +188,7 @@ public sealed partial class TasksIslandViewModel : ViewModelBase, IDisposable
|
||||
_worker.ConnectionRestoredEvent += () => LoadForList(_currentList);
|
||||
_worker.RefineStartedEvent += OnRefineStarted;
|
||||
_worker.RefineFinishedEvent += OnRefineFinished;
|
||||
_worker.OperationProgressEvent += OnWorkerOperationProgress;
|
||||
}
|
||||
_langChangedHandler = (_, _) => RefreshLocalizedText();
|
||||
Loc.LanguageChanged += _langChangedHandler;
|
||||
@@ -1563,6 +1564,18 @@ public sealed partial class TasksIslandViewModel : ViewModelBase, IDisposable
|
||||
if (row is not null) row.IsRefining = false;
|
||||
}
|
||||
|
||||
// OperationProgress is a generic channel shared with merge phases (TaskMergeService), whose
|
||||
// opKey is also the task id — filter on the phase token so a merge in flight can't clobber
|
||||
// this row's creation-phase banner.
|
||||
private const string CreationPhaseCreatingWorktree = "creating_worktree";
|
||||
|
||||
private void OnWorkerOperationProgress(string opKey, string phase, int current, int total)
|
||||
{
|
||||
if (phase != CreationPhaseCreatingWorktree) return;
|
||||
var row = Items.FirstOrDefault(r => r.Id == opKey);
|
||||
if (row is not null) row.CreationPhase = phase;
|
||||
}
|
||||
|
||||
partial void OnSelectedTaskChanged(TaskRowViewModel? value)
|
||||
{
|
||||
foreach (var i in Items) i.IsSelected = ReferenceEquals(i, value);
|
||||
|
||||
Reference in New Issue
Block a user