Repository navigation
fix(close): approve quit when no windows are open - #80
Open
project820 wants to merge 2 commits into
Open
project820 wants to merge 2 commits into
project820 wants to merge 2 commits into
Conversation
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.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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.
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.
macOS keeps Notepad AI running after its last window closes. In that state Cmd+Q, Dock Quit, and SIGTERM did nothing:
CloseCoordinatordenied every empty transaction exceptshutdown, so thebefore-quitapproval always returnedapproved=falseand the process stayed alive with no windows.Empty
quitandrelaunchtransactions now take the same path as an empty shutdown: they commit the empty session (clean-exit marker) and approve. An empty windowcloserequest is still denied.Closes #78
Validation
test:close-dialog-smoke: addedlast-window-quit(close the last window, then quit; the worker fails ifwill-quitdoes not arrive). It failed on the previous coordinator withquit with no open windows was deniedand 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 forquitandrelaunch; emptyclosestays denied.typecheck,test(2443 passed),build,knip,preflight:tessdata,test:security-e2e,test:converter-e2e,test:html-export-direct,test:roundtrip-smokepass.approved=true.npm audit --omit=dev --audit-level=highfails 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.
commitCloseTransactionnow skipscommitQuitSessionfor an empty quit untilsetReady()has run.app-windows-discard.test.tscovers 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.