feat(settings): add app visibility settings

Allow users to choose which apps (Claude, Codex, Gemini, OpenCode) to display on the homepage.

- Add VisibleApps type and settings field in both frontend and backend
- Refactor AppSwitcher to render apps dynamically based on visibility
- Extract ToggleRow component for reuse
- Add i18n support for app visibility settings
This commit is contained in:
Jason
2026-01-20 16:03:49 +08:00
parent 30009ad5f1
commit eab1d08527
10 changed files with 182 additions and 136 deletions
+11
View File
@@ -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;