Repository navigation
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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'scloseevent asks the renderer with reason'close'instead of'quit', and theunsaved-checkhandler 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-endpre-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.mdupdated 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.app.close()(quit path), so no prompt there.🤖 Generated with Claude Code