From 468b71f7a64c0dcafe8d44f3cafd18f75932b8a3 Mon Sep 17 00:00:00 2001 From: Ian MacLeod Date: Thu, 29 Oct 2026 17:11:17 +0000 Subject: [PATCH] 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 --- ..._catalog_model_session_header_startup.snap | 8 ----- codex-rs/tui/src/history_cell/session.rs | 4 +-- codex-rs/tui/src/history_cell/tests.rs | 33 +++++++++++-------- 3 files changed, 21 insertions(+), 24 deletions(-) diff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__catalog_model_session_header_startup.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__catalog_model_session_header_startup.snap index 65f9035089..915041d85f 100644 --- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__catalog_model_session_header_startup.snap +++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__catalog_model_session_header_startup.snap @@ -6,11 +6,3 @@ expression: rendered OpenAI Codex (v) 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 diff --git a/codex-rs/tui/src/history_cell/session.rs b/codex-rs/tui/src/history_cell/session.rs index 237ef9ec96..b0a53d3358 100644 --- a/codex-rs/tui/src/history_cell/session.rs +++ b/codex-rs/tui/src/history_cell/session.rs @@ -213,7 +213,7 @@ pub(crate) fn new_session_info( )); let mut parts: Vec> = 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> = 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)) diff --git a/codex-rs/tui/src/history_cell/tests.rs b/codex-rs/tui/src/history_cell/tests.rs index cc7f2f668c..d0e70b0574 100644 --- a/codex-rs/tui/src/history_cell/tests.rs +++ b/codex-rs/tui/src/history_cell/tests.rs @@ -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]