Repository navigation
fix(app): confirm before quitting with working sessions; never stay invisible - #307
Merged
Merged
Conversation
…nvisible Quit guard. Closing the window quit the app and killed every local PTY without asking. Closing now asks first when a session is starting, running or waiting on a permission prompt; idle sessions close without a prompt, since they restore on the next launch. The check runs on the window's close event and at the top of before-quit, so nothing is torn down before the answer. "Don't ask again" and a new Settings > General toggle store confirmQuitWithActiveSessions. With no window left there is nothing to ask on, so the quit proceeds rather than leaving a windowless app that cannot exit. Invisible window. The window was shown only on ready-to-show, and the update check, usage, quota and J.O.B.S. startup were scheduled inside that callback. When the event never fired the app ran with no window and none of those services. A run-once reveal now also fires from a 4 s fallback timer, and a second launch shows the window if it is hidden. The packaged smoke test unticks the new toggle during its first launch: the confirmation is a native dialog that cannot be answered through the debugging port, and a restored session may still be starting when the second launch exits. It also asserts the preference survives a restart. Tests: quit-guard predicates; renderer component suite. No change to the darwin window-all-closed behaviour. Co-Authored-By: OpenAI Codex <noreply@openai.com>
The failure artifacts held only the harness's view. The app's own log from the scratch profile shows what it was doing when it exited. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
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.


Summary
Review section 5.1 (
docs/REVIEW_2026-11-09.md).closeevent and at the top ofbefore-quit, so hooks and services are not torn down before the answer. The dialog is native (it works even if the renderer is hung) and has "Don't ask again".confirmQuitWithActiveSessions, on by default.ready-to-show, and usage, quota, J.O.B.S. and the update check were started inside that callback. If the event never fired (wedged GPU compositor) the app ran with no window and none of those services. A run-once reveal now also fires from a 4 s fallback timer.second-instanceshows the window when it is not visible.scripts/smoke-windows.mjsunticks the new toggle on first launch, since a native dialog cannot be answered through the debugging port, and asserts the preference survives the restart.No new IPC channels. The darwin
window-all-closedbehaviour is unchanged.Test plan
npx tsc --noEmitnpx eslinton touched filesnpx vitest run src/main/quit-guard.test.ts src/renderer/components— 156 passedwindows package + verify(exercises the smoke change; I could not run the packaged smoke locally)Out of scope
🤖 Generated with Claude Code