diff --git a/openless-all/app/src/lib/ipc.ts b/openless-all/app/src/lib/ipc.ts index 96adf2e7..8841f7dc 100644 --- a/openless-all/app/src/lib/ipc.ts +++ b/openless-all/app/src/lib/ipc.ts @@ -14,10 +14,12 @@ import type { PolishMode, QaHotkeyBinding, ShortcutBinding, + UpdateChannel, UserPreferences, WindowsImeStatus, VocabPresetStore, } from './types'; +export type { UpdateChannel } from './types'; import { OL_DATA } from './mockData'; import { defaultAppShortcutModifiers, defaultQaShortcut, formatComboLabel } from './hotkey'; @@ -76,6 +78,7 @@ const mockSettings: UserPreferences = { historyRetentionDays: 7, polishContextWindowMinutes: 5, startMinimized: false, + updateChannel: 'stable', }; const mockHotkeyCapability: HotkeyCapability = { @@ -159,7 +162,8 @@ export function setSettings(prefs: UserPreferences): Promise { // ── Release channel (Beta opt-in) ────────────────────────────────────── // 渠道偏好与 fetch_latest_beta_release 实际效果只在 Tauri runtime 内有意义; // 浏览器开发模式下走 mock,避免设置页因 invoke 抛错而白屏。 -export type UpdateChannel = 'stable' | 'beta'; +// UpdateChannel 类型搬到 types.ts(UserPreferences.updateChannel 字段使用), +// 这里 re-export 保持外部模块(SettingsModal 等)import 路径不变。 export interface LatestBetaRelease { tagName: string; diff --git a/openless-all/app/src/lib/stylePrefs.test.ts b/openless-all/app/src/lib/stylePrefs.test.ts index 621da4e3..a9704484 100644 --- a/openless-all/app/src/lib/stylePrefs.test.ts +++ b/openless-all/app/src/lib/stylePrefs.test.ts @@ -48,6 +48,7 @@ const previousPrefs: UserPreferences = { historyRetentionDays: 7, polishContextWindowMinutes: 5, startMinimized: false, + updateChannel: 'stable', }; const nextPrefs: UserPreferences = { diff --git a/openless-all/app/src/lib/types.ts b/openless-all/app/src/lib/types.ts index b946ff0e..fccbaddc 100644 --- a/openless-all/app/src/lib/types.ts +++ b/openless-all/app/src/lib/types.ts @@ -115,6 +115,10 @@ export interface WindowsImeStatus { dllPath: string | null; } +/** Auto-update 渠道偏好。stable = 跟正式版(默认);beta = Settings 里多一个 + * 手动下载 Beta 的入口。不影响 plugin-updater 的自动检查路径。 */ +export type UpdateChannel = 'stable' | 'beta'; + export interface UserPreferences { hotkey: HotkeyBinding; dictationHotkey: ShortcutBinding; @@ -174,6 +178,9 @@ export interface UserPreferences { /** 启动时静默运行(不弹主窗口)。Windows 开机自启场景常用——只想要后台 + 托盘, * 不想被主窗口打扰。开后所有启动路径都不弹窗,从菜单栏 / 托盘进入主窗口。默认 false。 */ startMinimized: boolean; + /** 自动更新渠道。'stable'(默认)= plugin-updater 仅检查正式版; + * 'beta' = Settings → About 出现手动下载 Beta 的入口。 */ + updateChannel: UpdateChannel; } export interface MicrophoneDevice {