fix(mac): updater progress UI and skip redundant download

Show update stage in the modal, forward electron-updater progress over IPC,
and install immediately when the build is already cached. Rename window titles to TTRPG - *.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
     Фонтош Иван Сергеевич
2026-05-19 11:07:19 +08:00
parent b017155eaf
commit 80103a00e7
10 changed files with 225 additions and 52 deletions
+19 -1
View File
@@ -21,6 +21,7 @@ export const ipcChannels = {
updater: {
check: 'updater.check',
downloadAndRestart: 'updater.downloadAndRestart',
progress: 'updater.progress',
},
project: {
list: 'project.list',
@@ -97,6 +98,22 @@ export type UpdaterCheckResponse =
export type UpdaterDownloadResponse = { ok: true } | { ok: false; message: string };
export type UpdaterProgressPhase =
| 'checking'
| 'available'
| 'not-available'
| 'downloading'
| 'installing'
| 'error';
export type UpdaterProgressEvent = {
phase: UpdaterProgressPhase;
/** 0..100 при phase=downloading */
percent?: number;
version?: string;
message?: string;
};
export type IpcEventMap = {
[ipcChannels.session.stateChanged]: { state: SessionState };
[ipcChannels.effects.stateChanged]: { state: EffectsState };
@@ -105,6 +122,7 @@ export type IpcEventMap = {
[ipcChannels.windows.multiWindowStateChanged]: { open: boolean };
[ipcChannels.project.importZipProgress]: ZipProgressEvent;
[ipcChannels.project.exportZipProgress]: ZipProgressEvent;
[ipcChannels.updater.progress]: UpdaterProgressEvent;
};
export type IpcInvokeMap = {
@@ -121,7 +139,7 @@ export type IpcInvokeMap = {
res: UpdaterCheckResponse;
};
[ipcChannels.updater.downloadAndRestart]: {
req: Record<string, never>;
req: { version: string };
res: UpdaterDownloadResponse;
};
[ipcChannels.project.list]: {