feat(04-01): refactor all notify() call sites to use structured NotificationOptions
- Change ipc-support.ts notify() from (title, body) to (options: NotificationOptions) - Wire createNotificationService in bootstrap-application.ts with lazy service graph refs - Update all 12 call sites with entity context, urgency, navigation, and batch keys - Update dependency interfaces in service-graph, worker, orchestration, automation, updater, desktop-shell - No string-based notify() calls remain in src/main/ Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
9ebb489644
commit
667ac48aa5
8 files changed
+113
-34
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import electronUpdater from "electron-updater";
|
||||
import type { AppDatabase } from "./database";
|
||||
import type { NotificationOptions } from "./notification-service";
|
||||
|
||||
const { autoUpdater } = electronUpdater;
|
||||
|
||||
@@ -9,7 +10,7 @@ interface UpdaterServiceDependencies {
|
||||
info: (...args: unknown[]) => void;
|
||||
error: (...args: unknown[]) => void;
|
||||
};
|
||||
notify: (title: string, body: string) => void;
|
||||
notify: (options: NotificationOptions) => void;
|
||||
}
|
||||
|
||||
export function createUpdaterService({
|
||||
@@ -22,14 +23,29 @@ export function createUpdaterService({
|
||||
logger.info("[updater] checking for updates");
|
||||
});
|
||||
autoUpdater.on("update-available", (info) => {
|
||||
notify("Update available", `AgentCompany ${info.version} is available to download.`);
|
||||
notify({
|
||||
title: "Update Available",
|
||||
body: `Version ${info.version} is ready to install`,
|
||||
urgency: "informational",
|
||||
navigation: { section: "settings" },
|
||||
});
|
||||
});
|
||||
autoUpdater.on("update-not-available", () => {
|
||||
notify("No updates found", "AgentCompany is already on the latest configured version.");
|
||||
notify({
|
||||
title: "Up to Date",
|
||||
body: "You are running the latest version",
|
||||
urgency: "informational",
|
||||
navigation: { section: "settings" },
|
||||
});
|
||||
});
|
||||
autoUpdater.on("error", (error) => {
|
||||
logger.error("[updater] error", error);
|
||||
notify("Update check failed", error instanceof Error ? error.message : String(error));
|
||||
notify({
|
||||
title: "Update Check Failed",
|
||||
body: "Could not check for updates. Try again later.",
|
||||
urgency: "informational",
|
||||
navigation: { section: "settings" },
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user