DRY pass #2, batch 7, F21: the desktop's main window, clock and launcher dir (#5372)

- lib.rs MAIN_WINDOW: the "main" window label that the reminder worker,
  the capture window and the shell each wrote, 5 sites in all.
- lib.rs now_ms(): the epoch-milliseconds clock that the reminder worker
  and autosync's cycle stamp each computed. LastCycle.at_ms becomes i64,
  the same number on the wire.
- integration.rs applications_dir(): the XDG launcher directory that the
  entry path and the desktop-database refresh each built.

rustfmt --check is clean in the CI image.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 15:00:03 -04:00
co-authored by Claude Opus 5.5
parent 00dc8840cc
commit 17076d6a79
5 changed files with 29 additions and 20 deletions
+3 -5
View File
@@ -46,7 +46,7 @@
use std::sync::mpsc::{self, Receiver, RecvTimeoutError, Sender};
use std::sync::Mutex;
use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH};
use std::time::{Duration, Instant};
use serde::Serialize;
use tauri::{AppHandle, Emitter, Manager};
@@ -85,7 +85,7 @@ pub enum Trigger {
#[derive(Debug, Clone, Serialize)]
pub struct LastCycle {
/// When it finished, in milliseconds since the epoch — the frontend formats it.
pub at_ms: u64,
pub at_ms: i64,
pub trigger: Trigger,
pub ok: bool,
/// Why it failed, in words a person can act on. None when `ok`.
@@ -299,9 +299,7 @@ fn worker(app: AppHandle, rx: Receiver<Request>) {
}
let cycle = LastCycle {
at_ms: SystemTime::now()
.duration_since(UNIX_EPOCH)
.map_or(0, |d| d.as_millis() as u64),
at_ms: crate::now_ms(),
trigger,
ok: result.is_ok(),
error: result.as_ref().err().cloned(),