Repository navigation
feat(lifecycle): theme quit and close-behavior confirms - #1714
Merged
Merged
Conversation
Keep quit decisions in Electron main while rendering confirmations in the theme-aware main window. A readiness handshake and bounded native fallback preserve shutdown behavior when the renderer is unavailable.
Keep the idempotence contract test in sync with the confirmation latch that now guards a pending renderer decision.
vastsa
force-pushed
the
feat/1702-themed-quit-dialog
branch
from
October 16, 2026 10:13
98ee5f8 to
b1b984b
Compare
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.
Closes #1702.
What changed
Quit confirmation and the first-close behavior choice now render as themed
in-app dialogs instead of Electron's native
showMessageBox, so they follow thelight/dark theme and theme plugins like every other dialog in the app.
bootstrap/lifecycle-dialog.ts) owns each decisionand routes it to the main renderer after a readiness handshake.
LifecycleConfirmationDialog.tsx) usesOverlayBackdroprole="dialog"+aria-modal+--ds-*tokens, keeps title and bodydistinct, focuses Cancel first, and cancels on Escape or a backdrop click.
window/lifecycleDialog/ready,window/lifecycleDialog/respond,window/event/lifecycleDialogRequest,window/event/lifecycleDialogDismiss.failed native fallback still allows shutdown. A tray-hidden main window is
restored before the quit confirmation, and a repeated
before-quitcan nolonger bypass a pending confirmation.
Existing semantics are unchanged: the single
quitConfirmedconfirmation,prompting again after Cancel, probe/update-restart exemptions, and the ordered
shutdown.
Specs / docs
ADR 0090,
04-ux/08-component-spec.md,04-ux/09-interaction-patterns.md,03-runtime/01-ipc-protocol.md, decisions D230/D363, and E2E-143/E2E-204(including the zh-CN mirrors).
Validation
pnpm build:jspnpm --filter @pi-desktop/desktop typecheckpnpm lintandpnpm docs:checklifecycle-dialog-broker.test.mjs,lifecycle-confirmation-dialog-user-path.test.mjs,lifecycle-close-behavior-runtime.test.mjs; extendedclose-behavior-tray.test.mjs,shutdown-regenerate-persistence.test.mjs,protocol.test.tsKnown environment-only failure:
plugin-ui-slots-lab.test.mjsalso fails onmainin a linked-dependency worktree because the example plugin resolves twoReact copies; it passes in the primary checkout's own environment.