diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 205120a56..06ee64564 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -292,8 +292,10 @@ pub fn run() { file_name: Some("cc-switch".into()), }), ]) - // 单文件模式:启动时删除旧文件,达到大小时轮转并保留 1 个 - .rotation_strategy(RotationStrategy::KeepSome(1)) + // 单文件模式:启动时删除旧文件,达到大小时轮转 + // 注意:KeepSome(n) 内部会做 n-2 运算,n=1 会导致 usize 下溢 + // KeepSome(2) 是最小安全值,表示不保留轮转文件 + .rotation_strategy(RotationStrategy::KeepSome(2)) // 单文件大小限制 1GB .max_file_size(1024 * 1024 * 1024) .timezone_strategy(TimezoneStrategy::UseLocal) diff --git a/src/types.ts b/src/types.ts index 9fd73774a..007674302 100644 --- a/src/types.ts +++ b/src/types.ts @@ -137,6 +137,14 @@ export interface ProviderMeta { proxyConfig?: ProviderProxyConfig; } +// 主页面显示的应用配置 +export interface VisibleApps { + claude: boolean; + codex: boolean; + gemini: boolean; + opencode: boolean; +} + // 应用设置类型(用于设置对话框与 Tauri API) // 存储在本地 ~/.cc-switch/settings.json,不随数据库同步 export interface Settings { @@ -154,6 +162,9 @@ export interface Settings { // 首选语言(可选,默认中文) language?: "en" | "zh" | "ja"; + // 主页面显示的应用(默认全部显示) + visibleApps?: VisibleApps; + // ===== 设备级目录覆盖 ===== // 覆盖 Claude Code 配置目录(可选) claudeConfigDir?: string;