fix: honor automatic updates preference and add Settings controls

This commit is contained in:
amosblomqvist
2026-10-25 19:19:38 +02:00
parent b277ee3e0f
commit 769fc85e17
14 changed files with 820 additions and 75 deletions
+7 -2
View File
@@ -49,6 +49,7 @@ const STORAGE_KEY = "lh:sidebar-open";
* Mirrors SIDEBAR_AUTOCLOSE in electron/main.cjs — keep in sync.
*/
import type { ChatGPTControlBridge, NativeSubscriptionControlBridge } from "@/src/core";
import type { UpdateState } from "@/components/settings/update-settings.tsx";
const SIDEBAR_AUTOCLOSE = 928;
// Module scope, guarded for SSR (the server has no navigator).
@@ -66,9 +67,13 @@ declare global {
/** The zoom truth (owner round 7): subscribes to "lh:zoom" pushes; returns unsubscribe. */
onZoom?: (cb: (factor: number) => void) => () => void;
getZoom?: () => Promise<number>;
/** Auto-update channel (Wave C, 2026-10-10): "lh:update-status" pushes once a staged update exists. */
onUpdateStatus?: (cb: (status: { status: string; version: string | null }) => void) => () => void;
/** Observational update events and a snapshot for late subscribers. */
onUpdateStatus?: (cb: (status: UpdateState) => void) => () => void;
getUpdateState?: () => Promise<UpdateState>;
/** Explicit manual check also downloads and stages available updates. */
checkForUpdates?: () => Promise<void>;
installUpdate?: () => void;
onOpenSettings?: (cb: (section: string) => void) => () => void;
};
}
}