A full-featured download manager.
fix(updater): make update flow reliable (#1890)
Dr_rOot519ca32d592d
diff --git a/e2e/app-update-simulator.spec.ts b/e2e/app-update-simulator.spec.tsnew file mode 100644index 00000000..1c4d0cbd--- /dev/null+++ b/e2e/app-update-simulator.spec.ts@@ -0,0 +1,122 @@+import type { ElectronApplication } from '@playwright/test'+import { expect, launchMotrix, test } from './fixtures/electron-app'++test.describe('development update simulator', () => {+ test('drives the About update action through download and app quit', async ({+ userDataDir,+ rpcPort,+ }) => {+ let app: ElectronApplication | undefined+ try {+ app = await launchMotrix({+ userDataDir,+ rpcPort,+ extraEnv: { MOTRIX_UPDATE_SIMULATOR: '1' },+ })+ const page = await app.firstWindow()+ await page.waitForLoadState('domcontentloaded')+ await page.getByRole('link', { name: 'Settings', exact: true }).click()+ await page.getByText('About', { exact: true }).first().click()++ const checkButton = page.getByRole('button', {+ name: 'Check for updates',+ })+ await expect(checkButton).toBeVisible()+ const actionGroup = page.getByRole('group', { name: 'App updates' })+ await expect(actionGroup).toHaveAttribute('data-slot', 'button-group')+ expect(+ await actionGroup.evaluate((element) => {+ const style = getComputedStyle(element)+ return {+ height: Number.parseFloat(style.height),+ radius: Number.parseFloat(style.borderTopRightRadius),+ }+ })+ ).toEqual({ height: 36, radius: 8 })+ const channel = actionGroup.getByRole('combobox', {+ name: 'Update channel',+ })+ await expect(channel).toBeVisible()+ expect(+ await channel.evaluate((element) =>+ Number.parseFloat(getComputedStyle(element).width)+ )+ ).toBe(68)+ expect(+ await channel.evaluate((element) =>+ Number.parseFloat(getComputedStyle(element).height)+ )+ ).toBe(24)+ expect(+ await actionGroup.evaluate((group) => {+ const select = group.querySelector('[data-slot="select-trigger"]')++ if (!select) {+ throw new Error('Update channel Select is missing')+ }++ const groupStyle = getComputedStyle(group)+ const selectStyle = getComputedStyle(select)+ const groupHeight = Number.parseFloat(groupStyle.height)+ const selectHeight = Number.parseFloat(selectStyle.height)+ const verticalInset = (groupHeight - selectHeight) / 2++ return {+ top: verticalInset,+ right: Number.parseFloat(groupStyle.paddingRight),+ bottom: verticalInset,+ innerRadius: Number.parseFloat(selectStyle.borderTopRightRadius),+ outerRadius: Number.parseFloat(groupStyle.borderTopRightRadius),+ }+ })+ ).toEqual({+ top: 6,+ right: 6,+ bottom: 6,+ innerRadius: 6,+ outerRadius: 8,+ })+ const channelValue = channel.locator('[data-slot="select-value"]')+ expect(+ await channelValue.evaluate(+ (element) => element.scrollWidth <= element.clientWidth+ )+ ).toBe(true)+ await channel.click()+ await page.getByRole('option', { name: 'Beta' }).click()+ await expect(channel).toContainText('Beta')+ await expect(page.getByRole('option', { name: 'Beta' })).toBeHidden()+ await checkButton.click()+ await expect(+ page.getByRole('button', { name: 'Checking…' })+ ).toBeDisabled()+ await expect(channel).toBeDisabled()+ expect(+ await channel.evaluate((element) => getComputedStyle(element).opacity)+ ).toBe('1')++ const downloadButton = page.getByRole('button', {+ name: 'Download update',+ })+ await expect(downloadButton).toBeVisible()+ await downloadButton.click()+ const downloadingButton = page.getByRole('button', {+ name: /^Downloading… \d+%$/,+ })+ await expect(downloadingButton).toBeVisible()+ await expect(page.getByRole('progressbar')).toHaveCount(0)++ const installButton = page.getByRole('button', {+ name: 'Restart and install',+ })+ await expect(installButton).toBeVisible()+ await expect(installButton.locator('..')).toContainText('Beta')+ const closed = app.waitForEvent('close')+ await installButton.click()+ await closed+ app = undefined+ } finally {+ await app?.close().catch(() => {})+ }+ })+})diff --git a/src/main/core/development-update-simulator.test.ts b/src/main/core/development-update-simulator.test.tsnew file mode 100644index 00000000..2f591e72--- /dev/null+++ b/src/main/core/development-update-simulator.test.ts@@ -0,0 +1,80 @@+import { describe, expect, it, vi } from 'vitest'+import {+ DevelopmentUpdateSimulator,+ shouldUseDevelopmentUpdateSimulator,+} from './development-update-simulator'++describe('DevelopmentUpdateSimulator', () => {+ it('is gated to explicitly enabled unpackaged runs', () => {+ expect(+ shouldUseDevelopmentUpdateSimulator({ isPackaged: false, value: '1' })+ ).toBe(true)+ expect(+ shouldUseDevelopmentUpdateSimulator({ isPackaged: false, value: 'true' })+ ).toBe(false)+ expect(+ shouldUseDevelopmentUpdateSimulator({ isPackaged: true, value: '1' })+ ).toBe(false)+ })++ it('emits a stable update followed by determinate download progress', async () => {+ const simulator = createSimulator()+ const checking = vi.fn()+ const available = vi.fn()+ const progress = vi.fn()+ const downloaded = vi.fn()+ simulator.on('checking-for-update', checking)+ simulator.on('update-available', available)+ simulator.on('download-progress', progress)+ simulator.on('update-downloaded', downloaded)++ await simulator.checkForUpdates()+ await simulator.downloadUpdate()++ expect(checking).toHaveBeenCalledOnce()+ expect(available).toHaveBeenCalledWith({+ version: '2.0.1',+ releaseName: 'Development update simulator',+ })+ expect(progress.mock.calls.map(([value]) => value.percent)).toEqual([+ 8, 24, 47, 72, 91, 100,+ ])+ expect(downloaded).toHaveBeenCalledWith({+ version: '2.0.1',+ releaseName: 'Development update simulator',+ })+ })++ it('uses a beta version when the beta channel is selected', async () => {+ const simulator = createSimulator()+ const available = vi.fn()+ simulator.channel = 'beta'+ simulator.on('update-available', available)++ await simulator.checkForUpdates()++ expect(available).toHaveBeenCalledWith(+ expect.objectContaining({ version: '2.0.1-beta.1' })+ )+ })++ it('prepares update quit before requesting application shutdown', () => {+ const calls: string[] = []+ const simulator = createSimulator(() => {+ calls.push('quit')+ })+ simulator.on('before-quit-for-update', () => calls.push('prepare'))++ simulator.quitAndInstall()++ expect(calls).toEqual(['prepare', 'quit'])+ })+})++function createSimulator(onQuitAndInstall: () => void = () => {}) {+ return new DevelopmentUpdateSimulator({+ currentVersion: '2.0.0-beta.18',+ delay: async () => {},+ onQuitAndInstall,+ })+}diff --git a/src/main/core/development-update-simulator.ts b/src/main/core/development-update-simulator.tsnew file mode 100644index 00000000..a435e024--- /dev/null+++ b/src/main/core/development-update-simulator.ts@@ -0,0 +1,111 @@+import type { AppUpdateProgress } from '@shared/types/app-update'+import type { VerifyUpdateSupport } from 'electron-updater'+import type { Updater } from './update-manager'++type UpdateListener = (...args: unknown[]) => void++export interface DevelopmentUpdateSimulatorOptions {+ currentVersion: string+ delay?: (milliseconds: number) => Promise<void>+ onQuitAndInstall: () => void+}++const DOWNLOAD_STEPS = [8, 24, 47, 72, 91, 100] as const+const SIMULATED_TOTAL_BYTES = 128 * 1024 * 1024+const SIMULATED_BYTES_PER_SECOND = 16 * 1024 * 1024++/** Enables the simulator only for an explicit, unpackaged development run. */+export function shouldUseDevelopmentUpdateSimulator(options: {+ isPackaged: boolean+ value: string | undefined+}): boolean {+ return !options.isPackaged && options.value === '1'+}++/**+ * Development-only electron-updater substitute for exercising the complete+ * renderer flow without update metadata, a release feed, or an installer.+ */+export class DevelopmentUpdateSimulator implements Updater {+ autoDownload = false+ autoInstallOnAppQuit = false+ channel: string | null = null+ allowPrerelease = false+ allowDowngrade = false+ isUpdateSupported: VerifyUpdateSupport = async () => true++ private readonly listeners = new Map<string, UpdateListener[]>()+ private readonly delay: (milliseconds: number) => Promise<void>+ private readonly onQuitAndInstall: () => void+ private readonly stableVersion: string++ constructor(options: DevelopmentUpdateSimulatorOptions) {+ this.delay = options.delay ?? wait+ this.onQuitAndInstall = options.onQuitAndInstall+ this.stableVersion = nextPatchVersion(options.currentVersion)+ }++ on(event: string, listener: UpdateListener): this {+ const listeners = this.listeners.get(event) ?? []+ listeners.push(listener)+ this.listeners.set(event, listeners)+ return this+ }++ async checkForUpdates(): Promise<unknown> {+ this.emit('checking-for-update')+ await this.delay(500)+ const updateInfo = this.updateInfo()+ this.emit('update-available', updateInfo)+ return { updateInfo }+ }++ async downloadUpdate(): Promise<unknown> {+ const updateInfo = this.updateInfo()+ for (const percent of DOWNLOAD_STEPS) {+ await this.delay(250)+ this.emit('download-progress', progressAt(percent))+ }+ this.emit('update-downloaded', updateInfo)+ return ['/tmp/motrix-development-update-simulator.zip']+ }++ quitAndInstall(): void {+ this.emit('before-quit-for-update')+ this.onQuitAndInstall()+ }++ private updateInfo(): { version: string; releaseName: string } {+ const version =+ this.channel === 'beta'+ ? `${this.stableVersion}-beta.1`+ : this.stableVersion+ return {+ version,+ releaseName: 'Development update simulator',+ }+ }++ private emit(event: string, ...args: unknown[]): void {+ for (const listener of this.listeners.get(event) ?? []) listener(...args)+ }+}++function progressAt(percent: number): AppUpdateProgress {+ return {+ percent,+ bytesPerSecond: SIMULATED_BYTES_PER_SECOND,+ transferred: Math.round((SIMULATED_TOTAL_BYTES * percent) / 100),+ total: SIMULATED_TOTAL_BYTES,+ }+}++function nextPatchVersion(version: string): string {+ const match = /^(\d+)\.(\d+)\.(\d+)/.exec(version)+ if (!match) return '999.0.0'+ return `${match[1]}.${match[2]}.${Number(match[3]) + 1}`+}++function wait(milliseconds: number): Promise<void> {+ return new Promise((resolve) => setTimeout(resolve, milliseconds))+}diff --git a/src/main/core/update-manager.test.ts b/src/main/core/update-manager.test.tsindex 28906df1..d32c8889 100644--- a/src/main/core/update-manager.test.ts+++ b/src/main/core/update-manager.test.ts@@ -100,6 +100,36 @@ describe('UpdateManager', () => {})describe('imperative methods', () => {+ it('runs the explicit update flow from check through install', async () => {+ const phases: string[] = []+ eventBus.on(Events.UpdateStateChanged, (state) => {+ phases.push((state as { phase: string }).phase)+ })++ await manager.check()+ updater.fire('update-available', { version: '2.0.1' })+ await manager.download()+ updater.fire('download-progress', {+ percent: 75,+ bytesPerSecond: 1024,+ transferred: 75,+ total: 100,+ })+ updater.fire('update-downloaded', { version: '2.0.1' })+ manager.install()++ expect(phases).toEqual([+ 'checking',+ 'available',+ 'downloading',+ 'downloading',+ 'downloaded',+ ])+ expect(updater.checkForUpdates).toHaveBeenCalledOnce()+ expect(updater.downloadUpdate).toHaveBeenCalledOnce()+ expect(updater.quitAndInstall).toHaveBeenCalledOnce()+ })+it('check() delegates to updater.checkForUpdates()', async () => {await manager.check()expect(updater.checkForUpdates).toHaveBeenCalledOnce()@@ -111,14 +141,12 @@ describe('UpdateManager', () => {expect(updater.downloadUpdate).toHaveBeenCalledOnce()})- it('install() delegates only after download and runs the quit guard first', () => {- const beforeQuit = vi.fn()+ it('install() delegates only after download', () => {updater.fire('update-available', { version: '2.0.1' })updater.fire('update-downloaded', { version: '2.0.1' })- manager.install(beforeQuit)+ manager.install()- expect(beforeQuit).toHaveBeenCalledOnce()expect(updater.quitAndInstall).toHaveBeenCalledOnce()})@@ -130,14 +158,32 @@ describe('UpdateManager', () => {})it('rejects install before download completion', () => {- const beforeQuit = vi.fn()- expect(() => manager.install(beforeQuit)).toThrow(- 'Update is not ready to install'- )- expect(beforeQuit).not.toHaveBeenCalled()+ expect(() => manager.install()).toThrow('Update is not ready to install')expect(updater.quitAndInstall).not.toHaveBeenCalled()})+ it('preserves the available version and allows retry after download failure', async () => {+ vi.mocked(updater.downloadUpdate).mockRejectedValueOnce(+ new Error('network unavailable')+ )+ updater.fire('update-available', { version: '2.0.1' })++ await expect(manager.download()).rejects.toThrow('network unavailable')+ expect(manager.getState()).toMatchObject({+ phase: 'error',+ availableVersion: '2.0.1',+ error: { message: 'network unavailable' },+ })++ await manager.download()++ expect(updater.downloadUpdate).toHaveBeenCalledTimes(2)+ expect(manager.getState()).toMatchObject({+ phase: 'downloading',+ availableVersion: '2.0.1',+ })+ })+it('does not replace an in-progress or downloaded update with a new check', async () => {updater.fire('update-available', { version: '2.0.1' })updater.fire('download-progress', { percent: 20 })diff --git a/src/main/core/update-manager.ts b/src/main/core/update-manager.tsindex feee2ef7..fc7304b0 100644--- a/src/main/core/update-manager.ts+++ b/src/main/core/update-manager.ts@@ -178,11 +178,10 @@ export class UpdateManager {return this.downloadPromise}- install(beforeQuit?: () => void): void {+ install(): void {if (this.state.phase !== 'downloaded') {throw new Error('Update is not ready to install')}- beforeQuit?.()this.updater.quitAndInstall()}diff --git a/src/main/core/update-quit-preparation.test.ts b/src/main/core/update-quit-preparation.test.tsnew file mode 100644index 00000000..ebf2d011--- /dev/null+++ b/src/main/core/update-quit-preparation.test.ts@@ -0,0 +1,31 @@+import { describe, expect, it, vi } from 'vitest'+import { registerUpdateQuitPreparation } from './update-quit-preparation'++describe('registerUpdateQuitPreparation', () => {+ it('allows windows to close and bypasses confirmation before update quit', () => {+ let beforeQuitForUpdate: (() => void) | undefined+ const markForceQuit = vi.fn()+ const setWillQuit = vi.fn()+ const on = vi.fn((_event, listener: () => void) => {+ beforeQuitForUpdate = listener+ })++ registerUpdateQuitPreparation({+ updater: { on },+ markForceQuit,+ setWillQuit,+ })++ expect(on).toHaveBeenCalledExactlyOnceWith(+ 'before-quit-for-update',+ expect.any(Function)+ )+ expect(markForceQuit).not.toHaveBeenCalled()+ expect(setWillQuit).not.toHaveBeenCalled()+ expect(beforeQuitForUpdate).toBeTypeOf('function')+ beforeQuitForUpdate?.()++ expect(markForceQuit).toHaveBeenCalledOnce()+ expect(setWillQuit).toHaveBeenCalledExactlyOnceWith(true)+ })+})diff --git a/src/main/core/update-quit-preparation.ts b/src/main/core/update-quit-preparation.tsnew file mode 100644index 00000000..58267658--- /dev/null+++ b/src/main/core/update-quit-preparation.ts@@ -0,0 +1,19 @@+export interface UpdateQuitEventSource {+ on(event: 'before-quit-for-update', listener: () => void): unknown+}++export interface UpdateQuitPreparationOptions {+ updater: UpdateQuitEventSource+ markForceQuit: () => void+ setWillQuit: (value: boolean) => void+}++/** Prepare Motrix's quit policy before Electron closes windows for an update. */+export function registerUpdateQuitPreparation(+ options: UpdateQuitPreparationOptions+): void {+ options.updater.on('before-quit-for-update', () => {+ options.markForceQuit()+ options.setWillQuit(true)+ })+}diff --git a/src/main/index.ts b/src/main/index.tsindex d6129d4a..4b157306 100644--- a/src/main/index.ts+++ b/src/main/index.ts@@ -106,7 +106,13 @@ import type { AppSettings } from '@shared/types/settings'import type { DownloadTask } from '@shared/types/task'import { TaskType } from '@shared/types/task'import type { TaskOccurrence } from '@shared/types/task-occurrence'-import { app, type BrowserWindow, dialog, powerMonitor } from 'electron'+import {+ app,+ type BrowserWindow,+ dialog,+ autoUpdater as nativeAutoUpdater,+ powerMonitor,+} from 'electron'import { autoUpdater } from 'electron-updater'import { bootstrapBridge, createNativeMessagingInstaller } from './bridge'import { BridgeManager } from './bridge/bridge-manager'@@ -122,7 +128,12 @@ import { ContextStore } from './commands/context-store'import { registerAllCommands } from './commands/definitions'import { KeybindingRegistry } from './commands/keybindings/keybinding-registry'import type { CommandDeps } from './commands/types'+import {+ DevelopmentUpdateSimulator,+ shouldUseDevelopmentUpdateSimulator,+} from './core/development-update-simulator'import { UpdateManager } from './core/update-manager'+import { registerUpdateQuitPreparation } from './core/update-quit-preparation'import { setupExceptionHandler } from './exception-handler'import { registerApplicationMenuIpc } from './ipc/application-menu'import { registerCommandHandlers } from './ipc/commands'@@ -1743,15 +1754,36 @@ async function initializeMainProcess(): Promise<void> {const hasUpdateMetadata =app.isPackaged &&(await pathExists(path.join(process.resourcesPath, 'app-update.yml')))- const updatesSupported = isElectronSelfUpdateSupported({- hasUpdateMetadata,+ const updateSimulatorEnabled = shouldUseDevelopmentUpdateSimulator({isPackaged: app.isPackaged,- snapEnvironment: settingsSnapEnvironment,+ value: process.env.MOTRIX_UPDATE_SIMULATOR,})+ const developmentUpdateSimulator = updateSimulatorEnabled+ ? new DevelopmentUpdateSimulator({+ currentVersion: app.getVersion(),+ onQuitAndInstall: () => app.quit(),+ })+ : null+ const updateBackend = developmentUpdateSimulator ?? autoUpdater+ const updatesSupported =+ updateSimulatorEnabled ||+ isElectronSelfUpdateSupported({+ hasUpdateMetadata,+ isPackaged: app.isPackaged,+ snapEnvironment: settingsSnapEnvironment,+ })+ if (developmentUpdateSimulator) {+ log.info('development update simulator enabled')+ registerUpdateQuitPreparation({+ updater: developmentUpdateSimulator,+ markForceQuit: () => quitController.markForceQuit(),+ setWillQuit: (value) => windowManager?.setWillQuit(value),+ })+ }if (!mainProcessWork.isAccepting()) returnconst updateManager = new UpdateManager({eventBus,- updater: autoUpdater,+ updater: updateBackend,currentVersion: app.getVersion(),channel: settingsManager.getApp().updateChannel,supported: updatesSupported,@@ -1815,7 +1847,11 @@ async function initializeMainProcess(): Promise<void> {.run(() => proxyApplier.applyAll(settingsManager.getProxy())).catch((err) => log.warn({ err }, 'initial proxy apply failed'))- if (updatesSupported && settingsManager.getApp().checkForUpdatesOnLaunch) {+ if (+ updatesSupported &&+ !updateSimulatorEnabled &&+ settingsManager.getApp().checkForUpdatesOnLaunch+ ) {runShellAsyncWork('automatic update check', async () => {await proxyReadyif (!mainProcessWork.isAccepting()) return@@ -2140,7 +2176,6 @@ async function initializeMainProcess(): Promise<void> {adapter,taskManager,updateManager,- markForceQuit: () => quitController.markForceQuit(),// Startup barrier for UI-initiated creates (AddTask window, motrix://// protocol, .torrent file-open) — same restore race as bridge submits.waitForTasksReady: () => mainProcessWork.waitForStartup(),@@ -2356,6 +2391,12 @@ const quitController = new QuitController({beginShutdown,})+registerUpdateQuitPreparation({+ updater: nativeAutoUpdater,+ markForceQuit: () => quitController.markForceQuit(),+ setWillQuit: (value) => windowManager?.setWillQuit(value),+})+const requestForcedQuit = (reason: string) => {log.info({ reason }, 'received forced quit request')quitController.requestForcedQuit()diff --git a/src/main/ipc/commands.test.ts b/src/main/ipc/commands.test.tsindex 0e05e537..26dfc4d4 100644--- a/src/main/ipc/commands.test.ts+++ b/src/main/ipc/commands.test.ts@@ -145,10 +145,9 @@ function fakeCtx() {updateManager: {check: vi.fn(),download: vi.fn(),- install: vi.fn((beforeQuit?: () => void) => beforeQuit?.()),+ install: vi.fn(),setChannel: vi.fn(),},- markForceQuit: vi.fn(),trackerManager: {applySourcesChange: vi.fn().mockResolvedValue(undefined),applyBlacklistChange: vi.fn().mockResolvedValue(undefined),@@ -703,8 +702,7 @@ describe('buildCommandHandlers', () => {expect(ctx.windowManager.show).toHaveBeenCalledWith('main')expect(ctx.updateManager.check).toHaveBeenCalledOnce()expect(ctx.updateManager.download).toHaveBeenCalledOnce()- expect(ctx.markForceQuit).toHaveBeenCalledOnce()- expect(ctx.updateManager.install).toHaveBeenCalledWith(ctx.markForceQuit)+ expect(ctx.updateManager.install).toHaveBeenCalledOnce()expect(ctx.contextStore.merge).toHaveBeenCalledWith({currentRoute: '/downloads',})diff --git a/src/main/ipc/commands.ts b/src/main/ipc/commands.tsindex 5b691b51..d9ddcb22 100644--- a/src/main/ipc/commands.ts+++ b/src/main/ipc/commands.ts@@ -167,9 +167,6 @@ export interface CommandContext {adapter: EngineAdaptertaskManager: TaskManagerupdateManager: UpdateManager- /** Set the quit handler's force flag so the install quit skips the- * confirmation dialog (an interrupted install would be left half-applied). */- markForceQuit: () => void/*** Startup barrier: resolves once engine start + session restore have* settled (success or failure). createTask awaits it (after engine-ready)@@ -262,7 +259,6 @@ export function buildCommandHandlers(ctx: CommandContext): CommandHandlerMap {adapter,taskManager,updateManager,- markForceQuit,waitForTasksReady,trackerManager,contextStore,@@ -1103,7 +1099,7 @@ export function buildCommandHandlers(ctx: CommandContext): CommandHandlerMap {},[Commands.InstallUpdate]: async () => {- updateManager.install(markForceQuit)+ updateManager.install()return { ok: true }},diff --git a/src/main/window/window-manager.test.ts b/src/main/window/window-manager.test.tsindex d3bd0376..0fb66fdd 100644--- a/src/main/window/window-manager.test.ts+++ b/src/main/window/window-manager.test.ts@@ -420,6 +420,34 @@ describe('WindowManager', () => {expect(win?.hide).toHaveBeenCalled()})+ it('stops converting main-window close into hide after update quit starts', () => {+ const wm = new WindowManager({+ settingsManager: createMockSettingsManager(),+ preloadPath: '/fake/preload.cjs',+ loadUrl: vi.fn(),+ })+ const win = wm.open('main')+ const closeListener = (+ win.on as unknown as ReturnType<typeof vi.fn>+ ).mock.calls.find(([event]) => event === 'close')?.[1] as+ | ((event: { preventDefault(): void }) => void)+ | undefined+ expect(closeListener).toBeTypeOf('function')++ const ordinaryClose = { preventDefault: vi.fn() }+ closeListener?.(ordinaryClose)+ expect(ordinaryClose.preventDefault).toHaveBeenCalledOnce()+ expect(win.hide).toHaveBeenCalledOnce()++ vi.mocked(win.hide).mockClear()+ wm.setWillQuit(true)+ const updateClose = { preventDefault: vi.fn() }+ closeListener?.(updateClose)++ expect(updateClose.preventDefault).not.toHaveBeenCalled()+ expect(win.hide).not.toHaveBeenCalled()+ })+it('close destroys add-task window', () => {const sm = createMockSettingsManager()const wm = new WindowManager({diff --git a/src/renderer/routes/settings/cards/about-dialog.test.tsx b/src/renderer/routes/settings/cards/about-dialog.test.tsxindex 0bc88340..0276e516 100644--- a/src/renderer/routes/settings/cards/about-dialog.test.tsx+++ b/src/renderer/routes/settings/cards/about-dialog.test.tsx@@ -115,14 +115,58 @@ describe('<AboutDialog>', () => {`Version ${packageJson.version} is installed. Check now, or let Motrix check when it opens.`)).toBeInTheDocument()+ expect(+ screen.getByText('Keep Motrix up to date').parentElement+ ).toHaveClass('min-h-20', 'sm:min-h-16')const checkButton = screen.getByRole('button', {name: 'Check for updates',})+ expect(checkButton).toHaveTextContent('Check')expect(checkButton).not.toHaveTextContent('Check for updates')expect(checkButton.querySelector('svg')).toBeInTheDocument()- expect(- screen.getByRole('combobox', { name: 'Update channel' }).parentElement- ).toContainElement(checkButton)+ expect(checkButton).not.toHaveClass('w-44')+ expect(checkButton.className).not.toContain('active:scale')+ const channel = screen.getByRole('combobox', { name: 'Update channel' })+ const actionGroup = checkButton.closest('[data-slot="button-group"]')+ expect(actionGroup).toHaveAttribute('aria-label', 'App updates')+ expect(actionGroup).toHaveClass(+ 'gap-1',+ 'rounded-md',+ 'bg-primary',+ 'py-1',+ 'ps-1',+ 'pe-1.5',+ 'shadow-xs',+ '[&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-sm!'+ )+ expect(actionGroup).not.toHaveClass('rounded-lg', 'rounded-xl')+ expect(actionGroup).not.toHaveClass('p-1')+ expect(actionGroup).not.toHaveClass('ring-1', 'ring-border')+ expect(actionGroup).toContainElement(channel)+ expect(actionGroup?.firstElementChild).toBe(checkButton)+ expect(checkButton).toHaveAttribute('data-variant', 'default')+ expect(checkButton).toHaveClass(+ 'h-7!',+ 'gap-1.5',+ 'rounded-md!',+ 'px-2',+ 'text-xs',+ 'shadow-none'+ )+ expect(channel).toHaveClass(+ 'h-6!',+ 'w-17',+ 'self-center',+ 'justify-center',+ 'gap-1.5',+ 'rounded-sm!',+ 'border!',+ 'bg-background!',+ 'py-0',+ 'text-xs',+ 'data-disabled:opacity-100!'+ )+ expect(channel).not.toHaveClass('shadow-none')await userEvent.click(checkButton)expect(transport.invoke).toHaveBeenCalledWith(Queries.GetUpdateState)@@ -145,7 +189,26 @@ describe('<AboutDialog>', () => {expect(transport.invoke).toHaveBeenCalledWith(Commands.DownloadUpdate)})- it('renders accessible download progress and survives rehydration', async () => {+ it('keeps the update action in place and uses a spinner while checking', async () => {+ renderDialog()+ const actionButton = await screen.findByRole('button', {+ name: 'Check for updates',+ })++ await emitState({+ phase: 'checking',+ currentVersion: packageJson.version,+ })++ const checkingButton = screen.getByRole('button', { name: 'Checking…' })+ expect(checkingButton).toBe(actionButton)+ expect(checkingButton).toBeDisabled()+ expect(checkingButton).toHaveAttribute('aria-busy', 'true')+ expect(checkingButton.querySelector('.animate-spin')).toBeInTheDocument()+ expect(screen.queryByRole('progressbar')).not.toBeInTheDocument()+ })++ it('renders a compact download percentage and survives rehydration', async () => {vi.mocked(transport.invoke).mockImplementation(async (channel) => {if (channel === Queries.GetUpdateState) {return {@@ -172,20 +235,22 @@ describe('<AboutDialog>', () => {/>)- expect(- await screen.findByRole('progressbar', {- name: 'Update download progress',- })- ).toHaveAttribute('aria-valuenow', '45')- expect(screen.getByText('45%')).toBeInTheDocument()+ const downloadButton = await screen.findByRole('button', {+ name: 'Downloading… 45%',+ })+ expect(downloadButton).toBeDisabled()+ expect(downloadButton).toHaveAttribute('aria-busy', 'true')+ expect(downloadButton).toHaveTextContent('45%')+ expect(downloadButton).not.toHaveTextContent('Downloading…')+ expect(downloadButton).not.toHaveClass('w-44')+ expect(screen.queryByRole('progressbar')).not.toBeInTheDocument()view.unmount()renderDialog()expect(- await screen.findByRole('progressbar', {- name: 'Update download progress',- })+ await screen.findByRole('button', { name: 'Downloading… 45%' })).toBeInTheDocument()+ expect(screen.queryByRole('progressbar')).not.toBeInTheDocument()})it('offers restart only after the update is downloaded', async () => {@@ -203,6 +268,66 @@ describe('<AboutDialog>', () => {expect(transport.invoke).toHaveBeenCalledWith(Commands.InstallUpdate)})+ it('surfaces an install command failure without losing the update version', async () => {+ renderDialog()+ await emitState({+ phase: 'downloaded',+ currentVersion: packageJson.version,+ availableVersion: '2.0.1',+ })+ vi.mocked(transport.invoke).mockImplementation(async (channel) => {+ if (channel === Commands.InstallUpdate) {+ throw new Error('installer launch failed')+ }+ return { ok: true }+ })++ await userEvent.click(+ screen.getByRole('button', { name: 'Restart and install' })+ )++ expect(screen.getByRole('alert')).toHaveTextContent(+ 'Update failed: installer launch failed'+ )+ await userEvent.click(screen.getByRole('button', { name: 'Retry' }))+ expect(transport.invoke).toHaveBeenCalledWith(Commands.DownloadUpdate)+ })++ it('keeps a newer update event when the initial snapshot resolves late', async () => {+ let resolveSnapshot!: (state: AppUpdateState) => void+ vi.mocked(transport.invoke).mockImplementation((channel) => {+ if (channel === Queries.GetUpdateState) {+ return new Promise((resolve) => {+ resolveSnapshot = resolve+ })+ }+ if (channel === Queries.GetSettings) {+ return Promise.resolve({+ app: { checkForUpdatesOnLaunch: true, updateChannel: 'stable' },+ })+ }+ return Promise.resolve({ ok: true })+ })+ renderDialog()+ await emitState({+ phase: 'downloaded',+ currentVersion: packageJson.version,+ availableVersion: '2.0.1',+ })++ await act(async () => {+ resolveSnapshot(idleState)+ await Promise.resolve()+ })++ expect(+ screen.getByRole('button', { name: 'Restart and install' })+ ).toBeInTheDocument()+ expect(+ screen.queryByRole('button', { name: 'Check for updates' })+ ).not.toBeInTheDocument()+ })+it('retries the download after a version-specific error', async () => {renderDialog()await emitState({@@ -288,6 +413,17 @@ describe('<AboutDialog>', () => {)})+ it('does not scale About actions while they are pressed', () => {+ renderDialog()++ for (const button of screen.getAllByRole('button')) {+ expect(button.className).not.toContain('active:scale')+ }+ for (const link of screen.getAllByRole('link')) {+ expect(link.className).not.toContain('active:scale')+ }+ })+it('keeps release notes out of the compact dialog', () => {renderDialog()@@ -296,6 +432,33 @@ describe('<AboutDialog>', () => {).not.toBeInTheDocument()})+ it('unsubscribes the update listener when the dialog unmounts', async () => {+ const view = render(+ <AboutDialog+ open+ onClose={vi.fn()}+ labelKey="settings.cards.about.title"+ descKey="settings.cards.about.desc"+ />+ )+ await waitFor(() => {+ expect(transport.on).toHaveBeenCalledWith(+ Events.UpdateStateChanged,+ expect.any(Function)+ )+ })+ const listener = vi+ .mocked(transport.on)+ .mock.calls.find(([event]) => event === Events.UpdateStateChanged)?.[1]++ view.unmount()++ expect(transport.off).toHaveBeenCalledWith(+ Events.UpdateStateChanged,+ listener+ )+ })+it('keeps the update form inside a shrinkable scroll region', () => {renderDialog()diff --git a/src/renderer/routes/settings/cards/about-dialog.tsx b/src/renderer/routes/settings/cards/about-dialog.tsxindex b58f7003..f0500aaf 100644--- a/src/renderer/routes/settings/cards/about-dialog.tsx+++ b/src/renderer/routes/settings/cards/about-dialog.tsx@@ -26,7 +26,7 @@ function CompactLink({ href, title }: CompactLinkProps) {href={href}target="_blank"rel="noopener noreferrer"- className="rounded-md px-2 py-1 text-xs font-medium text-muted-foreground outline-none transition-[color,background-color,transform] hover:bg-accent/70 hover:text-foreground active:scale-[0.97] focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transform-none"+ className="rounded-md px-2 py-1 text-xs font-medium text-muted-foreground outline-none transition-[color,background-color] hover:bg-accent/70 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring">{title}</a>@@ -154,11 +154,7 @@ export function AboutDialog({<DialogFooter className="shrink-0 flex-row items-center justify-between gap-4 border-t border-border/70 bg-background/85 px-6 py-3.5 backdrop-blur-xl sm:justify-between">{showUpdates ? <AutomaticUpdateSetting /> : <span />}- <Button- onClick={onClose}- size="sm"- className="min-w-20 transition-transform active:scale-[0.97] motion-reduce:transform-none"- >+ <Button onClick={onClose} size="sm" className="min-w-20">{t('common.close')}</Button></DialogFooter>diff --git a/src/renderer/routes/settings/cards/app-update-section.tsx b/src/renderer/routes/settings/cards/app-update-section.tsxindex 12dfad8a..7251ff2d 100644--- a/src/renderer/routes/settings/cards/app-update-section.tsx+++ b/src/renderer/routes/settings/cards/app-update-section.tsx@@ -1,28 +1,20 @@import { Alert } from '@renderer/components/ui/alert'import { Button } from '@renderer/components/ui/button'-import { Progress } from '@renderer/components/ui/progress'import { Spinner } from '@renderer/components/ui/spinner'-import {- Tooltip,- TooltipContent,- TooltipProvider,- TooltipTrigger,-} from '@renderer/components/ui/tooltip'-import type {- AppUpdateProgress,- AppUpdateState,-} from '@shared/types/app-update'+import type { AppUpdateState } from '@shared/types/app-update'+import type { AppUpdateChannel } from '@shared/types/settings'import { DownloadIcon, RefreshCwIcon, RotateCwIcon } from 'lucide-react'+import type { ReactNode } from 'react'+import { useId, useState } from 'react'import { useTranslation } from 'react-i18next'import { UpdateChannelSetting } from './update-channel-setting'import { useAppUpdate } from './use-app-update'-const ACTION_CLASS =- 'transition-transform active:scale-[0.97] motion-reduce:transform-none'-export function AppUpdateSection() {const { t } = useTranslation()const { state, check, download, install } = useAppUpdate()+ const betaWarningId = useId()+ const [channel, setChannel] = useState<AppUpdateChannel>('stable')return (<section@@ -35,19 +27,21 @@ export function AppUpdateSection() {</p><div className="mt-3 flex flex-col items-start gap-4 sm:flex-row sm:justify-between">- <div className="min-w-0 flex-1 pt-0.5">+ <div className="min-h-20 min-w-0 flex-1 pt-0.5 sm:min-h-16"><h3id="app-update-title"className="text-base leading-5 font-semibold tracking-[-0.01em]">{statusTitle(state, t)}</h3>- <p className="mt-1 text-xs leading-[1.5] text-muted-foreground">+ <p className="mt-1 text-xs leading-normal text-muted-foreground">{statusDescription(state, t)}</p></div><UpdateChannelSetting+ warningId={betaWarningId}+ onChannelChanged={setChannel}disabled={state.phase === 'unsupported' ||state.phase === 'checking' ||@@ -55,7 +49,7 @@ export function AppUpdateSection() {state.phase === 'downloaded'}>- <UpdatePrimaryAction+ <UpdateActionButtonstate={state}check={check}download={download}@@ -64,10 +58,13 @@ export function AppUpdateSection() {</UpdateChannelSetting></div>- {state.phase === 'downloading' && (- <div className="mt-4">- <DownloadProgress progress={state.progress} />- </div>+ {channel === 'beta' && (+ <Alert+ id={betaWarningId}+ className="mt-2 border-amber-500/30 bg-amber-500/10 px-3 py-2 text-[11px] leading-4 text-amber-900 dark:text-amber-200"+ >+ {t('settings.about.update.channelBetaWarning')}+ </Alert>)}{(state.phase === 'cancelled' || state.phase === 'error') && (@@ -86,103 +83,116 @@ export function AppUpdateSection() {)}-interface UpdatePrimaryActionProps {+interface UpdateActionButtonProps {state: AppUpdateStatecheck: () => Promise<unknown>download: () => Promise<unknown>install: () => Promise<unknown>}-function UpdatePrimaryAction({+interface UpdateAction {+ label: ReactNode+ accessibleLabel?: string+ icon: ReactNode+ disabled?: boolean+ variant: 'default' | 'outline'+ run?: () => Promise<unknown>+}++function UpdateActionButton({state,check,download,install,-}: UpdatePrimaryActionProps) {+}: UpdateActionButtonProps) {const { t } = useTranslation()- if (state.phase === 'idle' || state.phase === 'up-to-date') {- return (- <TooltipProvider delay={300}>- <Tooltip>- <TooltipTrigger- render={- <Button- type="button"- size="icon-sm"- variant="outline"- className={ACTION_CLASS}- aria-label={t('settings.about.update.check')}- onClick={() => void check()}- />- }- >- <RefreshCwIcon aria-hidden="true" />- </TooltipTrigger>- <TooltipContent>{t('settings.about.update.check')}</TooltipContent>- </Tooltip>- </TooltipProvider>- )- }+ const progress =+ state.phase === 'downloading'+ ? Math.min(100, Math.max(0, Math.round(state.progress?.percent ?? 0)))+ : undefined+ const action = updateAction(state, progress, { check, download, install }, t)- if (state.phase === 'checking') {- return (- <Button- type="button"- size="icon-sm"- variant="outline"- aria-label={t('settings.about.update.checking')}- disabled- >- <Spinner aria-hidden="true" />- </Button>- )- }-- if (state.phase === 'available') {- return (- <Button- type="button"- size="sm"- className={ACTION_CLASS}- onClick={() => void download()}- >- <DownloadIcon aria-hidden="true" />- {t('settings.about.update.download')}- </Button>- )- }-- if (state.phase === 'downloaded') {- return (- <Button- type="button"- size="sm"- className={ACTION_CLASS}- onClick={() => void install()}- >- <RotateCwIcon aria-hidden="true" />- {t('settings.about.update.restart')}- </Button>- )- }+ return action ? (+ <Button+ type="button"+ size="sm"+ variant={action.variant}+ className="h-7! gap-1.5 rounded-md! px-2 text-xs shadow-none disabled:opacity-100 [&_svg]:size-3.5!"+ aria-label={action.accessibleLabel}+ aria-busy={+ state.phase === 'checking' || state.phase === 'downloading'+ ? true+ : undefined+ }+ disabled={action.disabled}+ onClick={action.run ? () => void action.run?.() : undefined}+ >+ {action.icon}+ {action.label}+ </Button>+ ) : null+}- if (state.phase === 'cancelled' || state.phase === 'error') {- return (- <Button- type="button"- size="sm"- variant="outline"- className={ACTION_CLASS}- onClick={() => void (state.availableVersion ? download() : check())}- >- <RefreshCwIcon aria-hidden="true" />- {t('settings.about.update.retry')}- </Button>- )+function updateAction(+ state: AppUpdateState,+ progress: number | undefined,+ actions: {+ check: () => Promise<unknown>+ download: () => Promise<unknown>+ install: () => Promise<unknown>+ },+ t: ReturnType<typeof useTranslation>['t']+): UpdateAction | null {+ switch (state.phase) {+ case 'unsupported':+ return null+ case 'checking':+ return {+ label: t('settings.about.update.checking'),+ icon: <Spinner data-icon="inline-start" aria-hidden="true" />,+ disabled: true,+ variant: 'default',+ }+ case 'available':+ return {+ label: t('settings.about.update.download'),+ icon: <DownloadIcon data-icon="inline-start" aria-hidden="true" />,+ variant: 'default',+ run: actions.download,+ }+ case 'downloading':+ return {+ label: <span className="tabular-nums">{progress}%</span>,+ accessibleLabel: `${t('settings.about.update.downloading')} ${progress}%`,+ icon: <DownloadIcon data-icon="inline-start" aria-hidden="true" />,+ disabled: true,+ variant: 'default',+ }+ case 'downloaded':+ return {+ label: t('settings.about.update.restart'),+ icon: <RotateCwIcon data-icon="inline-start" aria-hidden="true" />,+ variant: 'default',+ run: actions.install,+ }+ case 'cancelled':+ case 'error':+ return {+ label: t('settings.about.update.retry'),+ icon: <RefreshCwIcon data-icon="inline-start" aria-hidden="true" />,+ variant: 'default',+ run: state.availableVersion ? actions.download : actions.check,+ }+ default:+ return {+ label: t('settings.about.update.checkAction'),+ accessibleLabel: t('settings.about.update.check'),+ icon: <RefreshCwIcon data-icon="inline-start" aria-hidden="true" />,+ variant: 'default',+ run: actions.check,+ }}-- return null}function statusTitle(@@ -249,45 +259,6 @@ function statusDescription(}}-function DownloadProgress({- progress = { percent: 0, bytesPerSecond: 0, transferred: 0, total: 0 },-}: {- progress?: AppUpdateProgress-}) {- const { t } = useTranslation()- const percent = Math.round(progress.percent)- return (- <div className="space-y-2">- <div className="flex items-center justify-between gap-3 text-xs">- <span>{t('settings.about.update.downloading')}</span>- <span className="tabular-nums text-muted-foreground">{percent}%</span>- </div>- <Progress- value={progress.percent}- aria-label={t('settings.about.update.downloadProgress')}- />- <p className="text-xs tabular-nums text-muted-foreground">- {t('settings.about.update.progressDetail', {- transferred: formatBytes(progress.transferred),- total: formatBytes(progress.total),- speed: formatBytes(progress.bytesPerSecond),- })}- </p>- </div>- )-}--function formatBytes(value: number): string {- if (!Number.isFinite(value) || value <= 0) return '0 B'- const units = ['B', 'KB', 'MB', 'GB', 'TB']- const unitIndex = Math.min(- Math.floor(Math.log(value) / Math.log(1024)),- units.length - 1- )- const scaled = value / 1024 ** unitIndex- return `${scaled >= 10 || unitIndex === 0 ? scaled.toFixed(0) : scaled.toFixed(1)} ${units[unitIndex]}`-}-export function shouldShowAppUpdate(target: 'electron' | 'web'): boolean {return target === 'electron'}diff --git a/src/renderer/routes/settings/cards/update-channel-setting.tsx b/src/renderer/routes/settings/cards/update-channel-setting.tsxindex 49e3ef76..eeb15fcf 100644--- a/src/renderer/routes/settings/cards/update-channel-setting.tsx+++ b/src/renderer/routes/settings/cards/update-channel-setting.tsx@@ -1,3 +1,4 @@+import { ButtonGroup } from '@renderer/components/ui/button-group'import {Select,SelectContent,@@ -29,17 +30,20 @@ const settingsChannelSchema = z.object({interface UpdateChannelSettingProps {disabled?: booleanchildren?: ReactNode+ warningId?: string+ onChannelChanged?: (channel: AppUpdateChannel) => void}export function UpdateChannelSetting({disabled = false,children,+ warningId,+ onChannelChanged,}: UpdateChannelSettingProps) {const { t } = useTranslation()const id = useId()const labelId = `${id}-label`const descriptionId = `${id}-description`- const warningId = `${id}-warning`const [channel, setChannel] = useState<AppUpdateChannel>('stable')const [pending, setPending] = useState(true)const [failed, setFailed] = useState(false)@@ -81,7 +85,11 @@ export function UpdateChannelSetting({}}, [])- const onChannelChange = useCallback(+ useEffect(() => {+ onChannelChanged?.(channel)+ }, [channel, onChannelChanged])++ const saveChannel = useCallback(async (value: unknown) => {const parsed = appUpdateChannelSchema.safeParse(value)if (!parsed.success || parsed.data === channel) return@@ -114,20 +122,24 @@ export function UpdateChannelSetting({<span id={labelId} className="sr-only">{t('settings.about.update.channelLabel')}</span>- <div className="flex max-w-full items-center gap-2">+ <ButtonGroup+ className="max-w-full shrink-0 gap-1 rounded-md bg-primary py-1 ps-1 pe-1.5 shadow-xs [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-sm!"+ aria-label={t('settings.about.update.title')}+ >+ {children}<Selectitems={options}value={channel}disabled={disabled || pending}- onValueChange={(value) => void onChannelChange(value)}+ onValueChange={(value) => void saveChannel(value)}><SelectTriggerid={id}size="sm"- className="w-28"+ className="h-6! w-17 self-center justify-center gap-1.5 rounded-sm! border! bg-background! px-1.5 py-0 text-xs data-disabled:opacity-100! [&_svg]:size-3!"aria-labelledby={labelId}aria-describedby={- channel === 'beta'+ channel === 'beta' && warningId? `${descriptionId} ${warningId}`: descriptionId}@@ -144,23 +156,13 @@ export function UpdateChannelSetting({</SelectGroup></SelectContent></Select>- {children}- </div>+ </ButtonGroup>{failed && (<p className="max-w-sm text-[11px] leading-4 text-destructive">{t('settings.about.update.channelSaveError')}</p>)}-- {channel === 'beta' && (- <p- id={warningId}- className="max-w-sm rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-left text-[11px] leading-4 text-amber-900 dark:text-amber-200"- >- {t('settings.about.update.channelBetaWarning')}- </p>- )}</div>)}diff --git a/src/shared/locales/en-US.json b/src/shared/locales/en-US.jsonindex 74583ea2..164ea789 100644--- a/src/shared/locales/en-US.json+++ b/src/shared/locales/en-US.json@@ -989,6 +989,7 @@"unsupportedTitle": "Automatic updates unavailable","unsupported": "This build of Motrix doesn’t support automatic updates. Download the latest release from the official website.","check": "Check for updates",+ "checkAction": "Check","checking": "Checking…","checkingTitle": "Checking for updates…","checkingDescription": "Contacting the Motrix update service…",@@ -998,11 +999,9 @@"availableTitle": "Motrix {{version}} is available","availableDescription": "Download it now and choose when to restart and install.","download": "Download update",- "downloading": "Downloading update…",+ "downloading": "Downloading…","downloadingTitle": "Downloading Motrix {{version}}","downloadingDescription": "You can close this window. The download will continue in the background.",- "downloadProgress": "Update download progress",- "progressDetail": "{{transferred}} of {{total}} · {{speed}}/s","downloadedTitle": "Update ready to install","downloaded": "Motrix {{version}} is ready to install.","restart": "Restart and install",diff --git a/src/shared/locales/zh-CN.json b/src/shared/locales/zh-CN.jsonindex f6dfa914..cf2f5471 100644--- a/src/shared/locales/zh-CN.json+++ b/src/shared/locales/zh-CN.json@@ -957,6 +957,7 @@"unsupportedTitle": "自动更新不可用","unsupported": "当前构建不支持自动更新,请前往官网下载最新版本。","check": "检查更新",+ "checkAction": "检查","checking": "正在检查…","checkingTitle": "正在检查更新…","checkingDescription": "正在连接 Motrix 更新服务…",@@ -966,11 +967,9 @@"availableTitle": "Motrix {{version}} 已发布","availableDescription": "现在下载,并在准备好时自行选择重启安装。","download": "下载更新",- "downloading": "正在下载更新…",+ "downloading": "下载中…","downloadingTitle": "正在下载 Motrix {{version}}","downloadingDescription": "你可以关闭此窗口,下载会在后台继续。",- "downloadProgress": "更新下载进度",- "progressDetail": "已下载 {{transferred}},共 {{total}} · {{speed}}/秒","downloadedTitle": "更新已可安装","downloaded": "Motrix {{version}} 已准备好安装。","restart": "重启并安装",diff --git a/src/shared/locales/zh-TW.json b/src/shared/locales/zh-TW.jsonindex b5750f88..0d799948 100644--- a/src/shared/locales/zh-TW.json+++ b/src/shared/locales/zh-TW.json@@ -976,6 +976,7 @@"unsupportedTitle": "無法自動更新","unsupported": "此 Motrix 建置版本不支援自動更新。請從官方網站下載最新版本。","check": "檢查更新",+ "checkAction": "檢查","checking": "檢查中...","checkingTitle": "正在檢查更新...","checkingDescription": "正在連線至 Motrix 更新服務...",@@ -985,11 +986,9 @@"availableTitle": "Motrix {{version}} 可供更新","availableDescription": "立即下載,並選擇要在何時重新啟動及安裝。","download": "下載更新",- "downloading": "正在下載更新...",+ "downloading": "下載中...","downloadingTitle": "正在下載 Motrix {{version}}","downloadingDescription": "您可以關閉此視窗,下載會在背景繼續。",- "downloadProgress": "更新下載進度",- "progressDetail": "{{transferred}} / {{total}} · {{speed}}/s","downloadedTitle": "更新已可安裝","downloaded": "Motrix {{version}} 已可安裝。","restart": "重新啟動並安裝",