From 583217d3969281d5a800ef9767b83a2f5da6d479 Mon Sep 17 00:00:00 2001 From: zhayujie Date: Tue, 7 Jul 2026 18:08:05 +0800 Subject: [PATCH] fix(desktop): smoother update UX --- .../renderer/src/components/UpdateBanner.tsx | 36 +++++++++++- desktop/src/renderer/src/i18n.ts | 6 ++ desktop/src/renderer/src/layout/NavRail.tsx | 8 ++- desktop/src/renderer/src/store/updateStore.ts | 57 +++++++++++++++---- 4 files changed, 91 insertions(+), 16 deletions(-) diff --git a/desktop/src/renderer/src/components/UpdateBanner.tsx b/desktop/src/renderer/src/components/UpdateBanner.tsx index bdd45aff..78c48006 100644 --- a/desktop/src/renderer/src/components/UpdateBanner.tsx +++ b/desktop/src/renderer/src/components/UpdateBanner.tsx @@ -14,14 +14,32 @@ const UpdateBanner: React.FC = () => { const status = state.status const errored = status?.state === 'error' + // Full-screen "installing…" overlay: bridges the otherwise blank window + // between clicking "restart to install" and the app actually quitting to + // swap the bundle. (The gap AFTER quit, before relaunch, is OS-level and + // can't be covered.) + if (state.installing) { + return ( +
+ +

{t('update_installing')}

+
+ ) + } + // Show the panel when it's open AND we either know of an update or hit an // error. Keeping it up on error is important: a failed download must surface // a visible message instead of silently doing nothing. if (!open || (!available && !errored)) return null const version = state.version + const preparing = state.preparing const downloading = status?.state === 'downloading' const downloaded = status?.state === 'downloaded' + // macOS emits a second progress pass (verify) after hitting 100%; show it as + // an indeterminate "verifying" state rather than a bar restarting from 0. + const verifying = downloading && state.progressPeaked + const busy = preparing || downloading return (
@@ -62,7 +80,21 @@ const UpdateBanner: React.FC = () => {
)} - {!errored && downloading && ( + {!errored && preparing && ( +
+ + {t('update_preparing')} +
+ )} + + {!errored && downloading && verifying && ( +
+ + {t('update_verifying')} +
+ )} + + {!errored && downloading && !verifying && (
@@ -74,7 +106,7 @@ const UpdateBanner: React.FC = () => {
)} - {!errored && !downloading && !downloaded && ( + {!errored && !busy && !downloaded && (