Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion openless-all/app/src/lib/ipc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -76,6 +78,7 @@ const mockSettings: UserPreferences = {
historyRetentionDays: 7,
polishContextWindowMinutes: 5,
startMinimized: false,
updateChannel: 'stable',
};

const mockHotkeyCapability: HotkeyCapability = {
Expand Down Expand Up @@ -159,7 +162,8 @@ export function setSettings(prefs: UserPreferences): Promise<void> {
// ── 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;
Expand Down
1 change: 1 addition & 0 deletions openless-all/app/src/lib/stylePrefs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const previousPrefs: UserPreferences = {
historyRetentionDays: 7,
polishContextWindowMinutes: 5,
startMinimized: false,
updateChannel: 'stable',
};

const nextPrefs: UserPreferences = {
Expand Down
7 changes: 7 additions & 0 deletions openless-all/app/src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -174,6 +178,9 @@ export interface UserPreferences {
/** 启动时静默运行(不弹主窗口)。Windows 开机自启场景常用——只想要后台 + 托盘,
* 不想被主窗口打扰。开后所有启动路径都不弹窗,从菜单栏 / 托盘进入主窗口。默认 false。 */
startMinimized: boolean;
/** 自动更新渠道。'stable'(默认)= plugin-updater 仅检查正式版;
* 'beta' = Settings → About 出现手动下载 Beta 的入口。 */
updateChannel: UpdateChannel;
}

export interface MicrophoneDevice {
Expand Down
Loading