فهرست منبع

added a downgrade button and manual check for updates

UwU 1 ماه پیش
والد
کامیت
52ef9852f5

+ 3 - 2
src/main/ipc/lwe.handlers.ts

@@ -68,8 +68,9 @@ export function registerLweHandlers(win: BrowserWindow): void {
 
   ipcMain.handle(IpcChannels.LWE_PREBUILT_TARGET, () => getPrebuiltTarget())
 
-  ipcMain.handle(IpcChannels.LWE_INSTALL_PREBUILT, async () => {
-    await installLwePrebuilt(win)
+  ipcMain.handle(IpcChannels.LWE_INSTALL_PREBUILT, async (_e, tag?: string) => {
+    if (tag !== undefined && typeof tag !== 'string') throw new Error('The version has to be a release tag.')
+    await installLwePrebuilt(win, tag)
     invalidateEnvCache()
     refreshEngineUpdate()
     return getLweStatus()

+ 9 - 2
src/main/ipc/update.handlers.ts

@@ -6,15 +6,22 @@ import {
   dismissUpdate,
   getUpdateStatus,
   installAppUpdate,
+  listVersions,
   restartApp,
   setUpdateChecksAndCheck
 } from '../services/update.service'
+import { hasPrebuiltAsset } from '../services/lwe-prebuilt.service'
 
 export function registerUpdateHandlers(): void {
   ipcMain.handle(IpcChannels.UPDATES_STATUS, () => getUpdateStatus())
   ipcMain.handle(IpcChannels.UPDATES_SET_CHECKS, (_e, checks: UpdateChecks) => setUpdateChecksAndCheck(checks))
   ipcMain.handle(IpcChannels.UPDATES_CHECK, () => checkNow())
-  ipcMain.handle(IpcChannels.UPDATES_DISMISS, (_e, target: UpdateTarget, version: string) => dismissUpdate(target, version))
-  ipcMain.handle(IpcChannels.UPDATES_INSTALL_APP, () => installAppUpdate())
+  ipcMain.handle(IpcChannels.UPDATES_DISMISS, (_e, target: UpdateTarget, version: string, forever: boolean) =>
+    dismissUpdate(target, version, forever === true))
+  ipcMain.handle(IpcChannels.UPDATES_INSTALL_APP, (_e, tag?: string) => installAppUpdate(tag))
+  ipcMain.handle(IpcChannels.UPDATES_VERSIONS, (_e, target: UpdateTarget) => {
+    if (target !== 'app' && target !== 'engine') throw new Error(`Unknown update target ${String(target)}.`)
+    return listVersions(target, target === 'engine' ? hasPrebuiltAsset : undefined)
+  })
   ipcMain.handle(IpcChannels.UPDATES_RESTART, () => restartApp())
 }

+ 13 - 4
src/main/services/lwe-prebuilt.service.ts

@@ -9,7 +9,7 @@ import type { LweInstallProgress, LwePrebuiltTarget } from '@shared/types'
 import { isCommandAvailable } from '../utils/platform'
 import { getLwePrebuiltDir } from '../utils/paths'
 import { isFlatpak } from '../utils/flatpak'
-import { downloadVerified, fetchLatestRelease } from '../utils/github'
+import { downloadVerified, fetchLatestRelease, fetchReleaseByTag, isVersionTag, type GithubRelease } from '../utils/github'
 import { buildCleanBuildEnv, isOstreeSystem, pacmanHasSyncDatabases, parseOsReleaseIds, readPrebuiltRelease, resetLweDetection } from './lwe.service'
 import { t } from '../i18n'
 
@@ -173,6 +173,14 @@ export function getPrebuiltTarget(): LwePrebuiltTarget {
   }
 }
 
+/** Whether a release has a build for this system, the distribution one or the portable fallback */
+export function hasPrebuiltAsset(release: GithubRelease): boolean {
+  const target = getPrebuiltTarget()
+  if (!target.supported || !target.asset) return false
+  const portable = assetName(isKdeSession() ? 'kde' : 'generic', 'portable')
+  return release.assets.some(a => a.name === target.asset || a.name === portable)
+}
+
 async function findMissingLibraries(binary: string): Promise<string[]> {
   // the portable launcher adds its bundled fallback libraries before running ldd
   const portable = fs.existsSync(`${binary}.bin`)
@@ -231,7 +239,7 @@ async function installMissingLibraries(distro: PrebuiltDistro, missing: string[]
   return false
 }
 
-export async function installLwePrebuilt(win: BrowserWindow): Promise<void> {
+export async function installLwePrebuilt(win: BrowserWindow, tag?: string): Promise<void> {
   const send = (progress: LweInstallProgress) => {
     win.webContents.send(IpcChannels.EVENT_LWE_INSTALL_PROGRESS, progress)
   }
@@ -247,8 +255,9 @@ export async function installLwePrebuilt(win: BrowserWindow): Promise<void> {
     if (!target.supported || !target.asset || !distro) throw new Error(target.reason ?? 'No prebuilt build fits this system.')
 
     send({ stage: 'downloading', message: t('lwe.lookingUpRelease'), percentage: 2 })
-    const release = await fetchLatestRelease(LWE_RELEASE_REPO)
-    if (!release) throw new Error(`${LWE_RELEASE_REPO} has no releases yet.`)
+    if (tag !== undefined && !isVersionTag(tag)) throw new Error(`${tag} is not a version of the engine.`)
+    const release = tag ? await fetchReleaseByTag(LWE_RELEASE_REPO, tag) : await fetchLatestRelease(LWE_RELEASE_REPO)
+    if (!release) throw new Error(tag ? `${LWE_RELEASE_REPO} has no ${tag} release.` : `${LWE_RELEASE_REPO} has no releases yet.`)
     const portableAsset = assetName(isKdeSession() ? 'kde' : 'generic', 'portable')
     const asset = release.assets.find(a => a.name === target.asset) ?? release.assets.find(a => a.name === portableAsset)
     if (!asset) throw new Error(`Release ${release.tag_name} has no ${target.asset}.`)

+ 61 - 4
src/main/services/update.service.test.ts

@@ -18,17 +18,31 @@ vi.mock('./config.service', () => ({
 }))
 vi.mock('./lwe.service', () => ({ getLweStatus: () => lweStatus }))
 vi.mock('../utils/flatpak', () => ({ isFlatpak: () => false }))
+let failing = false
 vi.mock('../utils/github', () => ({
-  fetchLatestRelease: async (repo: string) => releases[repo] ?? null
+  fetchLatestRelease: async (repo: string) => {
+    if (failing) throw new Error('offline')
+    return releases[repo] ?? null
+  },
+  fetchReleaseByTag: async () => null,
+  fetchReleases: async (repo: string) => (releases[`${repo}#all`] as unknown[]) ?? [],
+  isVersionTag: (tag: string) => /^v\d/.test(tag),
+  download: async () => {},
+  verifyAsset: async () => {}
 }))
 
-const { checkForUpdates, dismissUpdate } = await import('./update.service')
+const { checkForUpdates, checkNow, dismissUpdate, installAppUpdate, listVersions } = await import('./update.service')
+
+function withAsset(tag: string, publishedAt: string, name: string) {
+  return { ...release(tag, publishedAt), assets: [{ name }] }
+}
 
 function release(tag: string, publishedAt = '2026-10-12T00:00:00Z') {
   return { tag_name: tag, html_url: `https://example.invalid/${tag}`, body: 'notes', published_at: publishedAt, assets: [] }
 }
 
 beforeEach(() => {
+  failing = false
   checks = { app: true, engine: true }
   dismissed = {}
   lweStatus = { installed: false }
@@ -76,10 +90,29 @@ describe('checkForUpdates', () => {
     fs.rmSync(dir, { recursive: true, force: true })
   })
 
-  it('remembers a dismissed version', async () => {
+  it('remembers a version the user does not want to hear about again', async () => {
     releases['WallpaperEngineLover/we_manager'] = release('v0.9.0')
     await checkForUpdates()
-    expect(dismissUpdate('app', 'v0.9.0').dismissed).toEqual({ app: 'v0.9.0' })
+    const status = dismissUpdate('app', 'v0.9.0', true)
+    expect(status.dismissed).toEqual({ app: 'v0.9.0' })
+    expect(status.snoozed).toEqual({})
+  })
+
+  it('looks at everything on a manual check even with automatic checks off', async () => {
+    checks = { app: false, engine: false }
+    releases['WallpaperEngineLover/we_manager'] = release('v0.9.0')
+    expect((await checkForUpdates()).app).toBeNull()
+    const status = await checkNow()
+    expect(status.app).toMatchObject({ version: 'v0.9.0' })
+    expect(status.checked).toEqual({ app: true, engine: true })
+  })
+
+  it('only snoozes a version closed with the X', async () => {
+    releases['WallpaperEngineLover/we_manager'] = release('v0.9.0')
+    await checkForUpdates()
+    const status = dismissUpdate('app', 'v0.9.0', false)
+    expect(status.dismissed).toEqual({})
+    expect(status.snoozed).toEqual({ app: 'v0.9.0' })
   })
 })
 
@@ -90,4 +123,28 @@ describe('getUpdateStatus', () => {
     lweStatus = { installed: true, path: '/nonexistent/linux-wallpaperengine', version: 'v0.8.0' }
     expect(getUpdateStatus().engineInstall).toBe('prebuilt')
   })
+
+  it('does not call a failed check up to date', async () => {
+    failing = true
+    const status = await checkForUpdates(true)
+    expect(status.error).toBe('offline offline')
+    expect(status.checked).toEqual({ app: false, engine: false })
+  })
+})
+
+describe('other versions', () => {
+  it('lists the newest release first and only those with an asset for this install', async () => {
+    releases['WallpaperEngineLover/we_manager#all'] = [
+      withAsset('v0.7.0', '2026-01-01T00:00:00Z', 'WE-Manager-0.7.0.AppImage'),
+      withAsset('v0.8.0', '2026-03-01T00:00:00Z', 'WE-Manager-0.8.0.AppImage'),
+      withAsset('v0.7.5', '2026-02-01T00:00:00Z', 'notes.txt')
+    ]
+    const list = await listVersions('app')
+    expect(list.map((r) => r.tag)).toEqual(['v0.8.0', 'v0.7.0'])
+  })
+
+  it('reports a tag that is not a version instead of ignoring it', async () => {
+    const status = await installAppUpdate('libnode-arch')
+    expect(status.appProgress).toMatchObject({ stage: 'error' })
+  })
 })

+ 62 - 20
src/main/services/update.service.ts

@@ -6,18 +6,19 @@ import * as path from 'path'
 import { app, type BrowserWindow } from 'electron'
 import { IpcChannels } from '@shared/ipc-channels'
 import { APP_RELEASE_REPO, LWE_RELEASE_REPO } from '@shared/constants'
-import { isNewerVersion, parseVersion } from '@shared/updates'
+import { compareVersions, isNewerVersion, parseVersion } from '@shared/updates'
 import type {
   AppInstallKind,
   AppUpdateProgress,
   AvailableUpdate,
   EngineInstallKind,
+  ReleaseChoice,
   UpdateChecks,
   UpdateStatus,
   UpdateTarget
 } from '@shared/types'
 import { isFlatpak } from '../utils/flatpak'
-import { download, fetchLatestRelease, verifyAsset, type GithubRelease } from '../utils/github'
+import { download, fetchLatestRelease, fetchReleaseByTag, fetchReleases, isVersionTag, verifyAsset, type GithubRelease } from '../utils/github'
 import { owningPackage, packageVersion } from '../utils/packages'
 import { isCommandAvailable, runningAppImage } from '../utils/platform'
 import { relaunchApp } from '../utils/relaunch'
@@ -35,10 +36,13 @@ let appInstall: AppInstallKind | undefined
 let appRelease: GithubRelease | null = null
 let engineRelease: GithubRelease | null = null
 let checking = false
+let snoozed: Partial<Record<UpdateTarget, string>> = {}
 let checkedAt: number | null = null
+let checked: UpdateChecks = { app: false, engine: false }
 let lastError: string | null = null
 let appProgress: AppUpdateProgress | null = null
-let engine: { install: EngineInstallKind | null; managedBy?: string; update: AvailableUpdate | null } | null = null
+let installingVersion: string | undefined
+let engine: { install: EngineInstallKind | null; managedBy?: string; version: string | null; update: AvailableUpdate | null } | null = null
 
 function detectAppInstall(): AppInstallKind {
   if (isFlatpak()) return 'flatpak'
@@ -73,11 +77,11 @@ function nixVersion(real: string): string | undefined {
 function evaluateEngine(): void {
   const status = getLweStatus()
   if (!status.installed || !status.path) {
-    engine = { install: null, update: null }
+    engine = { install: null, version: null, update: null }
     return
   }
   if (isFlatpak()) {
-    engine = { install: 'bundled', update: null }
+    engine = { install: 'bundled', version: null, update: null }
     return
   }
 
@@ -107,18 +111,19 @@ function evaluateEngine(): void {
       if (builtAt < Date.parse(engineRelease.published_at)) update = releaseInfo(engineRelease, null)
     }
   }
-  engine = { install, managedBy, update }
+  engine = { install, managedBy, version, update }
 }
 
 export function getUpdateStatus(): UpdateStatus {
   appInstall ??= detectAppInstall()
   // needed before any check ran (setup screen, checks off)
   if (!engine) evaluateEngine()
-  const { install, managedBy, update } = engine!
+  const { install, managedBy, version, update } = engine!
   return {
     checks: getUpdateChecks(),
     checking,
     checkedAt,
+    checked,
     error: lastError,
     appVersion: app.getVersion(),
     appInstall,
@@ -126,8 +131,10 @@ export function getUpdateStatus(): UpdateStatus {
     appProgress,
     engineInstall: install,
     ...(managedBy ? { engineManagedBy: managedBy } : {}),
+    engineVersion: version,
     engine: update,
-    dismissed: getDismissedUpdates()
+    dismissed: getDismissedUpdates(),
+    snoozed
   }
 }
 
@@ -135,17 +142,20 @@ function push(): void {
   if (win && !win.isDestroyed()) win.webContents.send(IpcChannels.EVENT_UPDATE_STATUS, getUpdateStatus())
 }
 
-export async function checkForUpdates(): Promise<UpdateStatus> {
-  const checks = getUpdateChecks()
+/** manual: look at everything whatever the automatic checks are set to */
+export async function checkForUpdates(manual = false): Promise<UpdateStatus> {
+  const checks: UpdateChecks | null = manual ? { app: true, engine: true } : getUpdateChecks()
   if (checking || !checks) return getUpdateStatus()
   checking = true
   lastError = null
   push()
   const errors: string[] = []
+  const done: UpdateChecks = { app: false, engine: false }
   try {
     if (checks.app) {
       try {
         appRelease = await fetchLatestRelease(APP_RELEASE_REPO)
+        done.app = true
       } catch (err) {
         errors.push((err as Error).message)
       }
@@ -155,6 +165,7 @@ export async function checkForUpdates(): Promise<UpdateStatus> {
     if (checks.engine && !isFlatpak()) {
       try {
         engineRelease = await fetchLatestRelease(LWE_RELEASE_REPO)
+        done.engine = true
       } catch (err) {
         errors.push((err as Error).message)
       }
@@ -163,6 +174,7 @@ export async function checkForUpdates(): Promise<UpdateStatus> {
     }
     evaluateEngine()
     checkedAt = Date.now()
+    checked = done
   } finally {
     checking = false
     lastError = errors.length > 0 ? errors.join(' ') : null
@@ -185,18 +197,21 @@ export function setUpdateChecksAndCheck(checks: UpdateChecks): UpdateStatus {
 
 /** Brings dismissed notices back */
 export function checkNow(): Promise<UpdateStatus> {
+  snoozed = {}
   setDismissedUpdates({})
-  return checkForUpdates()
+  return checkForUpdates(true)
 }
 
-export function dismissUpdate(target: UpdateTarget, version: string): UpdateStatus {
-  setDismissedUpdates({ ...getDismissedUpdates(), [target]: version })
+/** forever: kept in the config, otherwise hidden until the app starts again */
+export function dismissUpdate(target: UpdateTarget, version: string, forever: boolean): UpdateStatus {
+  if (forever) setDismissedUpdates({ ...getDismissedUpdates(), [target]: version })
+  else snoozed = { ...snoozed, [target]: version }
   push()
   return getUpdateStatus()
 }
 
 function setAppProgress(progress: AppUpdateProgress | null): void {
-  appProgress = progress
+  appProgress = progress && installingVersion ? { ...progress, version: installingVersion } : progress
   push()
 }
 
@@ -230,7 +245,11 @@ async function installDeb(release: GithubRelease): Promise<void> {
     await verifyAsset(file, asset)
     setAppProgress({ stage: 'installing', percentage: 85 })
     // dpkg alone wouldn't resolve new dependencies
-    const command = isCommandAvailable('apt-get') ? ['apt-get', 'install', '-y', file] : ['dpkg', '-i', file]
+    // apt refuses to go back to an older version unless told to, but only for a deliberate downgrade
+    const downgrade = (compareVersions(release.tag_name, app.getVersion()) ?? 0) < 0
+    const command = isCommandAvailable('apt-get')
+      ? ['apt-get', 'install', '-y', ...(downgrade ? ['--allow-downgrades'] : []), file]
+      : ['dpkg', '-i', file]
     const elevate = isCommandAvailable('pkexec') ? 'pkexec' : 'sudo'
     try {
       await execFileAsync(elevate, command, { timeout: 600_000, maxBuffer: 10 * 1024 * 1024 })
@@ -245,19 +264,42 @@ async function installDeb(release: GithubRelease): Promise<void> {
   }
 }
 
-export async function installAppUpdate(): Promise<UpdateStatus> {
-  const update = appUpdate()
-  if (!appRelease || !update || appProgress?.stage === 'downloading' || appProgress?.stage === 'installing') {
+function hasAppAsset(release: GithubRelease): boolean {
+  appInstall ??= detectAppInstall()
+  const suffix = appInstall === 'deb' ? '.deb' : '.AppImage'
+  return release.assets.some((a) => a.name.endsWith(suffix))
+}
+
+/** usable: the engine's check for an asset that fits this system, the app's follows from how it was installed */
+export async function listVersions(target: UpdateTarget, usable?: (release: GithubRelease) => boolean): Promise<ReleaseChoice[]> {
+  const releases = await fetchReleases(target === 'app' ? APP_RELEASE_REPO : LWE_RELEASE_REPO)
+  const fits = target === 'app' ? hasAppAsset : usable
+  return releases
+    .filter((r) => !fits || fits(r))
+    .map((r) => ({ tag: r.tag_name, publishedAt: r.published_at, prerelease: r.prerelease === true }))
+    .sort((a, b) => Date.parse(b.publishedAt) - Date.parse(a.publishedAt))
+}
+
+/** Without a tag: the pending update. With one: that release, newer or older than the running version */
+export async function installAppUpdate(tag?: string): Promise<UpdateStatus> {
+  if (appProgress?.stage === 'downloading' || appProgress?.stage === 'installing') return getUpdateStatus()
+  if (tag !== undefined && (typeof tag !== 'string' || !isVersionTag(tag))) {
+    installingVersion = undefined
+    setAppProgress({ stage: 'error', percentage: 0, message: `${String(tag)} is not a version of WE Manager.` })
     return getUpdateStatus()
   }
+  if (!tag && !appUpdate()) return getUpdateStatus()
   appInstall ??= detectAppInstall()
+  installingVersion = tag ?? appRelease?.tag_name
   setAppProgress({ stage: 'downloading', percentage: 0 })
   try {
+    const release = tag ? await fetchReleaseByTag(APP_RELEASE_REPO, tag) : appRelease
+    if (!release) throw new Error(`${APP_RELEASE_REPO} has no ${tag} release.`)
     const appImage = runningAppImage()
     if (appInstall === 'appimage' && appImage) {
-      await installAppImage(appRelease, appImage)
+      await installAppImage(release, appImage)
     } else if (appInstall === 'deb') {
-      await installDeb(appRelease)
+      await installDeb(release)
     } else {
       throw new Error(`A ${appInstall} install updates outside WE Manager.`)
     }

+ 11 - 1
src/main/utils/github.test.ts

@@ -5,7 +5,7 @@ import type { AddressInfo } from 'net'
 import * as os from 'os'
 import * as path from 'path'
 import { afterAll, beforeAll, describe, expect, it } from 'vitest'
-import { downloadVerified, type GithubAsset } from './github'
+import { downloadVerified, selectableReleases, type GithubAsset, type GithubRelease } from './github'
 
 const body = Buffer.from('engine archive bytes '.repeat(500))
 const sha256 = crypto.createHash('sha256').update(body).digest('hex')
@@ -61,3 +61,13 @@ describe('downloadVerified', () => {
     expect(fs.existsSync(dest)).toBe(true)
   })
 })
+
+const release = (tag_name: string, draft = false) =>
+  ({ tag_name, draft, html_url: '', body: null, published_at: '', assets: [] }) as GithubRelease
+
+describe('selectableReleases', () => {
+  it('keeps v-tagged releases and drops helper releases and drafts', () => {
+    const list = [release('v0.9.8'), release('libnode-arch'), release('libnode (Arch)'), release('v0.9.7-rc1'), release('v0.9.6', true), release('vim')]
+    expect(selectableReleases(list).map(r => r.tag_name)).toEqual(['v0.9.8', 'v0.9.7-rc1'])
+  })
+})

+ 20 - 0
src/main/utils/github.ts

@@ -16,9 +16,20 @@ export interface GithubRelease {
   html_url: string
   body: string | null
   published_at: string
+  draft?: boolean
+  prerelease?: boolean
   assets: GithubAsset[]
 }
 
+/** The repos also publish helper releases (libnode for Arch); only "v0.9.8" style tags are versions of the program */
+export function isVersionTag(tag: string): boolean {
+  return /^v\d/.test(tag)
+}
+
+export function selectableReleases(releases: GithubRelease[]): GithubRelease[] {
+  return releases.filter((r) => !r.draft && isVersionTag(r.tag_name))
+}
+
 export async function fetchLatestRelease(repo: string): Promise<GithubRelease | null> {
   const res = await fetch(`https://api.github.com/repos/${repo}/releases/latest`, {
     headers: { Accept: 'application/vnd.github+json', 'User-Agent': 'we-manager' },
@@ -29,6 +40,15 @@ export async function fetchLatestRelease(repo: string): Promise<GithubRelease |
   return (await res.json()) as GithubRelease
 }
 
+export async function fetchReleases(repo: string): Promise<GithubRelease[]> {
+  const res = await fetch(`https://api.github.com/repos/${repo}/releases?per_page=100`, {
+    headers: { Accept: 'application/vnd.github+json', 'User-Agent': 'we-manager' },
+    signal: AbortSignal.timeout(20_000)
+  })
+  if (!res.ok) throw new Error(`GitHub answered ${res.status} ${res.statusText} for the releases of ${repo}.`)
+  return selectableReleases((await res.json()) as GithubRelease[])
+}
+
 export async function fetchReleaseByTag(repo: string, tag: string): Promise<GithubRelease | null> {
   const res = await fetch(`https://api.github.com/repos/${repo}/releases/tags/${encodeURIComponent(tag)}`, {
     headers: { Accept: 'application/vnd.github+json', 'User-Agent': 'we-manager' },

+ 8 - 5
src/preload/index.ts

@@ -50,6 +50,7 @@ import type {
   ScheduleRule,
   CrashEvent,
   FavoriteStatus,
+  ReleaseChoice,
   UpdateChecks,
   UpdateStatus,
   DesktopIconsStatus,
@@ -364,8 +365,8 @@ const api = {
       ipcRenderer.invoke(IpcChannels.LWE_INSTALL),
     prebuiltTarget: (): Promise<LwePrebuiltTarget> =>
       ipcRenderer.invoke(IpcChannels.LWE_PREBUILT_TARGET),
-    installPrebuilt: (): Promise<LweStatus> =>
-      ipcRenderer.invoke(IpcChannels.LWE_INSTALL_PREBUILT),
+    installPrebuilt: (tag?: string): Promise<LweStatus> =>
+      ipcRenderer.invoke(IpcChannels.LWE_INSTALL_PREBUILT, tag),
     uninstall: (): Promise<{ ok: boolean; message: string }> =>
       ipcRenderer.invoke(IpcChannels.LWE_UNINSTALL),
     launch: (wallpaperPath: string, options?: { screen?: ScreenTarget; fps?: number }): Promise<{ ok: boolean; running: boolean }> =>
@@ -472,9 +473,11 @@ const api = {
     setChecks: (checks: UpdateChecks): Promise<UpdateStatus> =>
       ipcRenderer.invoke(IpcChannels.UPDATES_SET_CHECKS, checks),
     check: (): Promise<UpdateStatus> => ipcRenderer.invoke(IpcChannels.UPDATES_CHECK),
-    dismiss: (target: UpdateTarget, version: string): Promise<UpdateStatus> =>
-      ipcRenderer.invoke(IpcChannels.UPDATES_DISMISS, target, version),
-    installApp: (): Promise<UpdateStatus> => ipcRenderer.invoke(IpcChannels.UPDATES_INSTALL_APP),
+    dismiss: (target: UpdateTarget, version: string, forever = false): Promise<UpdateStatus> =>
+      ipcRenderer.invoke(IpcChannels.UPDATES_DISMISS, target, version, forever),
+    versions: (target: UpdateTarget): Promise<ReleaseChoice[]> =>
+      ipcRenderer.invoke(IpcChannels.UPDATES_VERSIONS, target),
+    installApp: (tag?: string): Promise<UpdateStatus> => ipcRenderer.invoke(IpcChannels.UPDATES_INSTALL_APP, tag),
     restart: (): Promise<void> => ipcRenderer.invoke(IpcChannels.UPDATES_RESTART)
   },
 

+ 19 - 8
src/renderer/src/components/settings/UpdateSettings.tsx

@@ -3,20 +3,22 @@ import { Loader2, RefreshCw } from 'lucide-react'
 import type { UpdateChecks, UpdateStatus } from '@shared/types'
 import { UPDATE_STATUS_KEY, useUpdateStatus } from '../../hooks/queries'
 import Toggle from '../common/Toggle'
+import { AppAction, EngineAction } from '../updates/UpdateNotice'
+import VersionPicker from '../updates/VersionPicker'
 import { currentLanguage, t } from '../../i18n'
 
 function engineLine(status: UpdateStatus): string {
   if (status.engineInstall === 'bundled') return t('update.engineBundled')
   if (status.engineInstall === null) return t('update.engineMissing')
-  if (!status.checks?.engine) return t('update.notChecking')
   if (status.engine) return t('update.available', { version: status.engine.version })
-  return status.checkedAt ? t('update.upToDate') : t('update.neverChecked')
+  if (!status.checked.engine) return status.checks?.engine ? t('update.neverChecked') : t('update.notChecking')
+  return t('update.upToDate')
 }
 
 function appLine(status: UpdateStatus): string {
-  if (!status.checks?.app) return t('update.notChecking')
   if (status.app) return t('update.available', { version: status.app.version })
-  return status.checkedAt ? t('update.upToDate') : t('update.neverChecked')
+  if (!status.checked.app) return status.checks?.app ? t('update.neverChecked') : t('update.notChecking')
+  return t('update.upToDate')
 }
 
 export default function UpdateSettings() {
@@ -57,8 +59,14 @@ export default function UpdateSettings() {
       </div>
 
       <div className="mt-3 space-y-1 text-xs text-gray-400">
-        <p>WE Manager {status.appVersion}: {appLine(status)}</p>
-        <p>linux-wallpaperengine-kde: {engineLine(status)}</p>
+        <div className="flex flex-wrap items-center gap-3">
+          <span>WE Manager {status.appVersion}: {appLine(status)}</span>
+          {status.app && <AppAction status={status} />}
+        </div>
+        <div className="flex flex-wrap items-center gap-3">
+          <span>linux-wallpaperengine-kde: {engineLine(status)}</span>
+          {status.engine && <EngineAction status={status} />}
+        </div>
         {status.checkedAt && (
           <p className="text-gray-600">
             {t('update.lastChecked', { time: new Date(status.checkedAt).toLocaleString(currentLanguage()) })}
@@ -67,10 +75,13 @@ export default function UpdateSettings() {
         {status.error && <p className="text-red-400">{t('update.failed', { error: status.error })}</p>}
       </div>
 
+      <VersionPicker target="app" status={status} />
+      {engineCheckable && <VersionPicker target="engine" status={status} />}
+
       <button
         onClick={checkNow}
-        disabled={status.checking || (!checks.app && !checks.engine)}
-        className="mt-3 flex items-center gap-2 rounded-lg bg-fg/5 px-4 py-2 text-sm text-gray-300 hover:bg-fg/10 disabled:opacity-50"
+        disabled={status.checking}
+        className="mt-4 flex items-center gap-2 rounded-lg bg-fg/5 px-4 py-2 text-sm text-gray-300 hover:bg-fg/10 disabled:opacity-50"
       >
         {status.checking ? <Loader2 size={14} className="animate-spin" /> : <RefreshCw size={14} />}
         {status.checking ? t('update.checking') : t('update.checkNow')}

+ 23 - 10
src/renderer/src/components/updates/UpdateNotice.tsx

@@ -1,7 +1,7 @@
 import { useState, type ReactNode } from 'react'
 import { useQuery, useQueryClient } from '@tanstack/react-query'
-import { Download, ExternalLink, Loader2, RefreshCw, RotateCw, X } from 'lucide-react'
-import type { AppInstallKind, AvailableUpdate, LweInstallProgress, UpdateStatus, UpdateTarget } from '@shared/types'
+import { BellOff, Download, ExternalLink, Loader2, RefreshCw, RotateCw, X } from 'lucide-react'
+import type { AppInstallKind, AppUpdateProgress, AvailableUpdate, LweInstallProgress, UpdateStatus, UpdateTarget } from '@shared/types'
 import type { MessageKey } from '@shared/i18n'
 import { UPDATE_STATUS_KEY, useUpdateStatus } from '../../hooks/queries'
 import { t } from '../../i18n'
@@ -27,8 +27,8 @@ function UpdateRow({ target, update, message, action }: {
   const queryClient = useQueryClient()
   const [showNotes, setShowNotes] = useState(false)
 
-  async function dismiss() {
-    queryClient.setQueryData(UPDATE_STATUS_KEY, await window.electronAPI.updates.dismiss(target, update.version))
+  async function dismiss(forever: boolean) {
+    queryClient.setQueryData(UPDATE_STATUS_KEY, await window.electronAPI.updates.dismiss(target, update.version, forever))
   }
 
   return (
@@ -44,8 +44,12 @@ function UpdateRow({ target, update, message, action }: {
           <ExternalLink size={12} />
           {t('update.releasePage')}
         </button>
+        <button onClick={() => dismiss(true)} className={SECONDARY}>
+          <BellOff size={12} />
+          {t('update.dontShowAgain')}
+        </button>
         <button
-          onClick={dismiss}
+          onClick={() => dismiss(false)}
           title={t('update.dismiss')}
           className="rounded p-1 text-gray-500 hover:bg-fg/5 hover:text-gray-300"
         >
@@ -61,9 +65,16 @@ function UpdateRow({ target, update, message, action }: {
   )
 }
 
-function AppAction({ status }: { status: UpdateStatus }) {
-  const queryClient = useQueryClient()
+/** Progress of an install of the pending update; one for another version belongs to the version picker */
+export function pendingProgress(status: UpdateStatus): AppUpdateProgress | null {
   const progress = status.appProgress
+  if (!progress || !status.app) return progress
+  return progress.version === undefined || progress.version === status.app.version ? progress : null
+}
+
+export function AppAction({ status }: { status: UpdateStatus }) {
+  const queryClient = useQueryClient()
+  const progress = pendingProgress(status)
 
   if (status.appInstall !== 'appimage' && status.appInstall !== 'deb') {
     return <span className="text-xs text-gray-500">{t(APP_HINTS[status.appInstall])}</span>
@@ -105,7 +116,7 @@ function AppAction({ status }: { status: UpdateStatus }) {
   )
 }
 
-function EngineAction({ status }: { status: UpdateStatus }) {
+export function EngineAction({ status }: { status: UpdateStatus }) {
   const queryClient = useQueryClient()
   // shared with Settings, fed by App.tsx
   const { data: progress = null } = useQuery<LweInstallProgress | null>({
@@ -163,8 +174,10 @@ export default function UpdateNotice() {
   const status = useUpdateStatus()
   if (!status) return null
 
-  const app = status.app && status.dismissed.app !== status.app.version ? status.app : null
-  const engine = status.engine && status.dismissed.engine !== status.engine.version ? status.engine : null
+  const hidden = (target: UpdateTarget, version: string) =>
+    status.dismissed[target] === version || status.snoozed[target] === version
+  const app = status.app && !hidden('app', status.app.version) ? status.app : null
+  const engine = status.engine && !hidden('engine', status.engine.version) ? status.engine : null
   if (!app && !engine) return null
 
   return (

+ 153 - 0
src/renderer/src/components/updates/VersionPicker.tsx

@@ -0,0 +1,153 @@
+import { useState } from 'react'
+import { useQuery, useQueryClient } from '@tanstack/react-query'
+import { Download, Loader2, RotateCw } from 'lucide-react'
+import type { LweInstallProgress, ReleaseChoice, UpdateStatus, UpdateTarget } from '@shared/types'
+import { UPDATE_STATUS_KEY } from '../../hooks/queries'
+import { currentLanguage, t } from '../../i18n'
+import { pendingProgress } from './UpdateNotice'
+
+const NAMES: Record<UpdateTarget, string> = { app: 'WE Manager', engine: 'linux-wallpaperengine-kde' }
+
+function canSwitch(target: UpdateTarget, status: UpdateStatus): boolean {
+  return target === 'app'
+    ? status.appInstall === 'appimage' || status.appInstall === 'deb'
+    : status.engineInstall === 'prebuilt'
+}
+
+export default function VersionPicker({ target, status }: { target: UpdateTarget; status: UpdateStatus }) {
+  const queryClient = useQueryClient()
+  const [versions, setVersions] = useState<ReleaseChoice[] | null>(null)
+  const [selected, setSelected] = useState('')
+  const [loading, setLoading] = useState(false)
+  const [error, setError] = useState<string | null>(null)
+  const { data: engineProgress = null } = useQuery<LweInstallProgress | null>({
+    queryKey: ['lwe-install-progress'],
+    queryFn: () => null,
+    staleTime: Infinity,
+    gcTime: Infinity
+  })
+
+  if (!canSwitch(target, status)) return null
+
+  // the result line already shows the progress of the pending update
+  const appProgress = target === 'app' && status.appProgress && pendingProgress(status) === null ? status.appProgress : null
+  const busy = target === 'app'
+    ? status.appProgress?.stage === 'downloading' || status.appProgress?.stage === 'installing'
+    : engineProgress !== null && engineProgress.stage !== 'done' && engineProgress.stage !== 'error'
+  const current = target === 'app' ? status.appVersion : status.engineVersion
+
+  function isInstalled(tag: string): boolean {
+    return !!current && (tag === current || tag === `v${current}`)
+  }
+
+  async function load() {
+    setLoading(true)
+    setError(null)
+    try {
+      const list = await window.electronAPI.updates.versions(target)
+      setVersions(list)
+      const others = list.filter((r) => !isInstalled(r.tag))
+      setSelected((others.find((r) => !r.prerelease) ?? others[0] ?? list[0])?.tag ?? '')
+    } catch (err) {
+      setError(t('update.versionsFailed', { error: (err as Error).message }))
+    } finally {
+      setLoading(false)
+    }
+  }
+
+  async function install() {
+    if (!selected) return
+    if (!confirm(t('update.switchConfirm', { name: NAMES[target], version: selected }))) return
+    if (target === 'app') {
+      queryClient.setQueryData(UPDATE_STATUS_KEY, await window.electronAPI.updates.installApp(selected))
+      return
+    }
+    queryClient.setQueryData(['lwe-install-progress'], {
+      stage: 'downloading',
+      message: t('lwe.startingDownload'),
+      percentage: 0
+    } satisfies LweInstallProgress)
+    try {
+      await window.electronAPI.lwe.installPrebuilt(selected)
+    } catch (err) {
+      queryClient.setQueryData(['lwe-install-progress'], {
+        stage: 'error',
+        message: t('lwe.installFailed', { error: (err as Error).message }),
+        percentage: 0
+      } satisfies LweInstallProgress)
+    }
+    queryClient.invalidateQueries({ queryKey: ['lwe-status'] })
+  }
+
+  function label(r: ReleaseChoice): string {
+    const date = new Date(r.publishedAt).toLocaleDateString(currentLanguage())
+    const marks = [isInstalled(r.tag) ? t('update.versionInstalled') : '', r.prerelease ? t('update.versionPrerelease') : '']
+    return [r.tag, ...marks.filter(Boolean)].join(' - ') + ` (${date})`
+  }
+
+  return (
+    <div className="mt-3">
+      <p className="text-xs text-gray-400">{t('update.otherVersion', { name: NAMES[target] })}</p>
+      <div className="mt-1 flex flex-wrap items-center gap-2">
+        {versions === null ? (
+          <button
+            onClick={load}
+            disabled={loading}
+            className="flex items-center gap-2 rounded-lg bg-fg/5 px-3 py-1.5 text-xs text-gray-300 hover:bg-fg/10 disabled:opacity-50"
+          >
+            {loading && <Loader2 size={12} className="animate-spin" />}
+            {t('update.chooseVersion')}
+          </button>
+        ) : versions.length === 0 ? (
+          <span className="text-xs text-gray-500">{t('update.noVersions')}</span>
+        ) : (
+          <>
+            <select
+              value={selected}
+              onChange={(e) => setSelected(e.target.value)}
+              disabled={busy}
+              className="rounded-lg bg-fg/5 px-2 py-1.5 text-xs text-gray-300"
+            >
+              {versions.map((r) => (
+                <option key={r.tag} value={r.tag}>{label(r)}</option>
+              ))}
+            </select>
+            {!busy && (
+              <button
+                onClick={install}
+                className="flex items-center gap-1.5 rounded-lg bg-accent-600 px-3 py-1.5 text-xs font-medium text-white hover:bg-accent-500"
+              >
+                <Download size={12} />
+                {t('update.installVersion')}
+              </button>
+            )}
+          </>
+        )}
+        {busy && <Loader2 size={12} className="animate-spin text-gray-400" />}
+        {target === 'app' && appProgress && (
+          <span className={`text-xs ${appProgress.stage === 'error' ? 'text-red-400' : 'text-gray-400'}`}>
+            {appProgress.stage === 'downloading' && t('update.downloading', { percent: appProgress.percentage })}
+            {appProgress.stage === 'installing' && t('update.installing')}
+            {appProgress.stage === 'ready' && t('update.ready')}
+            {appProgress.stage === 'error' && t('update.installFailed', { error: appProgress.message ?? '' })}
+          </span>
+        )}
+        {target === 'app' && appProgress?.stage === 'ready' && (
+          <button
+            onClick={() => window.electronAPI.updates.restart()}
+            className="flex items-center gap-1.5 rounded-lg bg-accent-600 px-3 py-1.5 text-xs font-medium text-white hover:bg-accent-500"
+          >
+            <RotateCw size={12} />
+            {t('update.restart')}
+          </button>
+        )}
+        {target === 'engine' && engineProgress && (busy || engineProgress.stage === 'error') && (
+          <span className={`text-xs ${engineProgress.stage === 'error' ? 'text-red-400' : 'text-gray-400'}`}>
+            {engineProgress.message}
+          </span>
+        )}
+      </div>
+      {error && <p className="mt-1 text-xs text-red-400">{error}</p>}
+    </div>
+  )
+}

+ 9 - 0
src/shared/i18n/locales/de.ts

@@ -1066,6 +1066,15 @@ export const de: Messages = {
   'update.checking': 'Wird geprüft...',
   'update.checksHint': 'Prüft GitHub beim Start und alle 6 Stunden. Es wird nichts heruntergeladen, bis du auf Aktualisieren klickst.',
   'update.dismiss': 'Ausblenden',
+  'update.chooseVersion': 'Version wählen...',
+  'update.dontShowAgain': 'Für diese Version nicht mehr anzeigen',
+  'update.installVersion': 'Installieren',
+  'update.noVersions': 'Keine Versionen gefunden.',
+  'update.otherVersion': 'Andere Version von {name} installieren',
+  'update.switchConfirm': '{name} {version} installieren? Danach ist eventuell ein Neustart nötig.',
+  'update.versionInstalled': 'installiert',
+  'update.versionPrerelease': 'Vorabversion',
+  'update.versionsFailed': 'Versionen konnten nicht geladen werden: {error}',
   'update.downloading': 'Wird heruntergeladen... {percent}%',
   'update.engineAvailable': 'linux-wallpaperengine-kde {version} ist verfügbar (installiert: {current}).',
   'update.engineAvailableUnknown': 'linux-wallpaperengine-kde {version} ist verfügbar und neuer als dein Build.',

+ 9 - 0
src/shared/i18n/locales/en.ts

@@ -1064,6 +1064,15 @@ export const en = {
   'update.checking': 'Checking...',
   'update.checksHint': 'Checks GitHub at startup and every 6 hours. Nothing downloads until you click Update.',
   'update.dismiss': 'Dismiss',
+  'update.chooseVersion': 'Choose version...',
+  'update.dontShowAgain': 'Don\'t notify me again for this version',
+  'update.installVersion': 'Install',
+  'update.noVersions': 'No versions found.',
+  'update.otherVersion': 'Install another version of {name}',
+  'update.switchConfirm': 'Install {name} {version}? A restart may be needed afterwards.',
+  'update.versionInstalled': 'installed',
+  'update.versionPrerelease': 'pre-release',
+  'update.versionsFailed': 'Could not load versions: {error}',
   'update.downloading': 'Downloading... {percent}%',
   'update.engineAvailable': 'linux-wallpaperengine-kde {version} is available (you have {current}).',
   'update.engineAvailableUnknown': 'linux-wallpaperengine-kde {version} is available, it is newer than your build.',

+ 9 - 0
src/shared/i18n/locales/es.ts

@@ -1066,6 +1066,15 @@ export const es: Messages = {
   'update.checking': 'Comprobando...',
   'update.checksHint': 'Consulta GitHub al iniciar y cada 6 horas. No se descarga nada hasta que pulses Actualizar.',
   'update.dismiss': 'Descartar',
+  'update.chooseVersion': 'Elegir versión...',
+  'update.dontShowAgain': 'No volver a mostrar para esta versión',
+  'update.installVersion': 'Instalar',
+  'update.noVersions': 'No se encontraron versiones.',
+  'update.otherVersion': 'Instalar otra versión de {name}',
+  'update.switchConfirm': '¿Instalar {name} {version}? Puede que luego haga falta reiniciar.',
+  'update.versionInstalled': 'instalada',
+  'update.versionPrerelease': 'versión preliminar',
+  'update.versionsFailed': 'No se pudieron cargar las versiones: {error}',
   'update.downloading': 'Descargando... {percent}%',
   'update.engineAvailable': 'linux-wallpaperengine-kde {version} está disponible (tienes {current}).',
   'update.engineAvailableUnknown': 'linux-wallpaperengine-kde {version} está disponible y es más reciente que tu compilación.',

+ 9 - 0
src/shared/i18n/locales/fr.ts

@@ -1066,6 +1066,15 @@ export const fr: Messages = {
   'update.checking': 'Vérification...',
   'update.checksHint': 'Interroge GitHub au démarrage et toutes les 6 heures. Rien n\'est téléchargé avant de cliquer sur Mettre à jour.',
   'update.dismiss': 'Ignorer',
+  'update.chooseVersion': 'Choisir une version...',
+  'update.dontShowAgain': 'Ne plus afficher pour cette version',
+  'update.installVersion': 'Installer',
+  'update.noVersions': 'Aucune version trouvée.',
+  'update.otherVersion': 'Installer une autre version de {name}',
+  'update.switchConfirm': 'Installer {name} {version} ? Un redémarrage peut être nécessaire ensuite.',
+  'update.versionInstalled': 'installée',
+  'update.versionPrerelease': 'préversion',
+  'update.versionsFailed': 'Impossible de charger les versions : {error}',
   'update.downloading': 'Téléchargement... {percent} %',
   'update.engineAvailable': 'linux-wallpaperengine-kde {version} est disponible (vous avez {current}).',
   'update.engineAvailableUnknown': 'linux-wallpaperengine-kde {version} est disponible, plus récent que votre build.',

+ 9 - 0
src/shared/i18n/locales/it.ts

@@ -1066,6 +1066,15 @@ export const it: Messages = {
   'update.checking': 'Controllo in corso...',
   'update.checksHint': 'Controlla GitHub all\'avvio e ogni 6 ore. Non viene scaricato nulla finché non clicchi Aggiorna.',
   'update.dismiss': 'Ignora',
+  'update.chooseVersion': 'Scegli versione...',
+  'update.dontShowAgain': 'Non mostrare più per questa versione',
+  'update.installVersion': 'Installa',
+  'update.noVersions': 'Nessuna versione trovata.',
+  'update.otherVersion': 'Installa un\'altra versione di {name}',
+  'update.switchConfirm': 'Installare {name} {version}? Potrebbe servire un riavvio.',
+  'update.versionInstalled': 'installata',
+  'update.versionPrerelease': 'pre-release',
+  'update.versionsFailed': 'Impossibile caricare le versioni: {error}',
   'update.downloading': 'Download in corso... {percent}%',
   'update.engineAvailable': 'linux-wallpaperengine-kde {version} è disponibile (hai la {current}).',
   'update.engineAvailableUnknown': 'linux-wallpaperengine-kde {version} è disponibile, più recente della tua build.',

+ 9 - 0
src/shared/i18n/locales/ja.ts

@@ -1024,6 +1024,15 @@ export const ja: Messages = {
   'update.checking': '確認中...',
   'update.checksHint': '起動時と 6 時間ごとに GitHub を確認します。「更新」を押すまで何もダウンロードしません。',
   'update.dismiss': '閉じる',
+  'update.chooseVersion': 'バージョンを選択...',
+  'update.dontShowAgain': 'このバージョンでは今後表示しない',
+  'update.installVersion': 'インストール',
+  'update.noVersions': 'バージョンが見つかりません。',
+  'update.otherVersion': '{name} の別のバージョンをインストール',
+  'update.switchConfirm': '{name} {version} をインストールしますか? 後で再起動が必要になる場合があります。',
+  'update.versionInstalled': 'インストール済み',
+  'update.versionPrerelease': 'プレリリース',
+  'update.versionsFailed': 'バージョンを読み込めませんでした: {error}',
   'update.downloading': 'ダウンロード中... {percent}%',
   'update.engineAvailable': 'linux-wallpaperengine-kde {version} が利用可能です (現在 {current})。',
   'update.engineAvailableUnknown': 'linux-wallpaperengine-kde {version} が利用可能です。お使いのビルドより新しいバージョンです。',

+ 9 - 0
src/shared/i18n/locales/ko.ts

@@ -1024,6 +1024,15 @@ export const ko: Messages = {
   'update.checking': '확인 중...',
   'update.checksHint': '시작할 때와 6시간마다 GitHub를 확인합니다. 업데이트를 누르기 전에는 아무것도 내려받지 않습니다.',
   'update.dismiss': '닫기',
+  'update.chooseVersion': '버전 선택...',
+  'update.dontShowAgain': '이 버전은 다시 표시하지 않기',
+  'update.installVersion': '설치',
+  'update.noVersions': '버전을 찾을 수 없습니다.',
+  'update.otherVersion': '{name}의 다른 버전 설치',
+  'update.switchConfirm': '{name} {version}을(를) 설치할까요? 이후 다시 시작해야 할 수 있습니다.',
+  'update.versionInstalled': '설치됨',
+  'update.versionPrerelease': '프리릴리스',
+  'update.versionsFailed': '버전을 불러오지 못했습니다: {error}',
   'update.downloading': '다운로드 중... {percent}%',
   'update.engineAvailable': 'linux-wallpaperengine-kde {version}을(를) 사용할 수 있습니다 (현재 {current}).',
   'update.engineAvailableUnknown': 'linux-wallpaperengine-kde {version}을(를) 사용할 수 있습니다. 현재 빌드보다 최신입니다.',

+ 9 - 0
src/shared/i18n/locales/pl.ts

@@ -1150,6 +1150,15 @@ export const pl: Messages = {
   'update.checking': 'Sprawdzanie...',
   'update.checksHint': 'Sprawdza GitHub przy starcie i co 6 godzin. Nic nie jest pobierane, dopóki nie klikniesz Aktualizuj.',
   'update.dismiss': 'Odrzuć',
+  'update.chooseVersion': 'Wybierz wersję...',
+  'update.dontShowAgain': 'Nie pokazuj ponownie dla tej wersji',
+  'update.installVersion': 'Zainstaluj',
+  'update.noVersions': 'Nie znaleziono wersji.',
+  'update.otherVersion': 'Zainstaluj inną wersję {name}',
+  'update.switchConfirm': 'Zainstalować {name} {version}? Potem może być potrzebny restart.',
+  'update.versionInstalled': 'zainstalowana',
+  'update.versionPrerelease': 'wersja wstępna',
+  'update.versionsFailed': 'Nie udało się wczytać wersji: {error}',
   'update.downloading': 'Pobieranie... {percent}%',
   'update.engineAvailable': 'Dostępny jest linux-wallpaperengine-kde {version} (masz {current}).',
   'update.engineAvailableUnknown': 'Dostępny jest linux-wallpaperengine-kde {version}, nowszy niż twoja kompilacja.',

+ 9 - 0
src/shared/i18n/locales/pt.ts

@@ -1066,6 +1066,15 @@ export const pt: Messages = {
   'update.checking': 'Verificando...',
   'update.checksHint': 'Consulta o GitHub ao iniciar e a cada 6 horas. Nada é baixado até você clicar em Atualizar.',
   'update.dismiss': 'Dispensar',
+  'update.chooseVersion': 'Escolher versão...',
+  'update.dontShowAgain': 'Não mostrar novamente para esta versão',
+  'update.installVersion': 'Instalar',
+  'update.noVersions': 'Nenhuma versão encontrada.',
+  'update.otherVersion': 'Instalar outra versão de {name}',
+  'update.switchConfirm': 'Instalar {name} {version}? Pode ser necessário reiniciar depois.',
+  'update.versionInstalled': 'instalada',
+  'update.versionPrerelease': 'pré-lançamento',
+  'update.versionsFailed': 'Não foi possível carregar as versões: {error}',
   'update.downloading': 'Baixando... {percent}%',
   'update.engineAvailable': 'O linux-wallpaperengine-kde {version} está disponível (você tem a {current}).',
   'update.engineAvailableUnknown': 'O linux-wallpaperengine-kde {version} está disponível e é mais novo que a sua build.',

+ 9 - 0
src/shared/i18n/locales/ru.ts

@@ -1150,6 +1150,15 @@ export const ru: Messages = {
   'update.checking': 'Проверка...',
   'update.checksHint': 'Проверяет GitHub при запуске и каждые 6 часов. Ничего не скачивается, пока вы не нажмёте «Обновить».',
   'update.dismiss': 'Скрыть',
+  'update.chooseVersion': 'Выбрать версию...',
+  'update.dontShowAgain': 'Больше не показывать для этой версии',
+  'update.installVersion': 'Установить',
+  'update.noVersions': 'Версии не найдены.',
+  'update.otherVersion': 'Установить другую версию {name}',
+  'update.switchConfirm': 'Установить {name} {version}? Потом может понадобиться перезапуск.',
+  'update.versionInstalled': 'установлена',
+  'update.versionPrerelease': 'предварительная',
+  'update.versionsFailed': 'Не удалось загрузить версии: {error}',
   'update.downloading': 'Загрузка... {percent}%',
   'update.engineAvailable': 'Доступен linux-wallpaperengine-kde {version} (у вас {current}).',
   'update.engineAvailableUnknown': 'Доступен linux-wallpaperengine-kde {version}, он новее вашей сборки.',

+ 9 - 0
src/shared/i18n/locales/tr.ts

@@ -1066,6 +1066,15 @@ export const tr: Messages = {
   'update.checking': 'Denetleniyor...',
   'update.checksHint': 'Başlangıçta ve 6 saatte bir GitHub\'ı kontrol eder. Güncelle\'ye tıklamadan hiçbir şey indirilmez.',
   'update.dismiss': 'Kapat',
+  'update.chooseVersion': 'Sürüm seç...',
+  'update.dontShowAgain': 'Bu sürüm için bir daha gösterme',
+  'update.installVersion': 'Yükle',
+  'update.noVersions': 'Sürüm bulunamadı.',
+  'update.otherVersion': '{name} için başka bir sürüm yükle',
+  'update.switchConfirm': '{name} {version} yüklensin mi? Sonrasında yeniden başlatmak gerekebilir.',
+  'update.versionInstalled': 'yüklü',
+  'update.versionPrerelease': 'ön sürüm',
+  'update.versionsFailed': 'Sürümler yüklenemedi: {error}',
   'update.downloading': 'İndiriliyor... %{percent}',
   'update.engineAvailable': 'linux-wallpaperengine-kde {version} mevcut (sizdeki: {current}).',
   'update.engineAvailableUnknown': 'linux-wallpaperengine-kde {version} mevcut, derlemenizden daha yeni.',

+ 9 - 0
src/shared/i18n/locales/zh-CN.ts

@@ -1024,6 +1024,15 @@ export const zhCN: Messages = {
   'update.checking': '正在检查...',
   'update.checksHint': '启动时及每 6 小时检查一次 GitHub。点击“更新”之前不会下载任何内容。',
   'update.dismiss': '忽略',
+  'update.chooseVersion': '选择版本...',
+  'update.dontShowAgain': '此版本不再提示',
+  'update.installVersion': '安装',
+  'update.noVersions': '未找到版本。',
+  'update.otherVersion': '安装 {name} 的其他版本',
+  'update.switchConfirm': '安装 {name} {version}?之后可能需要重新启动。',
+  'update.versionInstalled': '已安装',
+  'update.versionPrerelease': '预发布',
+  'update.versionsFailed': '无法加载版本:{error}',
   'update.downloading': '正在下载... {percent}%',
   'update.engineAvailable': 'linux-wallpaperengine-kde {version} 已发布(当前 {current})。',
   'update.engineAvailableUnknown': 'linux-wallpaperengine-kde {version} 已发布,比你的构建更新。',

+ 9 - 0
src/shared/i18n/locales/zh-TW.ts

@@ -1024,6 +1024,15 @@ export const zhTW: Messages = {
   'update.checking': '正在檢查...',
   'update.checksHint': '啟動時及每 6 小時檢查一次 GitHub。點擊「更新」之前不會下載任何內容。',
   'update.dismiss': '略過',
+  'update.chooseVersion': '選擇版本...',
+  'update.dontShowAgain': '此版本不再提示',
+  'update.installVersion': '安裝',
+  'update.noVersions': '找不到版本。',
+  'update.otherVersion': '安裝 {name} 的其他版本',
+  'update.switchConfirm': '安裝 {name} {version}?之後可能需要重新啟動。',
+  'update.versionInstalled': '已安裝',
+  'update.versionPrerelease': '預先發行',
+  'update.versionsFailed': '無法載入版本:{error}',
   'update.downloading': '正在下載... {percent}%',
   'update.engineAvailable': 'linux-wallpaperengine-kde {version} 已推出(目前 {current})。',
   'update.engineAvailableUnknown': 'linux-wallpaperengine-kde {version} 已推出,比你的建置更新。',

+ 1 - 0
src/shared/ipc-channels.ts

@@ -173,6 +173,7 @@ export const IpcChannels = {
   UPDATES_CHECK: 'updates:check',
   UPDATES_DISMISS: 'updates:dismiss',
   UPDATES_INSTALL_APP: 'updates:install-app',
+  UPDATES_VERSIONS: 'updates:versions',
   UPDATES_RESTART: 'updates:restart',
 
   DIAGNOSTICS_COLLECT: 'diagnostics:collect',

+ 14 - 0
src/shared/types.ts

@@ -549,9 +549,17 @@ export interface AvailableUpdate {
   publishedAt: string
 }
 
+export interface ReleaseChoice {
+  tag: string
+  publishedAt: string
+  prerelease: boolean
+}
+
 export interface AppUpdateProgress {
   stage: 'downloading' | 'installing' | 'ready' | 'error'
   percentage: number
+  /** Release tag being installed, so a notice for another version ignores it */
+  version?: string
   message?: string
 }
 
@@ -559,6 +567,7 @@ export interface UpdateStatus {
   checks: UpdateChecks | null
   checking: boolean
   checkedAt: number | null
+  checked: UpdateChecks
   error: string | null
   appVersion: string
   appInstall: AppInstallKind
@@ -566,8 +575,13 @@ export interface UpdateStatus {
   appProgress: AppUpdateProgress | null
   engineInstall: EngineInstallKind | null
   engineManagedBy?: string
+  /** Installed engine version when known (prebuilt tag, package version) */
+  engineVersion: string | null
   engine: AvailableUpdate | null
+  /** "Don't notify me again", kept in the config */
   dismissed: Partial<Record<UpdateTarget, string>>
+  /** Closed with the X, back after the next start */
+  snoozed: Partial<Record<UpdateTarget, string>>
 }
 
 export interface BackupProgressEvent {