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:
Ian MacLeod
2026-10-29 17:18:43 +00:00
committed by copyberry
parent 09db085f94
commit 468b71f7a6
3 changed files with 21 additions and 24 deletions
@@ -6,11 +6,3 @@ expression: rendered
OpenAI Codex (v<VERSION>) OpenAI Codex (v<VERSION>)
model: GPT-5.6 Luna high model: GPT-5.6 Luna high
directory: /tmp/thread-settings 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
+2 -2
View File
@@ -213,7 +213,7 @@ pub(crate) fn new_session_info(
)); ));
let mut parts: Vec<Box<dyn HistoryCell>> = vec![Box::new(header)]; 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) // Help lines below the header (new copy and list)
let help_lines: Vec<Line<'static>> = vec![ let help_lines: Vec<Line<'static>> = vec![
" To get started, describe a task or try one of these commands:" " 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 })); parts.push(Box::new(PlainHistoryCell { lines: help_lines }));
} else { } else if !is_first_event {
if local_settings.tui.show_tooltips if local_settings.tui.show_tooltips
&& let Some(tooltips) = tooltip_override && let Some(tooltips) = tooltip_override
.or_else(|| tooltips::get_tooltip(auth_plan, &local_settings.tui.keymap)) .or_else(|| tooltips::get_tooltip(auth_plan, &local_settings.tui.keymap))
+19 -14
View File
@@ -827,22 +827,27 @@ async fn session_info_preserves_styled_tooltip_links() {
} }
#[tokio::test] #[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 config = test_config().await;
let cell = new_session_info( let mut local_settings = crate::local_settings::LocalSettings::from(&config);
&config, for show_tooltips in [true, false] {
&crate::local_settings::LocalSettings::from(&config), local_settings.tui.show_tooltips = show_tooltips;
"gpt-5", let cell = new_session_info(
"gpt-5", &config,
&session_configured_event("gpt-5"), &local_settings,
/*is_first_event*/ true, "requested-model",
Some("Model just became available".to_string()), "gpt-5",
Some(PlanType::Free), &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"); let rendered = render_transcript(&cell).join("\n");
assert!(!rendered.contains("Model just became available")); assert_eq!(rendered.contains("To get started"), show_tooltips);
assert!(rendered.contains("To get started")); assert!(!rendered.contains("Model just became available"));
assert!(!rendered.contains("model changed:"));
}
} }
#[tokio::test] #[tokio::test]