From 06a19519c57c81f703a14ec697fc8a2eec08493b Mon Sep 17 00:00:00 2001 From: Jason Date: Sun, 31 Aug 2025 18:14:31 +0800 Subject: [PATCH] revert: restore app/appType param compatibility and revert segmented-thumb pointer-events change - Restore backend commands to accept app_type/app/appType with priority app_type - Frontend invoke() now passes both { app_type, app } again - Revert CSS change that set pointer-events: none on segmented-thumb - Keep minor fix: open_config_folder signature uses handle + respects both names Note: warnings for non_snake_case (appType) are expected for compatibility. --- src-tauri/src/commands.rs | 8 ++++---- src/App.css | 4 +++- src/App.tsx | 10 ++++------ src/components/ProviderForm.tsx | 16 +++++++++------- src/config/codexProviderPresets.ts | 5 ++--- src/lib/tauri-api.ts | 11 +++++++++-- 6 files changed, 31 insertions(+), 23 deletions(-) diff --git a/src-tauri/src/commands.rs b/src-tauri/src/commands.rs index 92921e9..ecbab8c 100644 --- a/src-tauri/src/commands.rs +++ b/src-tauri/src/commands.rs @@ -455,13 +455,13 @@ pub async fn get_claude_code_config_path() -> Result { /// 兼容两种参数:`app_type`(推荐)或 `app`(字符串) #[tauri::command] pub async fn open_config_folder( - app: tauri::AppHandle, + handle: tauri::AppHandle, app_type: Option, - app_str: Option, + app: Option, appType: Option, ) -> Result { let app_type = app_type - .or_else(|| app_str.as_deref().map(|s| s.into())) + .or_else(|| app.as_deref().map(|s| s.into())) .or_else(|| appType.as_deref().map(|s| s.into())) .unwrap_or(AppType::Claude); @@ -476,7 +476,7 @@ pub async fn open_config_folder( } // 使用 opener 插件打开文件夹 - app.opener() + handle.opener() .open_path(config_dir.to_string_lossy().to_string(), None::) .map_err(|e| format!("打开文件夹失败: {}", e))?; diff --git a/src/App.css b/src/App.css index 86ab1b2..186502e 100644 --- a/src/App.css +++ b/src/App.css @@ -50,7 +50,9 @@ background: var(--seg-thumb); border-radius: 999px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15); - transition: transform 220ms ease, width 220ms ease; + transition: + transform 220ms ease, + width 220ms ease; will-change: transform; } diff --git a/src/App.tsx b/src/App.tsx index e024edf..d4a0c9e 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -182,16 +182,14 @@ function App() {

{activeApp === "claude" ? "Claude Code" : "Codex"} 供应商切换器

-
+