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:
mika kuns
2026-08-21 18:14:48 +02:00
parent 89d30d1463
commit 0892883a82
5 changed files with 65 additions and 0 deletions
@@ -0,0 +1,25 @@
using ClaudeDo.Ui.ViewModels;
using Xunit;
namespace ClaudeDo.Ui.Tests;
public class MainWindowCloseConfirmDecisionTests
{
[Fact]
public void True_when_at_least_one_mission_control_session_is_open()
{
Assert.True(IslandsShellViewModel.RequiresCloseConfirmation(1));
}
[Fact]
public void True_when_multiple_mission_control_sessions_are_open()
{
Assert.True(IslandsShellViewModel.RequiresCloseConfirmation(3));
}
[Fact]
public void False_when_no_mission_control_sessions_are_open()
{
Assert.False(IslandsShellViewModel.RequiresCloseConfirmation(0));
}
}