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:
@@ -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));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user