Lightweight coding agent that runs in your terminal
Rust
Use consistent TUI input placeholders (#37360)
Eric Traut5bdc88970801
diff --git a/codex-rs/tui/src/chatwidget.rs b/codex-rs/tui/src/chatwidget.rsindex 4948cce1e3..11c9656271 100644--- a/codex-rs/tui/src/chatwidget.rs+++ b/codex-rs/tui/src/chatwidget.rs@@ -165,7 +165,6 @@ use crossterm::event::KeyCode;use crossterm::event::KeyEvent;use crossterm::event::KeyEventKind;use crossterm::event::KeyModifiers;-use rand::Rng;use ratatui::buffer::Buffer;use ratatui::layout::Rect;use ratatui::style::Modifier;@@ -1977,22 +1976,8 @@ impl Drop for ChatWidget {}}-const PLACEHOLDERS: [&str; 8] = [- "Explain this codebase",- "Summarize recent commits",- "Implement {feature}",- "Find and fix a bug in @filename",- "Write tests for @filename",- "Improve documentation in @filename",- "Run /review on my current changes",- "Use /skills to list available skills",-];--const SIDE_PLACEHOLDERS: [&str; 3] = [- "Check recently modified functions for compatibility",- "How many files have been modified?",- "Will this algorithm scale well?",-];+const PLACEHOLDER: &str = "Ask Codex to do anything";+const SIDE_PLACEHOLDER: &str = "Ask a follow-up question";// Extract the first bold (Markdown) element in the form **...** from `s`.// Returns the inner text if found; otherwise `None`.diff --git a/codex-rs/tui/src/chatwidget/constructor.rs b/codex-rs/tui/src/chatwidget/constructor.rsindex 06ccca7313..ebb0f4e1e4 100644--- a/codex-rs/tui/src/chatwidget/constructor.rs+++ b/codex-rs/tui/src/chatwidget/constructor.rs@@ -36,10 +36,8 @@ impl ChatWidget {let mut config = config;config.model = model.clone();let prevent_idle_sleep = config.features.enabled(Feature::PreventIdleSleep);- let mut rng = rand::rng();- let placeholder = PLACEHOLDERS[rng.random_range(0..PLACEHOLDERS.len())].to_string();- let side_placeholder =- SIDE_PLACEHOLDERS[rng.random_range(0..SIDE_PLACEHOLDERS.len())].to_string();+ let placeholder = PLACEHOLDER.to_string();+ let side_placeholder = SIDE_PLACEHOLDER.to_string();let model_override = model.as_deref();let model_for_header = modeldiff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__side_context_label_preserves_status_line.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__side_context_label_preserves_status_line.snapindex 6ab706777b..454a67e000 100644--- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__side_context_label_preserves_status_line.snap+++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__side_context_label_preserves_status_line.snap@@ -4,6 +4,6 @@ expression: terminal.backend()---" "" "-"› Check recently modified functions for compatibility "+"› Ask a follow-up question "" "" gpt-5.6-sol Side from main thread · ctrl + / to switch · ctrl + c to close "diff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__side_context_label_shows_parent_status.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__side_context_label_shows_parent_status.snapindex 84c11757e5..b873d754c3 100644--- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__side_context_label_shows_parent_status.snap+++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__side_context_label_shows_parent_status.snap@@ -4,6 +4,6 @@ expression: terminal.backend()---" "" "-"› Check recently modified functions for compatibility "+"› Ask a follow-up question "" "" Side from main thread · main needs input · ctrl + / to switch · ctrl + c to cl"diff --git a/codex-rs/tui/src/chatwidget/tests/helpers.rs b/codex-rs/tui/src/chatwidget/tests/helpers.rsindex a7e9fe2012..fbf04b2987 100644--- a/codex-rs/tui/src/chatwidget/tests/helpers.rs+++ b/codex-rs/tui/src/chatwidget/tests/helpers.rs@@ -206,12 +206,6 @@ pub(super) async fn make_chatwidget_manual_with_auth(let mut widget = ChatWidget::new_with_op_target(common, super::CodexOpTarget::Direct(op_tx));widget.transcript.active_cell = None;widget.transcript.active_cell_revision = 0;- widget.normal_placeholder_text = "Ask Codex to do anything".to_string();- widget.side_placeholder_text =- "Check recently modified functions for compatibility".to_string();- widget- .bottom_pane- .set_placeholder_text(widget.normal_placeholder_text.clone());widget.set_model(&resolved_model);(widget, rx, op_rx)}