Skip to content

The agent that grows with you

fix(desktop): preserve stable update channel context

KoNit-Kb207765e4cc5
diff --git a/apps/desktop/src/app/command-palette/index.tsx b/apps/desktop/src/app/command-palette/index.tsx
index 310c3162e29..892ec04edf2 100644
--- a/apps/desktop/src/app/command-palette/index.tsx
+++ b/apps/desktop/src/app/command-palette/index.tsx
@@ -606,7 +606,9 @@ function CommandPaletteBody({ onExited }: { onExited: () => void }) {
return resolveVersionStatus({
applying: apply.applying || apply.stage === 'restart',
behind: status?.behind ?? 0,
+ channel: status?.channel === 'stable' ? 'stable' : 'main',
copy: t.shell.statusbar,
+ latestTag: status?.latestTag,
remote: backend,
restarting: apply.stage === 'restart',
sha: status?.currentSha?.slice(0, 7) ?? null,
diff --git a/apps/desktop/src/app/shell/hooks/use-statusbar-items.test.tsx b/apps/desktop/src/app/shell/hooks/use-statusbar-items.test.tsx
index a7758f40552..70334f0b834 100644
--- a/apps/desktop/src/app/shell/hooks/use-statusbar-items.test.tsx
+++ b/apps/desktop/src/app/shell/hooks/use-statusbar-items.test.tsx
@@ -1,4 +1,4 @@
-import { renderHook } from '@testing-library/react'
+import { act, renderHook } from '@testing-library/react'
import type { WritableAtom } from 'nanostores'
import { isValidElement, type ReactNode } from 'react'
import { MemoryRouter } from 'react-router'
@@ -23,6 +23,7 @@ import {
import { $focusedTreePaneId as $focusedTreePaneIdMock } from '@/store/session-focus'
import { $sessionStates, $sessionTiles } from '@/store/session-states'
import { $statusbarVisible } from '@/store/statusbar-prefs'
+import { $desktopVersion, $updateStatus } from '@/store/updates'
import type { FreeTierStatus } from '@/types/hermes'
import { useStatusbarItems } from './use-statusbar-items'
@@ -125,6 +126,28 @@ afterEach(() => {
$sessions.set([])
$sessionStartedAt.set(null)
$tileSessionFocusStartedAt.set(null)
+ $desktopVersion.set(null)
+ $updateStatus.set(null)
+})
+
+describe('statusbar update channel vocabulary', () => {
+ it('names a stable release update without presenting its commit distance', () => {
+ act(() => {
+ $desktopVersion.set({ appVersion: '0.21.6', electronVersion: '37', hermesRoot: '/h', nodeVersion: '22', platform: 'linux' })
+ $updateStatus.set({
+ behind: 4,
+ channel: 'stable',
+ latestTag: 'v0.21.7',
+ supported: true,
+ updateAvailable: true
+ })
+ })
+
+ const version = renderStatusbarItems().statusbarItems.find(item => item.id === 'version-client')
+
+ expect(version?.label).toBe('v0.21.6 (update)')
+ expect(version?.title).toContain('v0.21.7 is available')
+ })
})
describe('statusbar workspace menu — "Open containing folder"', () => {
diff --git a/apps/desktop/src/app/shell/hooks/use-statusbar-items.tsx b/apps/desktop/src/app/shell/hooks/use-statusbar-items.tsx
index 37266e67192..425d8836313 100644
--- a/apps/desktop/src/app/shell/hooks/use-statusbar-items.tsx
+++ b/apps/desktop/src/app/shell/hooks/use-statusbar-items.tsx
@@ -385,7 +385,9 @@ export function useStatusbarItems({
applyMessage: updateApply.message,
behind: updateStatus?.behind ?? 0,
branch: updateStatus?.branch,
+ channel: updateStatus?.channel === 'stable' ? 'stable' : 'main',
copy,
+ latestTag: updateStatus?.latestTag,
remote: connection?.mode === 'remote',
restarting: updateApply.stage === 'restart',
sha: updateStatus?.currentSha?.slice(0, 7) ?? null,
@@ -417,7 +419,9 @@ export function useStatusbarItems({
updateApply.stage,
updateStatus?.behind,
updateStatus?.branch,
+ updateStatus?.channel,
updateStatus?.currentSha,
+ updateStatus?.latestTag,
updateStatus?.updateAvailable
])