From e26d2db1a059fb039a1925d7e59143e603df6e6f Mon Sep 17 00:00:00 2001 From: Daniel Edrisian Date: Tue, 14 Oct 2025 09:46:14 -0700 Subject: [PATCH] fix --- codex-rs/cli/src/main.rs | 4 +++- codex-rs/tui/src/app.rs | 2 +- codex-rs/tui/src/chatwidget.rs | 41 ++++++++++++++++------------------ 3 files changed, 23 insertions(+), 24 deletions(-) diff --git a/codex-rs/cli/src/main.rs b/codex-rs/cli/src/main.rs index 7e51539ea7..6f496213a0 100644 --- a/codex-rs/cli/src/main.rs +++ b/codex-rs/cli/src/main.rs @@ -480,6 +480,7 @@ fn print_completion(cmd: CompletionCommand) { } fn run_update_action(action: UpdateAction) -> anyhow::Result<()> { + println!(); match action { UpdateAction::NpmGlobalLatest => { println!("Updating Codex via npm (global latest)…"); @@ -500,7 +501,8 @@ fn run_update_action(action: UpdateAction) -> anyhow::Result<()> { } } } - println!("Update complete."); + println!(); + println!("🎉 Update ran successfully! Please restart Codex."); Ok(()) } diff --git a/codex-rs/tui/src/app.rs b/codex-rs/tui/src/app.rs index d7db5c5580..35ea24d8c8 100644 --- a/codex-rs/tui/src/app.rs +++ b/codex-rs/tui/src/app.rs @@ -163,7 +163,7 @@ impl App { // Show an update approval popup at startup when an update is available. #[cfg(not(debug_assertions))] if let Some(latest_version) = crate::updates::get_upgrade_version(&app.config) { - app.chat_widget.open_update_popup(latest_version); + app.chat_widget.open_update_popup(); } let tui_events = tui.event_stream(); diff --git a/codex-rs/tui/src/chatwidget.rs b/codex-rs/tui/src/chatwidget.rs index 5e7fcc9996..9f1af3e472 100644 --- a/codex-rs/tui/src/chatwidget.rs +++ b/codex-rs/tui/src/chatwidget.rs @@ -80,6 +80,7 @@ use crate::history_cell; use crate::history_cell::AgentMessageCell; use crate::history_cell::HistoryCell; use crate::history_cell::McpToolCallCell; +use crate::history_cell::padded_emoji; use crate::markdown::append_markdown; use crate::slash_command::SlashCommand; use crate::status::RateLimitSnapshotDisplay; @@ -1813,24 +1814,10 @@ impl ChatWidget { } /// Open a simple modal asking to update Codex when an update is available. - pub(crate) fn open_update_popup(&mut self, latest_version: String) { + pub(crate) fn open_update_popup(&mut self) { use ratatui::style::Stylize as _; use ratatui::text::Line; - let current_version = CODEX_CLI_VERSION; - let title = "Update Approval".to_string(); - - // Build header lines with the prompt and version info. - let mut header_lines: Vec> = vec![ - Line::from("Should I update Codex?".bold()), - Line::from(""), - Line::from(vec![ - "Update available!".bold().cyan(), - " ".into(), - format!("{current_version} -> {latest_version}.").bold(), - ]), - ]; - // Determine the recommended update method. let exe = std::env::current_exe().unwrap_or_default(); let managed_by_npm = std::env::var_os("CODEX_MANAGED_BY_NPM").is_some(); @@ -1844,16 +1831,26 @@ impl ChatWidget { None }; + // Don't show the update popup if no update action is available. if update_action.is_none() { - header_lines.push(Line::from("")); - header_lines.push(Line::from(vec![ - "See ".into(), + return; + } + + // Build header lines with the prompt and version info. + let header_lines: Vec> = vec![ + Line::from(vec![ + padded_emoji("✨").bold().cyan(), + "New version available! Would you like to update?".bold(), + ]), + Line::from(""), + Line::from(vec![ + "Full release notes: ".dim(), "https://github.com/openai/codex/releases/latest" .cyan() .underlined(), - " for installation options.".into(), - ])); - } + ]), + Line::from(""), + ]; let mut items: Vec = Vec::new(); if let Some(action) = update_action { @@ -1874,7 +1871,7 @@ impl ChatWidget { }); self.bottom_pane.show_selection_view(SelectionViewParams { - title: Some(title), + title: None, footer_hint: Some(standard_popup_hint_line()), items, header: Box::new(ratatui::widgets::Paragraph::new(header_lines)),