From 159510fa3810e60215ba3baac559a02afda4ac2e Mon Sep 17 00:00:00 2001 From: pap Date: Thu, 7 Aug 2025 12:17:15 +0100 Subject: [PATCH] status rendering --- codex-rs/tui/src/history_cell.rs | 41 ++++++++++++++++---------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/codex-rs/tui/src/history_cell.rs b/codex-rs/tui/src/history_cell.rs index 4608ed497c..ba3b5c25a3 100644 --- a/codex-rs/tui/src/history_cell.rs +++ b/codex-rs/tui/src/history_cell.rs @@ -549,6 +549,25 @@ impl HistoryCell { lines.push(Line::from("/status".magenta())); lines.push(Line::from("")); + let config_entries = create_config_summary_entries(config); + let lookup = |k: &str| -> String { + config_entries + .iter() + .find(|(key, _)| *key == k) + .map(|(_, v)| v.clone()) + .unwrap_or_default() + }; + + // 📂 Workspace + lines.push(Line::from(vec!["📂 ".into(), "Workspace".bold()])); + // Path (home-relative, e.g., ~/code/project) + let cwd_str = match relativize_to_home(&config.cwd) { + Some(rel) if !rel.as_os_str().is_empty() => format!("~/{}", rel.display()), + Some(_) => "~".to_string(), + None => config.cwd.display().to_string(), + }; + lines.push(Line::from(vec![" • Path: ".into(), cwd_str.into()])); + // If instructions are configured, show the source paths at the top. let info = collect_instructions_info_sync(config); if info.user_instructions_path.is_some() || info.project_instructions_path.is_some() { @@ -571,29 +590,11 @@ impl HistoryCell { parts.join("") }; lines.push(Line::from(vec![ - "agents.md: ".white().bold(), - joined.white(), + " • AGENTS.md: ".into(), + joined.into(), ])); } - let config_entries = create_config_summary_entries(config); - let lookup = |k: &str| -> String { - config_entries - .iter() - .find(|(key, _)| *key == k) - .map(|(_, v)| v.clone()) - .unwrap_or_default() - }; - - // 📂 Workspace - lines.push(Line::from(vec!["📂 ".into(), "Workspace".bold()])); - // Path (home-relative, e.g., ~/code/project) - let cwd_str = match relativize_to_home(&config.cwd) { - Some(rel) if !rel.as_os_str().is_empty() => format!("~/{}", rel.display()), - Some(_) => "~".to_string(), - None => config.cwd.display().to_string(), - }; - lines.push(Line::from(vec![" • Path: ".into(), cwd_str.into()])); // Approval mode (as-is) lines.push(Line::from(vec![ " • Approval Mode: ".into(),