Skip to content

(window): ask before a window close ends the app - #478

Open
abate wants to merge 1 commit into
devsuitup:mainfrom
abate:fix/confirm-window-close
Open

abate wants to merge 1 commit into
devsuitup:mainfrom
abate:fix/confirm-window-close

Conversation

@abate

@abate abate commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

Problem

The window's close button sits next to the strip's controls; a stray click ended the app and every session in it.

Change

A window close (close button, Alt+F4, the WM's close) now asks "Close Switchboard?". It rides on the unsaved-edits guard: the window's close event asks the renderer with reason 'close' instead of 'quit', and the unsaved-check handler adds the confirm for 'close' only, and only when the unsaved-edits dialog was not shown (Save/Discard there is already a decision to close).

Not asked: ☰ → Quit, Ctrl+Q, update install (deliberate), Windows logoff (query-session-end pre-approves), and a renderer that does not ack within 2.5 s still lets the window close.

Docs: .ai/contexts/window-frame.md → "Closing the window"; viewer-panel.md updated for the new reason.

Tests

  • test/unsaved-guard.test.js: a window close sends 'close'.
  • test/dom-file-panel-unsaved-guard.test.js: close asks / no keeps open / yes closes; quit does not ask; close over unsaved edits asks once.
  • Lint 0 errors. e2e closes through app.close() (quit path), so no prompt there.

🤖 Generated with Claude Code

The close button sits next to the strip's controls, and a stray click
stopped every session. The window's own close now asks the renderer with
reason 'close', which adds a confirm unless the unsaved-edits dialog has
already been answered. Quit from the menu or the updater is not asked again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant