feat(desktop): add Update now button to About panel (#50186)

This commit is contained in:
brooklyn! 2026-06-21 11:34:45 -05:00 committed by GitHub
parent 2f4f23fbfb
commit 65a477f12e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 29 additions and 4 deletions

View file

@ -13,7 +13,8 @@ import {
$updateStatus,
checkUpdates,
openUpdatesWindow,
refreshDesktopVersion
refreshDesktopVersion,
startActiveUpdate
} from '@/store/updates'
import { ListRow, SectionHeading, SettingsContent } from './primitives'
@ -141,9 +142,14 @@ export function AboutSettings() {
</Button>
{behind > 0 && supported && !applying && (
<Button onClick={() => openUpdatesWindow()} size="sm">
{a.seeWhatsNew}
</Button>
<>
<Button onClick={() => startActiveUpdate()} size="sm">
{a.updateNow}
</Button>
<Button onClick={() => openUpdatesWindow()} size="sm" variant="textStrong">
{a.seeWhatsNew}
</Button>
</>
)}
<Button asChild className="ml-auto" size="sm" variant="text">

View file

@ -384,6 +384,7 @@ export const en: Translations = {
checkNow: 'Check now',
checking: 'Checking…',
seeWhatsNew: "See what's new",
updateNow: 'Update now',
releaseNotes: 'Release notes',
onLatest: "You're on the latest version.",
installing: 'An update is currently installing.',

View file

@ -506,6 +506,7 @@ export const ja = defineLocale({
checkNow: '今すぐ確認',
checking: '確認中…',
seeWhatsNew: '新機能を見る',
updateNow: '今すぐ更新',
releaseNotes: 'リリースノート',
onLatest: '最新バージョンです。',
installing: '更新をインストール中です。',

View file

@ -281,6 +281,7 @@ export interface Translations {
checkNow: string
checking: string
seeWhatsNew: string
updateNow: string
releaseNotes: string
onLatest: string
installing: string

View file

@ -494,6 +494,7 @@ export const zhHant = defineLocale({
checkNow: '立即檢查',
checking: '檢查中…',
seeWhatsNew: '查看新增內容',
updateNow: '立即更新',
releaseNotes: '發行說明',
onLatest: '你已是最新版本。',
installing: '正在安裝更新。',

View file

@ -582,6 +582,7 @@ export const zh: Translations = {
checkNow: '立即检查',
checking: '检查中…',
seeWhatsNew: '查看新增内容',
updateNow: '立即更新',
releaseNotes: '发行说明',
onLatest: '你已是最新版本。',
installing: '正在安装更新。',

View file

@ -195,6 +195,20 @@ export function openUpdatesWindow(): void {
openUpdateOverlayFor(isRemoteMode() ? 'backend' : 'client')
}
/**
* Start applying the available update for the active target right away. Opens
* the updates overlay first so the user sees apply progress (the overlay
* renders ApplyingView once `applying` flips true), then kicks off the install.
* Used by the "Update now" affordance on the About panel, which would otherwise
* only be able to open the changelog overlay.
*/
export function startActiveUpdate(): void {
const target: UpdateTarget = isRemoteMode() ? 'backend' : 'client'
$updateOverlayTarget.set(target)
$updateOverlayOpen.set(true)
void (target === 'backend' ? applyBackendUpdate() : applyUpdates())
}
/** Re-read the running app's version from the Electron main process and
* publish it on `$desktopVersion`. Called when the About panel mounts, the
* update flow finishes, and the window regains focus, so the About text