Skip to content

DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.

fix(about): 修复桌面关于信息的字段读取 (#979)

SkanderBot6c19631fd31d
diff --git a/src/store/modules/desktop-updater/types.ts b/src/store/modules/desktop-updater/types.ts
index 9f497cb2..40624f74 100644
--- a/src/store/modules/desktop-updater/types.ts
+++ b/src/store/modules/desktop-updater/types.ts
@@ -24,8 +24,8 @@ export interface DesktopDownloadProgress {
/** Rust 侧 get_desktop_about 返回的关于信息 */
export interface DesktopAboutInfo {
version: string
- published_at: string
+ publishedAt: string
copyright: string
repo: string
- powered_by: string
+ poweredBy: string
}
diff --git a/src/ui/dialog/about.test.tsx b/src/ui/dialog/about.test.tsx
new file mode 100644
index 00000000..a53db032
--- /dev/null
+++ b/src/ui/dialog/about.test.tsx
@@ -0,0 +1,65 @@
+// @vitest-environment jsdom
+import { OverlaysProvider, useOverlay } from '@overlastic/react'
+import { cleanup, fireEvent, render, screen } from '@testing-library/react'
+import { StrictMode } from 'react'
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
+import { DesktopAboutDialog } from './about'
+
+const { desktopUpdater } = vi.hoisted(() => ({
+ desktopUpdater: {
+ about: {
+ version: '0.22.4',
+ publishedAt: '2026-10-07T18:09:41Z',
+ copyright: 'Copyright test',
+ repo: 'https://github.com/dsh-tauri/deepseek-harness-desktop',
+ poweredBy: 'DSH Tauri',
+ },
+ loadAbout: vi.fn(),
+ },
+}))
+
+vi.mock('@/store', () => ({ store: { desktopUpdater } }))
+vi.mock('valtio-define', () => ({ useStore: (value: unknown) => value }))
+vi.mock('react-i18next', () => ({ useTranslation: () => ({ t: (key: string) => key }) }))
+
+function Launcher() {
+ const open = useOverlay(DesktopAboutDialog)
+ function handleOpen() {
+ void open().catch(() => {})
+ }
+ return <button onClick={handleOpen}>Open about</button>
+}
+
+function openDialog() {
+ render(<StrictMode><OverlaysProvider><Launcher /></OverlaysProvider></StrictMode>)
+ fireEvent.click(screen.getByText('Open about'))
+}
+
+beforeEach(() => {
+ desktopUpdater.about.publishedAt = '2026-10-07T18:09:41Z'
+ desktopUpdater.loadAbout.mockReset()
+})
+
+afterEach(() => {
+ cleanup()
+ vi.restoreAllMocks()
+})
+
+describe('desktop about native payload', () => {
+ it('renders the product name returned by the native command', async () => {
+ openDialog()
+ expect((await screen.findByText('DSH Tauri')).textContent).toBe('DSH Tauri')
+ })
+
+ it('renders the release date returned by the native command', async () => {
+ vi.spyOn(Date.prototype, 'toLocaleDateString').mockReturnValue('October 7, 2026')
+ openDialog()
+ expect((await screen.findByText('October 7, 2026')).textContent).toBe('October 7, 2026')
+ })
+
+ it('keeps an unavailable release date as a placeholder', async () => {
+ desktopUpdater.about.publishedAt = ''
+ openDialog()
+ expect((await screen.findByText('-')).textContent).toBe('-')
+ })
+})
diff --git a/src/ui/dialog/about.tsx b/src/ui/dialog/about.tsx
index e1e52ac3..a055af25 100644
--- a/src/ui/dialog/about.tsx
+++ b/src/ui/dialog/about.tsx
@@ -39,7 +39,7 @@ export function DesktopAboutDialog(props: DesktopAboutDialogProps) {
<img src="/favicon.svg" alt={t('about.title')} className="w-12 h-12 rounded-md" />
<div className="text-base font-semibold text-ink">
- {about?.powered_by ?? 'DeepSeek Harness Desktop'}
+ {about?.poweredBy ?? 'DeepSeek Harness Desktop'}
</div>
<Description className="text-xs">
{t('about.powered_by')}
@@ -47,7 +47,7 @@ export function DesktopAboutDialog(props: DesktopAboutDialogProps) {
</div>
<div className="space-y-1.5 border-t border-line/40 pt-3">
<Info term={t('ui.current_version')}>{about?.version ?? '-'}</Info>
- <Info term={t('about.release_date')}>{about?.published_at ? formatDate(about.published_at) : '-'}</Info>
+ <Info term={t('about.release_date')}>{about?.publishedAt ? formatDate(about.publishedAt) : '-'}</Info>
<div className="flex items-center justify-between text-sm border-t border-line/40 pt-2 ">
<span className="text-muted">{t('about.source_code')}</span>
<Button