refactor(desktop): quit-flag consolidation + desktop-action Exec composition (follow-up to #6894)
KI
1mo ago+25+25+01234567890123456789-19-19-01234567890123456789
What & why
Follow-up cleanups from the review of #6894 (now merged):
- Consolidate the two app-quitting flags.
main/index.tskeptisQuittingandwindows/main.tskeptappQuitting, both set at the same moment inbefore-quitbut read by different guards (crash-log suppression, the second-instance handler, per-window close). They now share one flag inmain/lib/quit-state.ts(markAppQuitting()/isAppQuitting()), so the guards can't drift apart. No behavior change. - Compose the desktop action's
Execfromlinux.executableArgs. DeclaresexecutableArgs: ["--no-sandbox"]explicitly (identical to the AppImage default when unset, so the built artifact is unchanged) and builds the New Window action'sExecfrom it — replacing the keep-in-sync comment with actual sharing.
Test plan
-
tsc --noEmitpasses in apps/desktop (re-run post-rebase onto main) -
biome checkclean on the four touched files - No tests reference the consolidated flags
- CDP-verified on macOS with this branch running: org-dropdown New window, command-palette New window, native File → New Window, per-window close (×3), and a real Cmd+Q quit — all through the consolidated quit-state path; no console errors, clean exit
Summary by CodeRabbit
- Bug Fixes
- Improved application shutdown handling to prevent unnecessary window-state persistence and duplicate quit-related behavior, resulting in a more reliable exit experience.
- Preserved Linux desktop “New Window” launch behavior while keeping its startup options consistent across application launches and desktop shortcuts.