fix: Windows command quoting, atomic JSON/log writes, restore dropped test

Implements items 1-3 of the whole-project review's suggested order
(docs/PROJECT_REVIEW_PLAN.md):

- Restore TestJobListViewIsCompact, accidentally dropped by 5b0e6fe;
  drop the redundant TestDefaultConfigUsesDetailedJobList row from
  TESTS.md and document the two other doc gaps the review found.
- Fix quoteLeadingWindowsProgramPath to find the earliest file-extension
  match at a word boundary instead of the first extension in list order,
  so a .bat/.cmd command whose argument ends in .exe no longer has its
  whole command line mistaken for the program path.
- Write gosentry.json, jobs.json, and run log files atomically (temp
  file + rename) so a crash or power loss mid-write can no longer leave
  a truncated file. Wire Service.Stop() into the app shutdown path so
  it actually runs, cancelling the run context for in-flight runs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-06 16:53:59 +03:00
parent 89be009040
commit 1242b22e4f
9 changed files with 253 additions and 18 deletions
+6
View File
@@ -85,6 +85,7 @@ func Run(startInTray bool) {
// instead of forcing one timing definition onto two different UX flows.
recordStartup(time.Since(started), false)
a.Run()
svc.Stop()
return
}
// Show the window before recording startup time. Measuring earlier, during
@@ -94,6 +95,11 @@ func Run(startInTray bool) {
w.Show()
recordStartup(time.Since(started), true)
a.Run()
// a.Run() blocks until the tray's Quit item or a window close calls a.Quit().
// Stopping here — rather than not at all — cancels the run context so an
// in-flight run's os/exec call sees ctx.Done() instead of being orphaned, and
// stops the scheduler goroutine before the process exits.
svc.Stop()
}
// setWindowsNotificationIcon supplies App.Icon for Fyne desktop notifications