feat(profiles): add setting to toggle project switcher on main page

Add a show/hide toggle for the header project profile switcher under
the Homepage Display section in settings. Defaults to visible so
existing users keep the current behavior.
This commit is contained in:
Jason
2026-07-10 11:04:59 +08:00
parent 7479d10db7
commit 442799879d
8 changed files with 40 additions and 12 deletions
+9 -8
View File
@@ -1263,14 +1263,15 @@ function App() {
)}
</div>
)}
{currentView === "providers" && (
<div
className="flex shrink-0 items-center"
style={{ WebkitAppRegion: "no-drag" } as any}
>
<ProfileSwitcher activeApp={activeApp} />
</div>
)}
{currentView === "providers" &&
(settingsData?.showProfileSwitcher ?? true) && (
<div
className="flex shrink-0 items-center"
style={{ WebkitAppRegion: "no-drag" } as any}
>
<ProfileSwitcher activeApp={activeApp} />
</div>
)}
<div
ref={toolbarRef}
className="flex flex-1 min-w-0 overflow-x-hidden items-center py-4 pr-2"
@@ -1,5 +1,7 @@
import { useTranslation } from "react-i18next";
import { FolderOpen } from "lucide-react";
import { Button } from "@/components/ui/button";
import { ToggleRow } from "@/components/ui/toggle-row";
import { cn } from "@/lib/utils";
import { ProviderIcon } from "@/components/ProviderIcon";
import type { SettingsFormState } from "@/hooks/useSettings";
@@ -91,6 +93,13 @@ export function AppVisibilitySettings({
);
})}
</div>
<ToggleRow
icon={<FolderOpen className="h-4 w-4 text-emerald-500" />}
title={t("settings.appVisibility.showProfileSwitcher")}
description={t("settings.appVisibility.showProfileSwitcherDescription")}
checked={settings.showProfileSwitcher ?? true}
onCheckedChange={(value) => onChange({ showProfileSwitcher: value })}
/>
</section>
);
}
+3 -1
View File
@@ -697,7 +697,9 @@
"claudeDesc": "Anthropic Claude Code CLI",
"codexDesc": "OpenAI Codex CLI",
"geminiDesc": "Google Gemini CLI",
"opencodeDesc": "OpenCode CLI"
"opencodeDesc": "OpenCode CLI",
"showProfileSwitcher": "Show project switcher",
"showProfileSwitcherDescription": "Show the project switcher in the main page header"
},
"skillStorage": {
"title": "Skill Storage Location",
+3 -1
View File
@@ -697,7 +697,9 @@
"claudeDesc": "Anthropic Claude Code CLI",
"codexDesc": "OpenAI Codex CLI",
"geminiDesc": "Google Gemini CLI",
"opencodeDesc": "OpenCode CLI"
"opencodeDesc": "OpenCode CLI",
"showProfileSwitcher": "プロジェクト切り替えを表示",
"showProfileSwitcherDescription": "メイン画面上部にプロジェクト切り替えを表示します"
},
"skillStorage": {
"title": "スキル保存場所",
+3 -1
View File
@@ -697,7 +697,9 @@
"claudeDesc": "Anthropic Claude Code CLI",
"codexDesc": "OpenAI Codex CLI",
"geminiDesc": "Google Gemini CLI",
"opencodeDesc": "OpenCode CLI"
"opencodeDesc": "OpenCode CLI",
"showProfileSwitcher": "顯示專案切換",
"showProfileSwitcherDescription": "在主頁面頂部顯示專案切換入口"
},
"skillStorage": {
"title": "Skills 儲存位置",
+3 -1
View File
@@ -697,7 +697,9 @@
"claudeDesc": "Anthropic Claude Code CLI",
"codexDesc": "OpenAI Codex CLI",
"geminiDesc": "Google Gemini CLI",
"opencodeDesc": "OpenCode CLI"
"opencodeDesc": "OpenCode CLI",
"showProfileSwitcher": "显示项目切换",
"showProfileSwitcherDescription": "在主页面顶部显示项目切换入口"
},
"skillStorage": {
"title": "Skills 存储位置",
+2
View File
@@ -375,6 +375,8 @@ export interface Settings {
streamCheckConfirmed?: boolean;
// Whether to show the failover toggle independently on the main page
enableFailoverToggle?: boolean;
// Whether to show the project profile switcher on the main page header
showProfileSwitcher?: boolean;
// Preserve Codex ChatGPT login in auth.json when switching third-party providers
preserveCodexOfficialAuthOnSwitch?: boolean;
// Run official Codex under the shared "custom" provider id so future