mirror of
https://github.com/openai/codex.git
synced 2026-10-30 19:18:49 +00:00
Honor the tooltip preference for TUI startup help (#58127)
## Why The startup command list was shown even when tooltips were disabled. ## What changed Show the getting-started help only when `show_tooltips` is enabled. Keep regular tooltips and model-change notices suppressed on the first session event. ## Testing Extend the first-event test to cover both tooltip preferences and update the startup header snapshot. GitOrigin-RevId: 7b4a043737053f1a078cb21528dc459f0cfd762b
This commit is contained in:
-8
@@ -6,11 +6,3 @@ expression: rendered
|
||||
OpenAI Codex (v<VERSION>)
|
||||
model: GPT-5.6 Luna high
|
||||
directory: /tmp/thread-settings
|
||||
|
||||
To get started, describe a task or try one of these commands:
|
||||
|
||||
/init - create an AGENTS.md file with instructions for Codex
|
||||
/status - show current session configuration
|
||||
/permissions - choose what Codex is allowed to do
|
||||
/model - choose what model and reasoning effort to use
|
||||
/review - review any changes and find issues
|
||||
|
||||
@@ -213,7 +213,7 @@ pub(crate) fn new_session_info(
|
||||
));
|
||||
let mut parts: Vec<Box<dyn HistoryCell>> = vec![Box::new(header)];
|
||||
|
||||
if is_first_event {
|
||||
if is_first_event && local_settings.tui.show_tooltips {
|
||||
// Help lines below the header (new copy and list)
|
||||
let help_lines: Vec<Line<'static>> = vec![
|
||||
" To get started, describe a task or try one of these commands:"
|
||||
@@ -248,7 +248,7 @@ pub(crate) fn new_session_info(
|
||||
];
|
||||
|
||||
parts.push(Box::new(PlainHistoryCell { lines: help_lines }));
|
||||
} else {
|
||||
} else if !is_first_event {
|
||||
if local_settings.tui.show_tooltips
|
||||
&& let Some(tooltips) = tooltip_override
|
||||
.or_else(|| tooltips::get_tooltip(auth_plan, &local_settings.tui.keymap))
|
||||
|
||||
@@ -827,22 +827,27 @@ async fn session_info_preserves_styled_tooltip_links() {
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn session_info_first_event_suppresses_tooltips_and_nux() {
|
||||
async fn session_info_first_event_respects_tooltip_preference() {
|
||||
let config = test_config().await;
|
||||
let cell = new_session_info(
|
||||
&config,
|
||||
&crate::local_settings::LocalSettings::from(&config),
|
||||
"gpt-5",
|
||||
"gpt-5",
|
||||
&session_configured_event("gpt-5"),
|
||||
/*is_first_event*/ true,
|
||||
Some("Model just became available".to_string()),
|
||||
Some(PlanType::Free),
|
||||
);
|
||||
let mut local_settings = crate::local_settings::LocalSettings::from(&config);
|
||||
for show_tooltips in [true, false] {
|
||||
local_settings.tui.show_tooltips = show_tooltips;
|
||||
let cell = new_session_info(
|
||||
&config,
|
||||
&local_settings,
|
||||
"requested-model",
|
||||
"gpt-5",
|
||||
&session_configured_event("gpt-5"),
|
||||
/*is_first_event*/ true,
|
||||
Some("Model just became available".to_string()),
|
||||
Some(PlanType::Free),
|
||||
);
|
||||
|
||||
let rendered = render_transcript(&cell).join("\n");
|
||||
assert!(!rendered.contains("Model just became available"));
|
||||
assert!(rendered.contains("To get started"));
|
||||
let rendered = render_transcript(&cell).join("\n");
|
||||
assert_eq!(rendered.contains("To get started"), show_tooltips);
|
||||
assert!(!rendered.contains("Model just became available"));
|
||||
assert!(!rendered.contains("model changed:"));
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
||||
Reference in New Issue
Block a user