mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-29 09:37:37 +08:00
feat(profiles): include Claude Desktop provider in project profiles
Claude Desktop's only dimension managed by cc-switch is its provider (MCP/Skills are hardcoded unsupported and prompts have no live file), so snapshots capture just the current desktop provider while the empty MCP/Skills sets and None prompt make apply a natural no-op for the other dimensions - no per-dimension special casing needed. - Add claude-desktop slot to PROFILE_APPS and PerApp (serde key uses the hyphenated app id); old payloads without the key deserialize to None and leave Claude Desktop untouched on apply - Gate the tray Projects submenu by iterating PROFILE_APPS instead of hardcoding Claude/Codex visibility - Show the profile switcher on the Claude Desktop tab, mirror the PerApp type, invalidate the claude-desktop providers cache on apply, and extend the switcher tooltip in all four locales - Extend the roundtrip integration test with the desktop provider dimension; the desktop switch is cfg-gated to macOS/Windows because desktop live writes error on Linux where CI runs cargo test
This commit is contained in:
@@ -42,7 +42,7 @@ import {
|
||||
import { ProfileManageDialog } from "./ProfileManageDialog";
|
||||
|
||||
/** 后端 services/profile.rs 的 PROFILE_APPS 前端镜像,扩展支持范围时两处同步 */
|
||||
const PROFILE_SUPPORTED_APPS: AppId[] = ["claude", "codex"];
|
||||
const PROFILE_SUPPORTED_APPS: AppId[] = ["claude", "claude-desktop", "codex"];
|
||||
|
||||
interface ProfileSwitcherProps {
|
||||
activeApp: AppId;
|
||||
@@ -51,8 +51,8 @@ interface ProfileSwitcherProps {
|
||||
/**
|
||||
* 项目 Profile 切换器(header 左侧入口)
|
||||
*
|
||||
* Profile 是跨应用的配置快照(Claude Code + Codex 的供应商/MCP/Skills/记忆文件),
|
||||
* 与右侧 AppSwitcher(仅切换查看的应用)语义不同。
|
||||
* Profile 是跨应用的配置快照(Claude Code + Codex 的供应商/MCP/Skills/记忆文件,
|
||||
* 以及 Claude Desktop 的供应商),与右侧 AppSwitcher(仅切换查看的应用)语义不同。
|
||||
*/
|
||||
export function ProfileSwitcher({ activeApp }: ProfileSwitcherProps) {
|
||||
const { t } = useTranslation();
|
||||
@@ -66,7 +66,7 @@ export function ProfileSwitcher({ activeApp }: ProfileSwitcherProps) {
|
||||
const clearMutation = useClearProfileMutation();
|
||||
const createMutation = useCreateProfileMutation();
|
||||
|
||||
// Profile 仅作用于 Claude Code + Codex——在其他应用的标签页展示会误导用户
|
||||
// Profile 仅作用于受支持的应用——在其他应用的标签页展示会误导用户
|
||||
// 以为当前应用也被切换了,因此只在受支持应用的页面渲染
|
||||
if (!PROFILE_SUPPORTED_APPS.includes(activeApp)) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user