feat(ui): confirm main-window close when Mission Control sessions are open
Closing the main window used to silently kill every open Mission Control ConPTY session (App's ShutdownMode.OnMainWindowClose tears the process down without warning). Intercept Window.Closing, and when at least one pane is open, ask via the existing ConfirmAsync pattern before proceeding; cancelling leaves the window and sessions alive, confirming force-closes as before.
This commit is contained in:
@@ -520,6 +520,16 @@ public sealed partial class IslandsShellViewModel : ViewModelBase, IDisposable
|
||||
Dialogs.ShowMissionControl(MissionControl);
|
||||
}
|
||||
|
||||
/// <summary>Number of Mission Control ConPTY panes currently open — the main window's
|
||||
/// close guard asks for confirmation whenever this is greater than zero.</summary>
|
||||
public int OpenMissionControlSessionCount => MissionControl?.ConPtySessions.Count ?? 0;
|
||||
|
||||
// Pure decision extracted for testability — closing the main window kills every open
|
||||
// Mission Control pane's `claude` process (ConPtyPaneViewModel.Dispose), so ask first
|
||||
// rather than let it happen silently.
|
||||
internal static bool RequiresCloseConfirmation(int openMissionControlSessionCount) =>
|
||||
openMissionControlSessionCount > 0;
|
||||
|
||||
private void SyncInteractiveSessionChips()
|
||||
{
|
||||
if (MissionControl is null || Tasks is null) return;
|
||||
|
||||
Reference in New Issue
Block a user