refactor(desktop): quit-flag consolidation + desktop-action Exec composition (follow-up to #6894)

KI
1mo ago
+25-19

What & why

Follow-up cleanups from the review of #6894 (now merged):

  • Consolidate the two app-quitting flags. main/index.ts kept isQuitting and windows/main.ts kept appQuitting, both set at the same moment in before-quit but read by different guards (crash-log suppression, the second-instance handler, per-window close). They now share one flag in main/lib/quit-state.ts (markAppQuitting() / isAppQuitting()), so the guards can't drift apart. No behavior change.
  • Compose the desktop action's Exec from linux.executableArgs. Declares executableArgs: ["--no-sandbox"] explicitly (identical to the AppImage default when unset, so the built artifact is unchanged) and builds the New Window action's Exec from it — replacing the keep-in-sync comment with actual sharing.

Test plan

  • tsc --noEmit passes in apps/desktop (re-run post-rebase onto main)
  • biome check clean 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.