feat: improve desktop reliability and customization

Address reliability and consistency gaps across Agent Runtimes, persistence, settings, Knowledge, Magic Notes, Smart Heartbeat, and the download site. Runtime processes now have bounded lifecycle cleanup and atomic configuration rollback, while model packages and persisted mutations recover safely.

Add a configurable global shortcut, protect unsaved work, improve modal and keyboard behavior, localize the built-in project without rewriting stored data, and lazy-load heavy renderer routes under enforced bundle budgets. Align project forms and disabled controls with shared typography and interaction states, and strengthen website release metadata validation and navigation accessibility.

Release note: 修复 Runtime、设置、知识库、魔法笔记与智能心跳中的可靠性和交互一致性问题;新增可配置全局快捷键,改进无障碍与加载性能,并强化官网下载校验。
This commit is contained in:
mesalogo
2026-08-20 10:11:06 +08:00
parent 20c15f74c6
commit f44a0dc907
129 changed files with 15511 additions and 2112 deletions
+79
View File
@@ -0,0 +1,79 @@
import { mkdtemp, readFile, rm } from 'node:fs/promises'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { afterEach, describe, expect, it } from 'vitest'
import {
defaultGlobalShortcutSettings
} from '../shared/shortcut'
import { ShortcutSettingsStore } from './shortcut-settings-store'
const directories: string[] = []
afterEach(async () => {
await Promise.all(
directories.splice(0).map((directory) =>
rm(directory, { recursive: true, force: true })
)
)
})
async function createStore(): Promise<{
filePath: string
store: ShortcutSettingsStore
}> {
const directory = await mkdtemp(join(tmpdir(), 'goodbuddy-shortcut-'))
directories.push(directory)
const filePath = join(directory, 'shortcut-settings.json')
return { filePath, store: new ShortcutSettingsStore(filePath) }
}
describe('ShortcutSettingsStore', () => {
it('preserves the legacy shortcut as the non-persisted default', async () => {
const { filePath, store } = await createStore()
await expect(store.get()).resolves.toEqual(
defaultGlobalShortcutSettings
)
await expect(readFile(filePath, 'utf8')).rejects.toMatchObject({
code: 'ENOENT'
})
})
it('persists a validated versioned shortcut and reloads it', async () => {
const { filePath, store } = await createStore()
await expect(
store.update({
enabled: false,
accelerator: 'ctrl+alt+k'
})
).resolves.toEqual({
enabled: false,
accelerator: 'Control+Alt+K'
})
expect(JSON.parse(await readFile(filePath, 'utf8'))).toEqual({
version: 1,
enabled: false,
accelerator: 'Control+Alt+K'
})
await expect(
new ShortcutSettingsStore(filePath).get()
).resolves.toEqual({
enabled: false,
accelerator: 'Control+Alt+K'
})
})
it('rejects invalid accelerators without replacing saved state', async () => {
const { filePath, store } = await createStore()
await store.update({
enabled: true,
accelerator: 'Control+Alt+K'
})
const saved = await readFile(filePath, 'utf8')
await expect(
store.update({ enabled: true, accelerator: 'K' })
).rejects.toThrow()
expect(await readFile(filePath, 'utf8')).toBe(saved)
})
})