diff --git a/apps/desktop/README.i18n.yaml b/apps/desktop/README.i18n.yaml index cecb1d621f..b6d066b956 100644 --- a/apps/desktop/README.i18n.yaml +++ b/apps/desktop/README.i18n.yaml @@ -15,8 +15,8 @@ en: 127ea90553cb6af7 zh: 7b1c5aec8558c684 /deepseek-harness-desktop/application-overview: - en: ae064459f56f88aa - zh: 8fe7ba090ff025cc + en: 1f59637852e162b4 + zh: b1530a1af195cb92 /deepseek-harness-desktop/terminal-command: en: 5f2d25a1d8472647 zh: 2acb5c5d7d1917e2 @@ -57,8 +57,8 @@ en: f1302ed4a3ab58bb zh: cb53b9b349815028 /deepseek-harness-desktop/updates: - en: 838bfe3de424dde5 - zh: cb21ab47e20247e6 + en: abd2c718091d4c5d + zh: 80004afee8d6c3a3 /deepseek-harness-desktop/updates/local-desktop-settings: en: dbe57394894b7368 zh: a3bb788c2ce631a4 diff --git a/apps/desktop/README.md b/apps/desktop/README.md index d0a92b83bd..26878818ab 100644 --- a/apps/desktop/README.md +++ b/apps/desktop/README.md @@ -41,8 +41,6 @@ The desktop application is an Electron shell around the complete dsh Web applica Desktop binds `127.0.0.1`, the address Electron dials for the ready URL and the WebSocket credential filter. WebSocket streams use `ws:` or `wss:` according to the Host listener; credentials require matching authority and scheme. -Selecting **Check for Updates…** during a download or verification shows the current operation and explains that installation is available after the download finishes. Closing this informational dialog leaves the download running; repeated clicks focus the open dialog. - The first application-menu command, **About DeepSeek Harness**, opens Electron's native About panel with the application icon, product name, and installed release version. The menu follows the Desktop shell locale. On macOS, Hide, Hide Others, Show All, and Quit use localized labels; Hide and Quit include the DeepSeek Harness product name. These commands retain their native actions and shortcuts. macOS reads the icon from its application bundle, so an unpackaged development launch displays Electron's icon; Windows receives the packaged PNG. Desktop’s local native directory flow opens an Electron folder dialog attached to the application window, restoring, showing, and focusing that window first. Concurrent requests share one dialog; cancellation returns no path and failures remain retryable. Ordinary Web uses the Host chooser. Browse mode lists Host directories. On Linux without zenity or kdialog, automatic selection uses browse instead of the Electron dialog. @@ -280,7 +278,7 @@ Ordinary update dialogs use an isolated shell-origin WebContentsView inside the Ordinary update dialogs, the Windows first-close notice, and mandatory-update documents share the UI design tokens bundled with the shell. Before displaying a card, each document resolves Electron's application theme through `prefers-color-scheme` and updates its dark-theme attribute when the palette changes. Welcome and update documents use the same initialization script. Explicit light/dark preferences and system appearance share this path; the isolated document keeps its background transparent, and dark mode adds a 1 CSS px token-based inset outline without changing the card size; light mode has no outline. -Packaged applications check fixed Nightly asynchronously at startup. Ordinary polling uses a ten-minute base interval with independently sampled ±20% jitter. Each check failure doubles the base delay up to one hour; success resets it. The randomized delay is bounded by that cap and starts after all joined callers settle. Foreground and system-resume checks respect the same monotonic deadline; the localized Check for Updates menu item, including in the Windows caption's Application menu, runs immediately and joins an in-flight check. A newly received mandatory policy also requests an immediate feed check. Automatic checks never open dialogs or download packages. Manual checks display checking, failure, or no-update feedback with the installed version. Ordinary update dialogs fade in and out in place; consecutive prompts replace the card content and reset its scroll position while retaining the dark translucent backdrop without blurring the parent page. +Packaged applications check fixed Nightly asynchronously at startup. Ordinary polling uses a ten-minute base interval with independently sampled ±20% jitter. Each check failure doubles the base delay up to one hour; success resets it. The randomized delay is bounded by that cap and starts after all joined callers settle. Foreground and system-resume checks respect the same monotonic deadline; the localized Check for Updates menu item, including in the Windows caption's Application menu, runs immediately and joins an in-flight check. A newly received mandatory policy also requests an immediate feed check. Automatic checks never open dialogs or download packages. Manual checks display checking, failure, or no-update feedback with the installed version. During downloading or verification, **Check for Updates…** shows the state at the time the dialog opens; it does not refresh as the operation advances. Downloading explains that the app remains usable; verification has no download-completion instruction. Closing the status dialog leaves the update running. If any ordinary shell prompt is already open, the action focuses it without replacing its pending decision; close it before requesting update status. Failure to create the status surface opens a native error and leaves the update running. Ordinary update dialogs fade in and out in place; consecutive prompts replace the card content and reset its scroll position while retaining the dark translucent backdrop without blurring the parent page. `DSH_DESKTOP_UPDATE_CHECK_INTERVAL_MS` configures the ordinary base interval, and `DSH_DESKTOP_UPDATE_CHECK_MAX_BACKOFF_MS` configures the cap; both accept integer milliseconds from 1000 through 2147483647, with the cap at least the interval. An omitted cap defaults to the larger of one hour and the interval. `DSH_DESKTOP_UPDATE_CHECK_JITTER` sets the fractional jitter from 0 through 1, defaulting to `0.2`; the final delay is at least one second and never exceeds the cap. These settings do not change mandatory-policy polling or authorize download retries. diff --git a/apps/desktop/README.zh.md b/apps/desktop/README.zh.md index 24f35fc8ea..25c263aa71 100644 --- a/apps/desktop/README.zh.md +++ b/apps/desktop/README.zh.md @@ -41,8 +41,6 @@ Electron 在 `userData/desktop/locale-cache` 缓存最近确认的界面语言 Desktop 绑定 `127.0.0.1`,即 Electron 为就绪 URL 与 WebSocket 凭据过滤器拨号的地址。WebSocket 流按 Host 监听器使用 `ws:` 或 `wss:`;附加凭据要求 authority 与 scheme 均匹配。 -下载或校验期间选择“检查更新…”会显示当前操作,并说明下载完成后可安装更新。关闭此提示不会停止下载;重复点击会聚焦已打开的弹窗。 - 应用菜单第一项“**关于 DeepSeek Harness**”打开 Electron 原生关于面板,展示应用图标、产品名称和当前安装的发布版本。菜单文案跟随桌面壳的语言。macOS 的隐藏、隐藏其他、显示全部和退出条目使用本地化文案,隐藏和退出条目包含 DeepSeek Harness 产品名称。这些条目保留原生动作和快捷键。macOS 从应用包读取图标,因此未打包的开发启动会显示 Electron 图标;Windows 使用随包分发的 PNG。 Desktop 的本地原生目录流程打开绑定应用窗口的 Electron 文件夹对话框,并先恢复、显示和聚焦该窗口。并发请求共用一个对话框;取消不返回路径,失败后可以重试。普通 Web 使用 Host 选择器。浏览模式列出 Host 目录。Linux 缺少 zenity 或 kdialog 时,自动选择使用浏览模式,不使用 Electron 对话框。 @@ -280,7 +278,7 @@ macOS 在安装准备阶段等待产品主窗口退出全屏,再显示重启 普通更新弹窗、Windows 首次关闭提示和强更文档共用随壳打包的 UI design token。各文档在显示卡片前通过 `prefers-color-scheme` 解析 Electron 的应用主题,配色变化时同步暗色主题属性。欢迎页与更新文档复用同一初始化脚本。明确选择浅色/暗色及跟随系统共用此路径,隔离文档保持透明背景,仅暗色模式以基于 token 的 1 CSS px 内描边区分卡片,不改变尺寸;浅色模式不描边。 -打包应用在启动后异步检查固定 Nightly。常规轮询以十分钟为基础间隔,每次独立采样 ±20% 的随机抖动。每次检查失败将基础延迟翻倍,上限为一小时;成功后重置。随机延迟不超过该上限,并从全部复用调用结算后开始计时。本地化的“检查更新…”菜单项(Windows 可从顶栏的“应用”菜单进入)立即执行,并复用正在进行的检查。回到前台和系统恢复时遵守相同的单调时钟截止时间。新收到的强更策略也会立即请求检查更新清单。自动检查从不弹窗或下载安装包。手动检查显示正在检查、失败或包含已安装版本号的无更新反馈。常规更新弹窗原位渐入渐出;连续弹窗替换卡片内容并重置其滚动位置,保留黑色半透明蒙层,不模糊父页面。 +打包应用在启动后异步检查固定 Nightly。常规轮询以十分钟为基础间隔,每次独立采样 ±20% 的随机抖动。每次检查失败将基础延迟翻倍,上限为一小时;成功后重置。随机延迟不超过该上限,并从全部复用调用结算后开始计时。本地化的“检查更新…”菜单项(Windows 可从顶栏的“应用”菜单进入)立即执行,并复用正在进行的检查。回到前台和系统恢复时遵守相同的单调时钟截止时间。新收到的强更策略也会立即请求检查更新清单。自动检查从不弹窗或下载安装包。手动检查显示正在检查、失败或包含已安装版本号的无更新反馈。下载或校验期间,“**检查更新…**”显示打开提示时的状态,不随操作进展刷新。下载提示说明可以继续使用应用;校验提示不再包含下载完成的说明。关闭状态提示不影响更新。若已有普通壳弹窗,点击会聚焦该弹窗,保留其待确认操作;关闭后可再次查看更新状态。状态界面创建失败时显示原生错误提示,更新继续运行。常规更新弹窗原位渐入渐出;连续弹窗替换卡片内容并重置其滚动位置,保留黑色半透明蒙层,不模糊父页面。 `DSH_DESKTOP_UPDATE_CHECK_INTERVAL_MS` 配置常规基础间隔,`DSH_DESKTOP_UPDATE_CHECK_MAX_BACKOFF_MS` 配置上限;两者均接受 1000 至 2147483647 的整数毫秒数,且上限不能小于间隔。省略上限时取一小时与间隔中的较大值。`DSH_DESKTOP_UPDATE_CHECK_JITTER` 配置 0 至 1 的抖动比例,默认 `0.2`;最终延迟至少一秒,且不超过上限。这些配置不改变强更策略轮询,也不授权下载重试。 diff --git a/apps/desktop/src/locale.ts b/apps/desktop/src/locale.ts index 3e2db64e24..d02b9b8b9f 100644 --- a/apps/desktop/src/locale.ts +++ b/apps/desktop/src/locale.ts @@ -140,6 +140,7 @@ export const en = { updateLater: 'Update later', updateDownloadInProgress: 'Downloading update', updateDownloadDetail: 'The update is downloading in the background. You can continue using the app.', + updateStatusUnavailable: 'Could not show the update status. The update continues in the background.', updateDownloading: 'Downloading {percent}%…', updateVerifying: 'Verifying update files…', updateInstalling: 'Preparing to restart…', @@ -335,6 +336,7 @@ export const zh = { updateLater: '稍后更新', updateDownloadInProgress: '正在下载更新', updateDownloadDetail: '更新正在后台下载,你可以继续使用应用。', + updateStatusUnavailable: '无法显示更新状态,更新仍在后台继续。', updateDownloading: '正在下载 {percent}%…', updateVerifying: '正在校验更新文件…', updateInstalling: '正在准备重启…', @@ -528,6 +530,7 @@ export const ja = { updateLater: '後でアップデート', updateDownloadInProgress: 'アップデートをダウンロード中', updateDownloadDetail: 'アップデートをバックグラウンドでダウンロードしています。アプリは引き続き使用できます。', + updateStatusUnavailable: '更新状況を表示できません。更新はバックグラウンドで続行されます。', updateDownloading: 'ダウンロード中 {percent}%…', updateVerifying: 'アップデートファイルを検証中…', updateInstalling: '再起動の準備中…', @@ -721,6 +724,7 @@ export const es = { updateLater: 'Actualizar más tarde', updateDownloadInProgress: 'Descargando actualización', updateDownloadDetail: 'La actualización se está descargando en segundo plano. Puede seguir usando la aplicación.', + updateStatusUnavailable: 'No se pudo mostrar el estado de la actualización. La actualización continúa en segundo plano.', updateDownloading: 'Descargando {percent}%…', updateVerifying: 'Verificando archivos de actualización...', updateInstalling: 'Preparándose para reiniciar…', @@ -914,6 +918,7 @@ export const fr = { updateLater: 'Mettre à jour plus tard', updateDownloadInProgress: 'Téléchargement de la mise à jour', updateDownloadDetail: 'La mise à jour se télécharge en arrière-plan. Vous pouvez continuer à utiliser l’application.', + updateStatusUnavailable: 'Impossible d’afficher l’état de la mise à jour. Elle continue en arrière-plan.', updateDownloading: 'Téléchargement de {percent}%…', updateVerifying: 'Vérification des fichiers de mise à jour…', updateInstalling: 'Préparation du redémarrage…', @@ -1107,6 +1112,7 @@ export const de = { updateLater: 'Später aktualisieren', updateDownloadInProgress: 'Update wird heruntergeladen', updateDownloadDetail: 'Das Update wird im Hintergrund heruntergeladen. Sie können die App weiter verwenden.', + updateStatusUnavailable: 'Der Update-Status konnte nicht angezeigt werden. Das Update läuft im Hintergrund weiter.', updateDownloading: '{percent}% wird heruntergeladen…', updateVerifying: 'Aktualisierungsdateien werden überprüft…', updateInstalling: 'Neustart wird vorbereitet…', @@ -1300,6 +1306,7 @@ export const ru = { updateLater: 'Обновить позже', updateDownloadInProgress: 'Загрузка обновления', updateDownloadDetail: 'Обновление загружается в фоновом режиме. Вы можете продолжать пользоваться приложением.', + updateStatusUnavailable: 'Не удалось показать состояние обновления. Обновление продолжается в фоновом режиме.', updateDownloading: 'Загрузка {percent}%…', updateVerifying: 'Проверка файлов обновлений…', updateInstalling: 'Подготовка к перезапуску…', @@ -1493,6 +1500,7 @@ export const pt = { updateLater: 'Atualizar mais tarde', updateDownloadInProgress: 'Baixando atualização', updateDownloadDetail: 'A atualização está sendo baixada em segundo plano. Você pode continuar usando o aplicativo.', + updateStatusUnavailable: 'Não foi possível mostrar o status da atualização. A atualização continua em segundo plano.', updateDownloading: 'Baixando {percent}%…', updateVerifying: 'Verificando arquivos de atualização…', updateInstalling: 'Preparando para reiniciar…', diff --git a/apps/desktop/src/main.ts b/apps/desktop/src/main.ts index c30d7cb5cf..b853be8b97 100644 --- a/apps/desktop/src/main.ts +++ b/apps/desktop/src/main.ts @@ -1019,9 +1019,11 @@ async function main(): Promise { } return ordinaryMessageBox({ type: 'info', title: locale.messages.updateCheckTitle, message: updates.state.phase === 'downloading' ? locale.messages.updateDownloadInProgress : locale.messages.updateVerifying, - detail: updates.state.phase === 'downloading' ? locale.messages.updateDownloadDetail : locale.messages.updateDetail, buttons: [locale.messages.updateClose], cancelId: 0, - }).then(() => {}).catch((error: unknown) => showUpdateFailure({ phase: 'error', failedOperation: 'check', - message: desktopErrorState(error).message })) + detail: updates.state.phase === 'downloading' ? locale.messages.updateDownloadDetail : '', buttons: [locale.messages.updateClose], cancelId: 0, + }).then(() => {}).catch((error: unknown) => { + console.error(error) + dialog.showErrorBox(locale.messages.updateFailedTitle, locale.messages.updateStatusUnavailable) + }) } let failedOperation: 'check' | 'download' | 'install' = 'check' promptOperation ??= Promise.resolve().then(async () => { diff --git a/apps/desktop/tests/main-startup.spec.ts b/apps/desktop/tests/main-startup.spec.ts index 6d47ffbd9f..6bd33e9c63 100644 --- a/apps/desktop/tests/main-startup.spec.ts +++ b/apps/desktop/tests/main-startup.spec.ts @@ -2293,7 +2293,7 @@ describe('desktop main startup', () => { check() await vi.waitFor(() => { expect(harness.dialog.showMessageBox).toHaveBeenCalledWith(expect.objectContaining({ message: phase === 'downloading' ? en.updateDownloadInProgress : en.updateVerifying, - detail: phase === 'downloading' ? en.updateDownloadDetail : en.updateDetail, buttons: [en.updateClose], cancelId: 0, + detail: phase === 'downloading' ? en.updateDownloadDetail : '', buttons: [en.updateClose], cancelId: 0, })) }) expect(harness.updateCheck).toHaveBeenCalledTimes(checks) expect(harness.updateDownload).not.toHaveBeenCalled() @@ -2314,9 +2314,9 @@ describe('desktop main startup', () => { harness.dialog.showMessageBox.mockRejectedValueOnce(new Error('overlay unavailable')) const check = applicationMenuItems().find(item => item.label === en.checkUpdatesMenu)!.click as () => void check() - await vi.waitFor(() => { expect(harness.dialog.showMessageBox).toHaveBeenLastCalledWith(expect.objectContaining({ - type: 'error', title: en.updateFailedTitle, technicalDetails: 'overlay unavailable', - })) }) + await vi.waitFor(() => { expect(harness.dialog.showErrorBox).toHaveBeenCalledWith(en.updateFailedTitle, en.updateStatusUnavailable) }) + expect(console.error).toHaveBeenCalledWith(expect.objectContaining({ message: 'overlay unavailable' })) + expect(harness.dialog.showMessageBox).toHaveBeenCalledOnce() expect(harness.updateCheck).toHaveBeenCalledTimes(checks) expect(harness.updateDownload).not.toHaveBeenCalled() expect(harness.updateInstall).not.toHaveBeenCalled()