diff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__startup_header_active_cell.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__startup_header_active_cell.snap index edd9adfed6..496b9cbf33 100644 --- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__startup_header_active_cell.snap +++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__startup_header_active_cell.snap @@ -1,20 +1,11 @@ --- source: tui/src/chatwidget/tests.rs -assertion_line: 2618 -expression: terminal.backend() +assertion_line: 2612 +expression: active_blob(&chat) --- -" " -"╭───────────────────────────────────────╮ " -"│ >_ OpenAI Codex (v0.0.0) │ " -"│ │ " -"│ model: loading /model to change │ " -"│ directory: ~/code/codex/codex-rs/tui │ " -"╰───────────────────────────────────────╯ " -" " -" " -"› Ask Codex to do anything " -" " -" 100% context left · ? for shortcuts " -" " -" " -" " +╭───────────────────────────────────────╮ +│ >_ OpenAI Codex (v0.0.0) │ +│ │ +│ model: loading /model to change │ +│ directory: /home/user/project │ +╰───────────────────────────────────────╯ diff --git a/codex-rs/tui/src/chatwidget/tests.rs b/codex-rs/tui/src/chatwidget/tests.rs index e3a7d3cefa..d43adb448e 100644 --- a/codex-rs/tui/src/chatwidget/tests.rs +++ b/codex-rs/tui/src/chatwidget/tests.rs @@ -2602,20 +2602,14 @@ async fn ui_snapshots_small_heights_idle() { #[tokio::test] async fn startup_header_renders_in_active_cell_before_session_configured_snapshot() { - use ratatui::Terminal; - use ratatui::backend::TestBackend; - let (mut chat, _rx, _op_rx) = make_chatwidget_manual(None).await; chat.active_cell = Some(Box::new( - crate::history_cell::StartupSessionHeaderHistoryCell::new(chat.config.cwd.clone()), + // Use a path that's not under $HOME so the rendered directory is stable across CI/dev. + crate::history_cell::StartupSessionHeaderHistoryCell::new(PathBuf::from( + "/home/user/project", + )), )); - - let mut terminal = Terminal::new(TestBackend::new(60, 15)).expect("create terminal"); - terminal - .draw(|f| chat.render(f.area(), f.buffer_mut())) - .expect("draw startup header"); - - assert_snapshot!("startup_header_active_cell", terminal.backend()); + assert_snapshot!("startup_header_active_cell", active_blob(&chat)); } #[tokio::test] diff --git a/codex-rs/tui2/src/chatwidget/snapshots/codex_tui2__chatwidget__tests__startup_header_active_cell.snap b/codex-rs/tui2/src/chatwidget/snapshots/codex_tui2__chatwidget__tests__startup_header_active_cell.snap index b5b4f9a665..a5ce1eff0b 100644 --- a/codex-rs/tui2/src/chatwidget/snapshots/codex_tui2__chatwidget__tests__startup_header_active_cell.snap +++ b/codex-rs/tui2/src/chatwidget/snapshots/codex_tui2__chatwidget__tests__startup_header_active_cell.snap @@ -1,11 +1,11 @@ --- source: tui2/src/chatwidget/tests.rs -assertion_line: 160 +assertion_line: 161 expression: active_blob(&chat) --- ╭───────────────────────────────────────╮ │ >_ OpenAI Codex (v0.0.0) │ │ │ │ model: loading /model to change │ -│ directory: ~/code/codex/codex-rs/tui2 │ +│ directory: /home/user/project │ ╰───────────────────────────────────────╯ diff --git a/codex-rs/tui2/src/chatwidget/tests.rs b/codex-rs/tui2/src/chatwidget/tests.rs index 58f9806608..f838879830 100644 --- a/codex-rs/tui2/src/chatwidget/tests.rs +++ b/codex-rs/tui2/src/chatwidget/tests.rs @@ -153,7 +153,8 @@ async fn resumed_initial_messages_render_history() { #[tokio::test] async fn startup_header_renders_in_active_cell_before_session_configured_snapshot() { let (mut chat, _rx, _op_rx) = make_chatwidget_manual(None).await; - let startup_dir = chat.config.cwd.clone(); + // Use a path that's not under $HOME so the rendered directory is stable across CI/dev. + let startup_dir = PathBuf::from("/home/user/project"); chat.active_cell = Some(Box::new( crate::history_cell::StartupSessionHeaderHistoryCell::new(startup_dir), ));