fix(ui): Mission Control oeffnen, wenn ein Handler-Run per MCP startet oder ein Handoff eintrifft

This commit is contained in:
mika kuns
2026-09-02 22:05:34 +02:00
parent eb3aee41a4
commit b05b6fbaec
2 changed files with 8 additions and 1 deletions
@@ -329,6 +329,7 @@ public sealed partial class IslandsShellViewModel : ViewModelBase, IDisposable
UsagePill.OpenMonitorRequested += () => _ = OpenUsageMonitor(); UsagePill.OpenMonitorRequested += () => _ = OpenUsageMonitor();
MissionControl.OpenInApp = id => _ = RevealTaskAsync(id); MissionControl.OpenInApp = id => _ = RevealTaskAsync(id);
MissionControl.OpenSettingsRequested = () => Lists.OpenSettingsCommand.Execute(null); MissionControl.OpenSettingsRequested = () => Lists.OpenSettingsCommand.Execute(null);
MissionControl.OpenRequested = OpenMissionControl;
MissionControl.ErrorReported += FlashFooterError; MissionControl.ErrorReported += FlashFooterError;
// Keep the task rows' "Interactive" chip in step with Mission Control's open ConPTY panes. // Keep the task rows' "Interactive" chip in step with Mission Control's open ConPTY panes.
MissionControl.ConPtySessions.CollectionChanged += (_, _) => SyncInteractiveSessionChips(); MissionControl.ConPtySessions.CollectionChanged += (_, _) => SyncInteractiveSessionChips();
@@ -58,6 +58,11 @@ public sealed partial class MissionControlViewModel : ViewModelBase, IDisposable
// View-layer seam: open the app Settings modal from the Mission Control window. // View-layer seam: open the app Settings modal from the Mission Control window.
public Action? OpenSettingsRequested { get; set; } public Action? OpenSettingsRequested { get; set; }
// Set by the shell: bring Mission Control on screen. A ConPTY pane only launches its process once
// its view is attached, so a run started from outside the UI (start_list_handler MCP tool) or a
// handoff arriving while Mission Control is closed would otherwise sit there without a process.
public Action? OpenRequested { get; set; }
public bool HasPanes => Panes.Count > 0; public bool HasPanes => Panes.Count > 0;
// Read-only activity strip. Beyond the queue itself (Queued/Running) it also carries the rows // Read-only activity strip. Beyond the queue itself (Queued/Running) it also carries the rows
@@ -100,7 +105,7 @@ public sealed partial class MissionControlViewModel : ViewModelBase, IDisposable
_onHandoffRequested = (taskId, survivingTaskIds, nextPhase) => { _ = OpenMergeHelperHandoffConPtySessionAsync(taskId, survivingTaskIds, nextPhase); }; _onHandoffRequested = (taskId, survivingTaskIds, nextPhase) => { _ = OpenMergeHelperHandoffConPtySessionAsync(taskId, survivingTaskIds, nextPhase); };
_worker.HandoffRequestedEvent += _onHandoffRequested; _worker.HandoffRequestedEvent += _onHandoffRequested;
_onListHandlerStartRequested = (listId, taskIds) => { _ = OpenMergeHelperConPtySessionAsync(listId, taskIds); }; _onListHandlerStartRequested = (listId, taskIds) => { OpenRequested?.Invoke(); _ = OpenMergeHelperConPtySessionAsync(listId, taskIds); };
_worker.ListHandlerStartRequestedEvent += _onListHandlerStartRequested; _worker.ListHandlerStartRequestedEvent += _onListHandlerStartRequested;
_onHandlerUsageWarning = (taskId, message) => { _ = WarnHandlerSessionAsync(taskId, message); }; _onHandlerUsageWarning = (taskId, message) => { _ = WarnHandlerSessionAsync(taskId, message); };
_worker.HandlerUsageWarningEvent += _onHandlerUsageWarning; _worker.HandlerUsageWarningEvent += _onHandlerUsageWarning;
@@ -390,6 +395,7 @@ public sealed partial class MissionControlViewModel : ViewModelBase, IDisposable
string taskId, IReadOnlyList<string> survivingTaskIds, string nextPhase) string taskId, IReadOnlyList<string> survivingTaskIds, string nextPhase)
{ {
if (string.IsNullOrEmpty(taskId) || survivingTaskIds is not { Count: > 0 }) return; if (string.IsNullOrEmpty(taskId) || survivingTaskIds is not { Count: > 0 }) return;
OpenRequested?.Invoke();
foreach (var stale in ConPtySessions.Where(s => s.TaskId == taskId).ToList()) foreach (var stale in ConPtySessions.Where(s => s.TaskId == taskId).ToList())
CloseConPtySession(stale); CloseConPtySession(stale);