Skip to content

T-4: Handle red-dot window close via closeProjectAlert #195

@kirich1409

Description

@kirich1409

Part of EPIC #193.

Description

The existing closeProjectAlert (MacApp/Relay/AppFeature.swift:118-151) only triggers on Cmd+Shift+W. Closing a window via its red traffic-light button currently bypasses the active-sessions check. Subscribe to NSWindowDelegate.windowShouldClose(_:) (via AppDelegate or an NSViewRepresentable bridge), return false when active sessions exist, dispatch .closeProject into the store to show the existing alert, and call window.performClose(nil) if the user confirms "Stop All & Close".

Acceptance Criteria

  • Red-dot click with active agent sessions → existing closeProjectAlert is shown
  • Red-dot click with no active sessions → window closes without an alert
  • Cmd+Shift+W flow is unchanged
  • Cmd+Q (quit app) behaviour is unchanged
  • Unit tests added for the reducer flow; manual test verified for NSWindow interaction
  • Build passes, swiftlint lint --strict clean

Module / Layer

Relay / AppFeature + AppDelegate

Complexity

Medium

Dependencies

None.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions