mirror of
https://github.com/openai/codex.git
synced 2026-09-10 20:26:47 +00:00
Use consistent TUI input placeholders (#37360)
## What changed - Show `Ask Codex to do anything` in the main conversation input. - Show `Ask a follow-up question` in side conversation inputs. - Remove randomized example prompt selection and update the side conversation snapshots. GitOrigin-RevId: 2f6d310cf80bfa9743b7695621892a821eda4a18
This commit is contained in:
@@ -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`.
|
||||
|
||||
@@ -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 = model
|
||||
|
||||
@@ -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 "
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user