From 1e55b324aed08b0ad3a029e12eb074c9a882a498 Mon Sep 17 00:00:00 2001 From: Claude Lin & Lay Date: Fri, 21 Aug 2026 09:32:45 +0900 Subject: [PATCH] fix(config): drop the codex tab from the default configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 既定設定が Claude Code と Codex の 2 タブを持っており、docs/0-requirements.md の単一ベンダー構成という制約と矛盾していた。既定を Claude Code 1 タブにした。 部屋は Claude 側にしか存在が確認されていない channel capability の上に成り 立っており、仕様はその未検証前提を消すために単一ベンダーを選んでいる。既定で Codex タブを出すと、部屋へ参加できないセッションを既定で提示することになる。 あわせて left/right ペイン形式からの legacy migration を削除した。liplus-chat は一度もリリースされておらず、app data ディレクトリは自身の identifier (org.liplus-project.liplus-chat) で決まるため、liplus-desktop の旧形式 config がこのアプリに届く経路が存在しない。到達不能な分岐であり、残しても migration が効いているかを確かめる手段がない。 これに伴い cli_kind_from_command も削除した。legacy migration からのみ呼ばれて いたため。 #13 --- src-tauri/src/config.rs | 96 ++++++++--------------------------------- 1 file changed, 19 insertions(+), 77 deletions(-) diff --git a/src-tauri/src/config.rs b/src-tauri/src/config.rs index c97cdc1..b35e443 100644 --- a/src-tauri/src/config.rs +++ b/src-tauri/src/config.rs @@ -43,51 +43,22 @@ pub struct TabSessions { pub sessions: Vec, } -/// Legacy config format for migration -#[derive(Debug, Clone, Deserialize)] -struct LegacyPaneConfig { - command: String, - args: Vec, - cwd: Option, -} - -#[derive(Debug, Clone, Deserialize)] -struct LegacyAppConfig { - left: LegacyPaneConfig, - right: LegacyPaneConfig, -} - -fn cli_kind_from_command(command: &str) -> String { - if command.to_lowercase().contains("codex") { - "codex".to_string() - } else if command.to_lowercase().contains("gemini") { - "gemini".to_string() - } else { - "claude".to_string() - } -} - impl Default for AppConfig { fn default() -> Self { + // One vendor, by decision rather than by omission: the room is built + // on a channel capability only this CLI is known to have, and the + // spec drops the second vendor to keep that premise out of the + // design. Shipping a tab that cannot join the room by default would + // present a session that never speaks. See docs/0-requirements.md. AppConfig { - tabs: vec![ - TabConfig { - id: "tab-1".to_string(), - name: "Claude Code".to_string(), - command: "claude".to_string(), - args: vec![], - cwd: None, - cli_kind: "claude".to_string(), - }, - TabConfig { - id: "tab-2".to_string(), - name: "Codex".to_string(), - command: "codex".to_string(), - args: vec![], - cwd: None, - cli_kind: "codex".to_string(), - }, - ], + tabs: vec![TabConfig { + id: "tab-1".to_string(), + name: "Claude Code".to_string(), + command: "claude".to_string(), + args: vec![], + cwd: None, + cli_kind: "claude".to_string(), + }], } } } @@ -109,41 +80,12 @@ pub fn load_config(app: AppHandle) -> Result { let content = std::fs::read_to_string(&path).map_err(|e| format!("Failed to read config: {e}"))?; - // Try parsing as new format first - if let Ok(config) = serde_json::from_str::(&content) { - return Ok(config); - } - - // Fall back to legacy left/right format and migrate - if let Ok(legacy) = serde_json::from_str::(&content) { - let migrated = AppConfig { - tabs: vec![ - TabConfig { - id: "tab-1".to_string(), - name: "Claude Code".to_string(), - command: legacy.left.command.clone(), - args: legacy.left.args, - cwd: legacy.left.cwd, - cli_kind: cli_kind_from_command(&legacy.left.command), - }, - TabConfig { - id: "tab-2".to_string(), - name: "Codex".to_string(), - command: legacy.right.command.clone(), - args: legacy.right.args, - cwd: legacy.right.cwd, - cli_kind: cli_kind_from_command(&legacy.right.command), - }, - ], - }; - // Save migrated config - if let Ok(json) = serde_json::to_string_pretty(&migrated) { - let _ = std::fs::write(&path, json); - } - return Ok(migrated); - } - - Err("Failed to parse config: unrecognized format".to_string()) + // No legacy migration path exists. liplus-chat has never shipped a + // release, and its app data directory is keyed to its own identifier + // (org.liplus-project.liplus-chat), so no config in the older + // left/right pane format from liplus-desktop can reach this app. + serde_json::from_str::(&content) + .map_err(|e| format!("Failed to parse config: {e}")) } #[tauri::command]