Skip to content

fix(close): approve quit when no windows are open - #80

Open
project820 wants to merge 2 commits into
mainfrom
fix/quit-without-windows
Open

project820 wants to merge 2 commits into
mainfrom
fix/quit-without-windows

Conversation

@project820

@project820 project820 commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

macOS keeps Notepad AI running after its last window closes. In that state Cmd+Q, Dock Quit, and SIGTERM did nothing: CloseCoordinator denied every empty transaction except shutdown, so the before-quit approval always returned approved=false and the process stayed alive with no windows.

Empty quit and relaunch transactions now take the same path as an empty shutdown: they commit the empty session (clean-exit marker) and approve. An empty window close request is still denied.

Closes #78

Validation

  • test:close-dialog-smoke: added last-window-quit (close the last window, then quit; the worker fails if will-quit does not arrive). It failed on the previous coordinator with quit with no open windows was denied and passes now. All 12 scenarios pass, including quit-save/discard/cancel with two dirty windows and the large-document cases.
  • close-coordinator.test.ts: the empty-quit test now expects approval with one empty commit for quit and relaunch; empty close stays denied.
  • typecheck, test (2443 passed), build, knip, preflight:tessdata, test:security-e2e, test:converter-e2e, test:html-export-direct, test:roundtrip-smoke pass.
  • Manual check on a packaged build: Cmd+Q quits both with a window open and after closing every window; the lifecycle log shows approved=true.
  • npm audit --omit=dev --audit-level=high fails on 22 existing dependency advisories; this PR does not change dependencies.

Follow-up: quit before startup restore

Before the initial session restore runs, no window exists yet. An empty quit in that window used to be denied; with this PR it is approved, and it must not write the clean-exit marker, or the stored recovery snapshot would be discarded on the next launch. commitCloseTransaction now skips commitQuitSession for an empty quit until setReady() has run. app-windows-discard.test.ts covers both sides: quit before restore approves without committing (this assertion fails on the previous commit), and quit after startup commits the clean exit. Full gate re-run: 2444 tests, build, knip, all e2e runners, and all 11 close smoke scenarios pass.

macOS keeps the app alive after its last window closes, and the coordinator denied every empty non-shutdown transaction, so Cmd+Q became a no-op. Empty quit/relaunch now commit the empty session and approve; empty close stays denied. Adds a last-window-quit close smoke scenario.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T04:30:47.546288Z de4a302 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

…ore (#78)

An empty quit before the initial session restore no longer writes the clean-exit marker, so a pending recovery snapshot survives to the next launch.
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.

fix: 창을 모두 닫은 뒤 Cmd+Q로 앱이 종료되지 않음

1 participant