feat(desktop): tray + lancement au login + auto-update (C5)
Some checks failed
CI / Build & test (Node 24) (push) Has been cancelled
CI / Pack & boot smoke (Node 22) (push) Has been cancelled
CI / No em/en dashes (push) Has been cancelled
CI / Build & test (Node 22) (push) Has been cancelled

tray.ts : icône de barre système (Ouvrir, bascule « Launch at login », Quitter). autostart.ts : login items (Windows/macOS) + fichier ~/.config/autostart/*.desktop (Linux). updater.ts : electron-updater (provider generic -> release Gitea), no-op en dev, actif Windows/Linux. main.ts : fermeture de fenêtre = réduction dans le tray, quit explicite via tray/menu, arrêt propre du daemon avant sortie.

icon.png ajouté aux extraResources (tray en packagé). Vérifié : typecheck contre l'API Electron + electron-updater, bundle esbuild.
This commit is contained in:
2026-07-17 18:04:36 +02:00
parent c9811fc0ca
commit ccbc1b9e4e
7 changed files with 238 additions and 8 deletions

View File

@@ -0,0 +1,13 @@
import { app } from 'electron';
import { autoUpdater } from 'electron-updater';
// Vérifie les mises à jour (provider generic -> assets de release Gitea, cf. electron-builder.yml).
// No-op en dev (pas de app-update.yml). Auto-update effectif : Windows (nsis) + Linux (AppImage) ;
// macOS reste manuel tant que l'app n'est pas signée.
export function initUpdater(): void {
if (!app.isPackaged) return;
autoUpdater.autoDownload = true;
void autoUpdater.checkForUpdatesAndNotify().catch(() => {
/* hors ligne / pas de release publiée : silencieux */
});
}